lemmings.chain package
Submodules
lemmings.chain.chain module
- class lemmings.chain.chain.Lemmings(lemmings_job: LemmingJobBase)
Bases:
object
Lemmings assemble - lemmingJob : the workflow to do - machine : the machine file, specialized on the queues - database : a persistent information for lemmings
- next()
Execute all necessary functions depending on its status There are 2 kind of function: - Functions that check some conditions - Functions that pass from a status to another
- - - > spawn_job - - - - | ^ | | | V start - - - - - post_job <check_condition> <check_condition> | | | | | | - - - - - > Exit < - - - -
- run()
Submit the chain of computations.
lemmings.chain.common module
lemmings.chain.database module
lemmings.chain.farming module
Farming functionalities for the lemmings object
- lemmings.chain.farming.continue_farming(lemmings_job: LemmingJobBase)
Function that monitors the number of parallel jobs currently run
Idea is to update the job status in the main database.json. Status should be either: start, hold, end So: 1) I must be able to access the main database.json 2) I must be able to submit new lemming jobs 3) I must update database status
- lemmings.chain.farming.run_farming(lemmings_job: LemmingJobBase)
Method that controls the generation of multiple workflows for parallel mode and submits them according to user settings
Split in smaller functions 1) check if all is well activated in workflow.yml -> _check_correct_parallel_settings() 2) perform the workflow copies -> _generate_workflow_replicates 3) launch workflows 3.1) check if max parallel workflow specied 3.2) launch workflows 3.3) update the database -> _launch_workflows_parallel 4) raise LemmingsStop as we did what we had to do at this point
lemmings.chain.lemmingjob_base module
The lemmings base class containing the methods which get inherited by LemmingJob
- class lemmings.chain.lemmingjob_base.LemmingJobBase(workflow: str, machine: Machine, database: Database, path_yml: str, job_prefix: str, user: NamedTuple, loop_count: int, status='start', base_dir=None)
Bases:
object
Class containing the different lemmings methods and allowing access to database and other information
- abort_on_start()
What lemmings does if the criterion is reached in the first loop.
- after_end_job()
Actions just before lemmings ends.
- check_on_end()
Verifications after each job loop
- The function check_on_end needs to return a boolean (default True) with three options:
False: we continue lemmings
True: target reached, we stop lemmings (default setting)
None: crash, we stop lemmings
- Default verification by lemmings:
is the cpu condition (.yml file) reached?
- check_on_start()
Verify if the condition is already satisfied before launching a lemmings chain.
Function returns a boolean which starts the chain run. Default set to True.
A minimum required action is to set the ‘start_cpu_time’ so that lemmings can check if the max cpu condition is reached.
- exit(msg)
Stop the workflow
- prepare_run()
Prepare the run before submission.
- prior_to_job()
Function that prepares the run when the user launches the Lemmings command.
- prior_to_new_iteration()
Prepare the new loop specific actions if criterion is not reached.
- set_progress_name(name)
Update progress of the workflow with a custom value
- set_progress_var(value)
Update progress of the workflow with a custom value
- lemmings.chain.lemmingjob_base.read_farming_params()
Load locally the farming_params, returns None if no file is available