Job class¶
Code author: Niklaus Johner <niklaus.johner@a3.epfl.ch>
This file contains the Job
object which represents a job on a cluster.
-
class
Job
(phase)¶ This class is the bottom of the hierarchical structure used in SiPMF. There is one
Job
object for everyPhase
of everyWindow
. This object is used to submit a job to the cluster and check its statusParameters: phase ( Phase
) – The corresponding simulation phase.-
GenerateInputFile
()¶ Generate the MD input file. This function reads the template input file (either the initialization input file or the run input file) and replaces several fields by their corresponding values, notably: {BASEDIR},{RESTARTDIR},{OUTPUTDIR} as well as the values and spring constants of the CVs. Specifically for each CV a field containing its name ({cvname}) is replaced by its value and {cvname_K} is replaced by the spring constant. For the initialization we also replace fields for the collective variables from the parent phase {PARENT_cvname} by the value. Finally in the initialization input, {INIT_NSTEP} will be replaced by its value (system.init_nstep) and for a run phase {RUN_NSTEP} is replaced by system.run_nstep.
-
GenerateJobFile
()¶ Generate the Job submission file. This function reads the template job file (either the initialization job file or the run job file) and replaces several fields by their corresponding values, notably {BASEDIR}, {RESTARTDIR}, {OUTPUTDIR}, {WINDOW}, {PHASE} and {INPUTFILE}. For the initialization job submission file we also replace fields for the parent window, namely {PARENT_WINDOW} and {PARENT_PHASE}.
-
GetInitInputReplacementDict
()¶ This function returns a dictionary containing the fields that will be replaced only in the initialization MD input files.
-
GetInitJobReplacementDict
()¶ This function returns a dictionary containing the fields that will be replaced only in the initialization Job submission files.
-
GetInputReplacementDict
()¶ This function returns a dictionary containing the fields that will be replaced both in the run and in the initialization MD input files.
-
GetJobReplacementDict
()¶ This function returns a dictionary containing the fields that will be replaced both in the run and in the initialization Job submission files.
-
GetRunInputReplacementDict
()¶ This function returns a dictionary containing the fields that will be replaced only in the run MD input files.
-
GetRunJobReplacementDict
()¶ This function returns a dictionary containing the fields that will be replaced only in the run Job submission files.
-
Submit
(environment)¶ Submit the job to the cluster
Parameters: environment ( Environment
) – The environment used to submit the job
-
UpdateStatus
(environment)¶ Check whether the job is still in the queue
Parameters: environment ( Environment
) – The environment used to check the job status
-