Package schrodinger :: Package application :: Package mopac :: Module mopac_backend
[hide private]
[frames] | no frames]

Module mopac_backend

Driver script for running MOPAC7.1 and MOPAC2012 backend execs.

Functions [hide private]
 
_transfer_subjob_files(jobbe, job_id)
Copy files held in a job record from the working dir to the launch dir associated with a jobcontrol backend.
 
_distribute(cmds)
Create a JobDJ, populate it with cmdline invocations, and launch it.
 
_run_single_structure_mae_file(parsed_args, maefile)
Run a single-structure .mae file locally.
 
_gather_output_files(workdir, filemap)
Gather subjob output .mae files into combined output .mae files corresponding to original .mae file input batches.
 
_run_multiple_mae_files(option_flags, filemap, workdir)
Run multiple single-structure .mae files distributed by a JobDJ.
 
_setup_workdir_with_mae_files(infiles, jobname)
Set up work directory with single-structure .mae files, corresponding to all the structures in all the original input .mae files.
 
_run_mae_files(parsed_args)
Run MOPAC on a list of .mae files according to settings provided in namespace of parsed commandline arguments.
 
_run_single_mop_file(mopac_launcher, mopfile, structure=None)
Execute single MOPAC input file on the local machine.
 
_run_mop_files(mopac_version, mopfiles)
Execute MOPAC on list of .mop input files.
 
_setup_parallel_environment()
Set up parallel environment defaults
 
_print_header()
Print some useful information about the job
int
main(args)
Run a MOPAC workflow on the local machine.
Variables [hide private]
  _external_re = re.compile(r'(?i)EXTERNAL\s*=\s*(\S+)')
  JOBDJ_MAX_RETRIES = 3
hash(x)
  __package__ = 'schrodinger.application.mopac'
Function Details [hide private]

_transfer_subjob_files(jobbe, job_id)

 

Copy files held in a job record from the working dir to the launch dir associated with a jobcontrol backend. This function can handle jobs launched in subdirectories.

Parameters:
  • jobbe (schrodinger.job.jobcontrol._Backend) - The Backend object for the current job.
  • job_id (jobcontrol.Job.JobID) - jobcontrol job id

_distribute(cmds)

 

Create a JobDJ, populate it with cmdline invocations, and launch it.

Parameters:
  • cmds (list of strs) - command lines to launch

_run_single_structure_mae_file(parsed_args, maefile)

 

Run a single-structure .mae file locally. First create a corresponding .mop input file, then execute the MOPAC backend on that file. Creates an output .mae file in the same directory.

Parameters:
  • parsed_args (Argparse Namespace instance) - parsed cmdline arguments
  • maefile (str) - name of .mae file in CWD
Returns:
True if MOPAC job completed successfully, False otherwise

_gather_output_files(workdir, filemap)

 

Gather subjob output .mae files into combined output .mae files
corresponding to original .mae file input batches.

@type  workdir: str
@param workdir: path of working scratch directory

@type  filemap: dict of dicts
@param filemap: dictionary of all the single-structure input file names and
         expected output file names, indexed by original .mae file names.
         e.g. filemap['f1.mae']['infiles'] = ['f1_1.mae', 'f1_2.mae']
              filemap['f1.mae']['outfiles'] = ['f1_1_out.mae', 'f1_2_out.mae']

_run_multiple_mae_files(option_flags, filemap, workdir)

 

Run multiple single-structure .mae files distributed by a JobDJ.

@type  option_flags: list of strings
@param option_flags: original cmdline tokens minus -jobname flag

@type  filemap: dict of dicts
@param filemap: dictionary of all the single-structure input file names and
         expected output file names, indexed by original .mae file names.
         e.g. filemap['f1.mae']['infiles'] = ['f1_1.mae', 'f1_2.mae']
              filemap['f1.mae']['outfiles'] = ['f1_1_out.mae', 'f1_2_out.mae']

@type  workdir: str
@param workdir: path of working scratch directory

_setup_workdir_with_mae_files(infiles, jobname)

 

Set up work directory with single-structure .mae files, corresponding
to all the structures in all the original input .mae files.

@type  infiles: list of strings
@param infiles: list of names of .mae files in the CWD

@type  jobname: str
@param jobname: jobname used to .log, overall .out file, work dirs etc.

@type  option_flags: list of strings
@param option_flags: original cmdline tokens minus -jobname flag

@return: name of workdir,
@return: dictionary of all the single-structure input file names and
         expected output file names, indexed by original .mae file names.
         e.g. filemap['f1.mae']['infiles'] = ['f1_1.mae', 'f1_2.mae']
              filemap['f1.mae']['outfiles'] = ['f1_1_out.mae', 'f1_2_out.mae']

_run_mae_files(parsed_args)

 

Run MOPAC on a list of .mae files according to settings provided in namespace of parsed commandline arguments.

One output .mae file will be generated per input .mae file.

If multiple .mae files are provided, all individual structures will be added to a JobDJ and the MOPAC calculations will be run in parallel.

Parameters:
  • parsed_args (Argparse Namespace instance) - parsed cmdline arguments
Returns:
0 if MOPAC job completed successfully, 1 otherwise

_run_single_mop_file(mopac_launcher, mopfile, structure=None)

 

Execute single MOPAC input file on the local machine. Optional structure.Structure object can be provided to collect output data.

Parameters:
  • mopac_launcher (MopacLauncher instance) - API class for executing MOPAC backend binary.
  • mopfile (str) - path to .mop MOPAC input file
  • structure (structure.Structure instance) - optional structure instance to populate with results
Returns:
MopacResults instance.

_run_mop_files(mopac_version, mopfiles)

 

Execute MOPAC on list of .mop input files. If multiple files are provided, they will be run in parallel through a JobDJ.

Parameters:
  • mopac_version (mopac_launchers.MOPAC2012 or mopac_launchers.MOPAC71) - mopac version to execute in backend.
  • mopfiles (list of str) - paths to .mop input files
Returns:
0 if MOPAC job completed successfully, 1 otherwise

main(args)

 

Run a MOPAC workflow on the local machine.

Parameters:
  • args (list) - cmdline arguments
Returns: int
status of execution