Package schrodinger :: Package application :: Package macromodel :: Module paraUtils
[hide private]
[frames] | no frames]

Module paraUtils

Copyright Schrodinger, LLC. All rights reserved.

This is a common module for parallel job execution. It provides functionalities to configure and run parallel jobs. Currently this script is used by epik_driver, bmin_driver, and ligprep_driver.

Functions [hide private]
 
add_para_job_options(parser, options=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
Adds common para job control options to a SingleDashOptionParser instance.
 
validate_options(options)
Validate the job control options
 
print_job_info(argv, driver_script, version)
Check command line arguments passed and environment variables based on the driver.
 
_append_st_file(st_file, st_writer, raw_append=False, is_compressed=False)
Append structure files.
 
_print_subjob_logfile(log_file='', start_msg=None, end_msg=None)
Prints given log file with start and end messages.
 
_timestamp()
 
_merge_subjobs(backend_instance, subjob_input_mae_files, output_file, output_org, data)
Merge subjobs structure and log files.
 
_get_jobs_to_run(run_jobs_str, njobs)
Return the list of jobs to run.
 
_generate_subjobs(job_input_file, job_output_file, options, split_input_file=True)
Creates the subjob dirs and fill in data
 
_run_subjobs(jdj, restart_file)
 
launch_subjobs(options, driver_script, backend_instance, backend_args, job_input_file, job_output_file, cmd_append='', merge=True, prepare_subjob_callback=None, callback_data={}, split_input_file=True, post_execution_processing_callback=None, post_execution_processing_callback_data={})
Launch subjobs.
Variables [hide private]
  __doc__ = ...
  FIRSTCT = 2
  JOBCTS = 1
  LASTCT = 3
  MAX_RETRIES = 6
  NC = 10
  NJOBS = 0
  NO_EXECUTION = 8
  OUTPUT_ORG = 7
  RESTART = 9
  RUN_JOBS = 4
  STRICT_END = 5
  __package__ = 'schrodinger.application.macromodel'
Function Details [hide private]

add_para_job_options(parser, options=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

 

Adds common para job control options to a SingleDashOptionParser instance.

Parameters:
  • parser (SingleDashOptionParser) - Instance of SingleDashOptionParser
  • options (List) - List of module enums that indicate what options to add to the parser.

validate_options(options)

 

Validate the job control options

Parameters:
  • options (Instance) - object containing values of para job options

print_job_info(argv, driver_script, version)

 

Check command line arguments passed and environment variables based on the driver.

Parameters:
  • argv (String) - Command line arguments
  • driver_script (String) - Driver script name
  • version (String) - Driver script version

_append_st_file(st_file, st_writer, raw_append=False, is_compressed=False)

 

Append structure files.

Parameters:
  • st_file (String) - Structure file name
  • raw_append (Boolean) - Indicates to append file using raw I/O
  • is_compressed (Boolean) - Indicates compressed output file. This option is in use only with raw_append option.

_print_subjob_logfile(log_file='', start_msg=None, end_msg=None)

 

Prints given log file with start and end messages.

Parameters:
  • log_file (String) - Log file name. Print the content of log_file, if specified
  • start_msg (String) - Message to place at the start of the log file
  • end_msg (String) - Message to place at the end of the log file

_merge_subjobs(backend_instance, subjob_input_mae_files, output_file, output_org, data)

 

Merge subjobs structure and log files.

Parameters:
  • backend_instance (_Backend) - Instance of the _Backend
  • subjob_input_mae_files (List) - List of subjob files with parent directory
  • output_file (String) - Job output file name
  • output_org (String) - Produce more than one output structure file

_get_jobs_to_run(run_jobs_str, njobs)

 

Return the list of jobs to run.

Parameters:
  • run_jobs_str (String) - String of ':' or ',' separated numbers
  • njobs (Number) - Total number of jobs requested

_generate_subjobs(job_input_file, job_output_file, options, split_input_file=True)

 

Creates the subjob dirs and fill in data

Parameters:
  • job_input_file (String) - Job input file
  • job_output_file (String) - Job output file
  • options (Instance) - object containing values of para job options

launch_subjobs(options, driver_script, backend_instance, backend_args, job_input_file, job_output_file, cmd_append='', merge=True, prepare_subjob_callback=None, callback_data={}, split_input_file=True, post_execution_processing_callback=None, post_execution_processing_callback_data={})

 

Launch subjobs.

Parameters:
  • options (Instance) - object containing values of para job options
  • driver_script (String) - Driver script name
  • backend_instance (_Backend) - Instance of the _Backend
  • backend_args (List) - List of arguments
  • job_input_file (String) - Job input file
  • job_output_file (String) - Job output file
  • cmd_append (String) - Command to be appended to subjob command
  • merge (Boolean) - Whether to join subjob outputs or not
  • prepare_subjob_callback (Function) - Function to be called to prepare subjob data
  • callback_data (Dictionary) - A dictionary to be passed to subjob callback

Variables Details [hide private]

__doc__

Value:
"""

 Copyright Schrodinger, LLC. All rights reserved.

 This is a common module for parallel job execution.
 It provides functionalities to configure and run parallel jobs.
 Currently this script is used by epik_driver, bmin_driver, and ligpre\
p_driver.
...