schrodinger.application.desmond.launch_utils module

Functions to help with launching and restarting an FEP+ simulation.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.desmond.launch_utils.prepare_command_for_launch(host: str, subhost: str, jobname: str, msj: str, maxjob: int, input_fname: Union[str, NoneType] = None) → List[str]
Parameters:
  • host – Hostname for the job.
  • subhost – Subhost for the job.
  • jobname – Jobname for the job.
  • msj – The msj filename to pass to multisim.
  • maxjob – The maximum number of concurrent jobs.
  • input_fname – If set, the structure or fmp input filename. If an fmp file, the pv_file will be written to the same directory and used as the structure input.
Returns:

Multisim command to launch the job.

schrodinger.application.desmond.launch_utils.prepare_command_for_restart(engine: schrodinger.application.desmond.cmj.Engine, stage_data_fnames: List[str], host: str, subhost: str, cpt_fname: str, jobname: Union[str, NoneType] = None, msj: Union[str, NoneType] = None, rst_stage: Union[int, NoneType] = None, rst_whole: bool = False, input_fname: Union[str, NoneType] = None) → List[str]
Parameters:
  • engine – Represents the current job state.
  • stage_data_fnames – List of filenames to be used for restarting the job.
  • host – Hostname for the job.
  • subhost – Subhost for the job.
  • cpt_fname – Checkpoint filename.
  • jobname – Jobname if set, otherwise get it from the engine.
  • msj – If set, the msj filename to pass to multisim.
  • rst_stage – If set, the restart stage number.
  • rst_whole – Set to True to restart the job from scratch or False to continue a partially complete job.
  • input_fname – If set, the structure input filename. Only needed for a full restart at stage 2.
Returns:

Multisim command to restart the job.

Raises:

SystemExit – If file from stage_data_fnames could not be found.

schrodinger.application.desmond.launch_utils.additional_command_arguments(stage_data_fnames: List[str], retries: str, wait: bool, local: bool, debug: bool, tmpdir: Union[str, NoneType], forcefield: Union[str, NoneType], opls_dir: Union[str, NoneType], nice: bool, save: bool, detached: bool) → List[str]
Parameters:
  • stage_data_fnames – List of filenames to be used for restarting the job.
  • retries – Set to control the number of retries for a failed job.
  • wait – Set to True to wait until the job has completed before returning.
  • local – Set to True to run the job in the current directory.
  • debug – Set to True to enable debugging.
  • tmpdir – Set to override the temporary directory location.
  • forcefield – Set to the name for the forcefield.
  • opls_dir – If present, the path to the opls directory.
  • nice – Set to True to run the job at reduced priority.
  • save – Set to True to return a zip archive of the job directory on completion.
  • detached – Set to True for a detached job.
Returns:

Additional arguments for the multisim command to launch the job.

schrodinger.application.desmond.launch_utils.find_checkpoint_file() → str

Find the checkpoint file in the current working directory.

Raises:SystemExit – If checkpoint not found.
schrodinger.application.desmond.launch_utils.read_checkpoint_file(cpt_fname: str) → schrodinger.application.desmond.cmj.Engine

Read a checkpoint file and return the initialized Engine object.

Parameters:cpt_fname – The checkpoint filename.
Raises:SystemExit – If checkpoint could not be read.
schrodinger.application.desmond.launch_utils.get_checkpoint_file_and_restart_number(checkpoint: Union[str, NoneType] = None) -> (<class 'str'>, typing.Union[int, NoneType])

Return the checkpoint filename and the restart stage number if specified.

Parameters:checkpoint – If specified, the checkpoint string, in the format “checkpoint_filename:restart_stage_number” or “checkpoint_filename”. Otherwise, find the checkpoint file in the current working directory.
Raises:SystemExit – If checkpoint is not valid or could not be found.
schrodinger.application.desmond.launch_utils.get_restart_stage_from_engine(engine: schrodinger.application.desmond.cmj.Engine) → Union[int, NoneType]
Parameters:engine – Represents the current job state.
Returns:The restart stage number from the job engine if found. Otherwise, None.
schrodinger.application.desmond.launch_utils.get_multisim_stage_numbers(engine: schrodinger.application.desmond.cmj.Engine) → List[int]
Parameters:engine – Represents the current job state.
Returns:List of multisim stage numbers.
schrodinger.application.desmond.launch_utils.validate_restart_stage(engine: schrodinger.application.desmond.cmj.Engine, rst_stage: Union[int, NoneType] = None) → None

Validate the rst_stage for the given job engine. Note: this will exit if the rst_stage is not valid.

Parameters:
  • engine – Represents the current job state.
  • rst_stage – The restart stage index.
Raises:

SystemExit – If the restart stage is not valid.

schrodinger.application.desmond.launch_utils.prepare_multisim_files_for_restart(engine: schrodinger.application.desmond.cmj.Engine, multisim_stage_numbers: List[int], cpt_fname: str, rst_stage: int, rst_whole: bool, skip_traj: bool = False) → List[str]

Prepare the files needed to restart a multisim job and return list of those files.

Parameters:
  • engine – Represents the current job state.
  • multisim_stage_numbers – List of multisim stage numbers.
  • cpt_fname – Checkpoint filename.
  • rst_stage – The restart stage index.
  • rst_whole – Set to True to restart the job from scratch or False to continue a partially complete job.
  • skip_traj – Set to True to not compress the trajectory information in the tar.
Returns:

List of filenames to be used for restarting the job.

Raises:

SystemExit – If files could not be prepared.