schrodinger.application.matsci.multiapp module

Module for af2 App classes that run multiple jobs

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.multiapp.CMD_DRIVER_DATA(driver, cmd)

Bases: tuple

cmd

Alias for field number 1

driver

Alias for field number 0

class schrodinger.application.matsci.multiapp.MultiJobApp(**kwargs)

Bases: schrodinger.ui.qt.appframework2.af2.JobApp

Subclass of AF2 JobApp that allows launching multiple simultanious jobs.

Every panel subclassing this should re-implement getJobCount() and getJobSpec() methods. A start method should NOT be implemented.

validateJobCount()
showLaunchStatus(num_succeeded, njobs)

Show a label at the bottom of the panel with status of the launch.

Parameters
  • num_succeeded (int) – Number of jobs that were successfully launched

  • njobs (int) – Total number of jobs

getJobCount()

Over-ride in the subclass to return the number of jobs that the user would like to start. Used for validation.

:return the number of jobs that the user requests. :rtype: int

multiJobStart()

Custom “start” method. For each job, creates a job sub-directory, cd’s into it, and launches the job there.

:return list of return values from self.launchFromJobSpec() calls.

Each value is a Job object or False, in start mode, or True/False in write mode.

getValidatedOPLSDir(oplsdir=None)

Validate the existing oplsdir or get a requested oplsdir from the user’s selection in the force field selector widget

Parameters

oplsdir (str) – The currently requested oplsdir

Return type

False, None or str

Returns

False if no valid oplsdir can be found, None if there is no custom dir requested, or the path to the custom directory

makeJobSpec(sub_jobname, job_num)

Return job spec from job spec itself or some other data.

Parameters
  • sub_jobname (str) – The job name for the subjob

  • job_num (int) – The subjob number

Return type

launchapi.JobSpecification

Returns

JobSpecification object

Raises

SystemExit – On driver.get_job_spec_from_args error

launchFromJobSpec(sub_jobname, job_num, oplsdir=None)

Re-implemented from JobApp; options and behavior is somewhat differnt.

Starts or write the command for the given subjob.

Parameters
  • sub_jobname (str) – The job name for the subjob

  • job_num (int) – The subjob number

  • oplsdir (str) – Path to OPLS directory

Returns

Job object on successful start; True on successful write, False on failure.

class schrodinger.application.matsci.multiapp.CmdJobMixin

Bases: object

Mixin for multi apps that uses launchJobCmd() instead of launchFromJobSpec()

multiJobStart()

Custom “start” method. For each job, creates a job sub-directory, cd’s into it, and launches the job there.

Return type

list

Returns

list of return values from self.launchFromJobSpec() calls. Each value is a Job object or False, in start mode, or True/False in write mode.

class schrodinger.application.matsci.multiapp.MultiDesmondJobApp(**kwargs)

Bases: schrodinger.application.matsci.multiapp.MultiJobApp

Class with functionality for setting up, validating and running multiple Desmond jobs.

setup()
setDefaults()
setPanelOptions()

Override the generic parent class to set panel options.

getModel(index)

Return the model system at the specified index.

Parameters

index (int) – Index of the system to return

Return type

cms.Cms or structure.Structure

Returns

Model system at the specified job index or structure (if allow_mixed_cms_mae is enabled)

getJobCount()

Return the number of jobs that the user would like to run.

Returns

Number of jobs to run

Return type

int

getStructFromPtEntry()

Get the first included entry in the Workspace if that entry is one of the chosen entries, or the first selected entry if no included entry is chosen.

Return type

(schrodinger.structure.Structure, string) or (None, None)

Returns

one structure from selected or included entries, the structure entry id

customOPLSDirForModel(job_num)

Get the custom OPLS directory (if any) for the model corresponding to job_num

Parameters

job_num (int) – The index of the job number

Return type

str or None

Returns

The opls directory to use, or None if this model does not use it

launchFromJobSpec(sub_jobname, job_num, oplsdir=None)

See parent class for documentation. Here mainly OPLS directory is obtained from structure properties.

validateModelLoaded()

At runtime we check the user’s input selection and attempt to load the input, ensuring that all specified inputs are valid models.

Parameters

allow_mae (bool) – Whether loaded entries can be a mix of CMS and MAE. This is true for the MSD diffusion that accepts also QEMD traj

class schrodinger.application.matsci.multiapp.MultiCmdJobApp(**kwargs)

Bases: schrodinger.application.matsci.multiapp.CmdJobMixin, schrodinger.application.matsci.multiapp.MultiDesmondJobApp

Class with functionality for setting up, validating and running multiple Desmond jobs with GPU subhosts via commands.

Note: multiJobStart() fires off multiple jobs by launchJobCmd(), which calls setupJobCmd() to add HOST and SUBHOST flags.

getJobCmd(jobname, job_number, cmd=None)

Must be inherited by subclasses to yield a command list

Parameters
  • jobname (str) – The job name

  • job_number (int) – the job number

  • cmd (list) – The list of command args to this point

Return type

list of str

Returns

a list of the command args for job submission

setupJobCmd(cmdlist, auto_add_host=True, auto_add_subhost=True, **kwargs)

Adds arguments such as HOST, SUBHOST, and GPU flags to cmdlist beyond the parent class method if they are set in the config dialog. Settings pre-existing in the cmdlist take precedence over the config dialog settings.

Parameters
  • cmdlist (list) – the command list

  • auto_add_host (bool) – Whether or not to automatically add -HOST flat to command when it is not already included.

  • auto_add_subhost (bool) – Whether or not to automatically add -SUBHOST flat to command when it is not already included.