salvus.flow.executors.executor_utils
Shared functionality for some of the sites.
Classes
RemoteCommand
RemoteCommandclass RemoteCommand(builtins.object):
def __init__(
self, command: str, execute_with_mpi: bool, ranks: Optional[int] = None
) -> None: ...Represents a remote command.
Ranks should of course only be set if execute_with_mpi is True.
Parameters
commandstr — The command to be executed.,execute_with_mpibool — True if it should be run with MPI.ranksOptional[int] — How many ranks to execute with, if run with MPI.
SiteConfig
SiteConfigclass SiteConfig(salvus.flow.utils.serialization_helpers.SerializationMixin):
def __init__(
self,
site_name: str,
ranks_per_job: Optional[int, numpy.int32, numpy.int64] = None,
wall_time_in_seconds_per_job: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
memory_per_rank_in_MB: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
max_events_per_job_submission: Union[
int, numpy.int32, numpy.int64
] = 0,
verbosity: int = 0,
skip_validation: bool = False,
): ...Utility class to store job parameter for a run
Parameters
site_namestr — The site to run on.ranks_per_jobOptional[int, numpy.int32, numpy.int64] — The number of ranks to run with. Defaults to the site’s configuration value.wall_time_in_seconds_per_jobOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — The wall time in seconds if the site requires one.memory_per_rank_in_MBOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Optional memory settings for the site.max_events_per_job_submissionUnion[int, numpy.int32, numpy.int64] — Optional chunkwise job submission. If set to a positive number, simulations will be launched in chunks.verbosityint — The verbosity level.skip_validationbool — Skip validation of the site.
Attributes
ranks_per_job int
ranks_per_job intThe number of ranks per job
Methods
from_json()
from_json()def from_json(d: Dict) -> SiteConfig: ...Construct object from a JSON-serializable dictionary.
Parameters
dDict — JSON dictionary of the inverse problem.
Returns SiteConfig
to_json()
to_json()def to_json(self, skip_validation: Optional[bool] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON. Optionally overwrite the validation strategy.
Parameters
skip_validationOptional[bool] — Skip object validation prior to writing.
Returns Dict