schrodinger.active_learning.mq_worker module¶
- class schrodinger.active_learning.mq_worker.LigandMLBackend(url, model, descending)¶
Bases:
object
- __init__(url, model, descending)¶
- start()¶
- isRunning()¶
- Returns
True if the backend is running
- Return type
bool
- getCrashLog()¶
- kill()¶
- class schrodinger.active_learning.mq_worker.Worker(options)¶
Bases:
object
- __init__(options)¶
- run()¶
- mainLoop()¶
- checkDeadlines()¶
- sendToDriver(msg)¶
- sendPredsToDriver(msg)¶
- handleGET(msg, address)¶
- handlePING(msg, address)¶
- handlePONG(msg, address)¶
- handleSTOP(msg, address)¶
- handleDONE(msg, address)¶
Handle DONE message from backend. If no predictions were generated, sends empty results to driver.
- handleREADY(msg, address)¶
- handleCSV(msg, address)¶
Receives inputs from driver, writes out, sends path to backend
- writeCSVFile(msg)¶
- writeModelFiles(files)¶
- recv()¶
Listen for a message, if any, from the driver or backend. :return: message and address. Only messages from the backend socket have an address, messages from other sources will have address None. If there are no messages, return (None, None) :rtype: tuple
- startBackend()¶
Launch backend as a subprocess on the same host as the worker.
- sendToBackend(msg, address=None)¶
Send a message through the backend socket.
- stopBackend()¶
Stop the backend, by sending it a STOP message. (The message is only likely to be received if the worker is idle, but that’s the normal case at the end of a job.)
- getInputs()¶
Tries 10 times to request models from driver, or from peer if driver is not available.
- initSockets()¶
- cleanUp()¶
- schrodinger.active_learning.mq_worker.my_uuid()¶
Return a base64-encoded random UUID to use as worker ID or ping ID.
- schrodinger.active_learning.mq_worker.get_backend_args()¶
- schrodinger.active_learning.mq_worker.run_dj(args)¶
Launch a number of workers using JobDJ. Used when -NJOBS > 1 on the command line.
- Parameters
args (Argparse.Namespace) – command-line arguments
- schrodinger.active_learning.mq_worker.submit_jobdj(args, subjobs)¶
- schrodinger.active_learning.mq_worker.combine_log_files(subjobs, logger)¶
Concatenates the contents of subjob log files.
- Parameters
subjobs (list(str)) – subjob names
logger (Logger) – logger to which concatenated log files are to be written
- schrodinger.active_learning.mq_worker.parse_args(argv=None)¶
- schrodinger.active_learning.mq_worker.sigterm_handler(signum, frame)¶
- schrodinger.active_learning.mq_worker.main()¶
- schrodinger.active_learning.mq_worker.get_job_spec_from_args(argv: List[str]) schrodinger.job.launchapi.JobSpecification ¶
Parse command-line arguments: The argv passed to this function is equivalent to sys.argv[1:] from the command
argv[0] # “run” argv[1] # “python3” argv[2] # “-m”