core Package

fw_constants Module

A set of global constants for FireWorks (Python code as a config file)

queue_adapter_base Module

TODO: add docs!!

class fireworks.core.queue_adapter_base.JobParameters(queue_adapter, params, logging_dir='.')

Bases: fireworks.utilities.fw_serializers.FWSerializable

classmethod from_dict(m_dict)
to_dict()
class fireworks.core.queue_adapter_base.QueueAdapterBase

Bases: fireworks.utilities.fw_serializers.FWSerializable

The QueueAdapter is responsible for all interactions with a specific queue management system. This includes writing and submitting the queue script (e.g., PBS script) as well as querying for the number of jobs left in the queue.

classmethod from_dict(m_dict)
get_njobs_in_queue(job_parameters, username=None)

returns the number of jobs in the queue, probably using subprocess or shutil to call a command like ‘qstat’. returns None when the number of jobs cannot be determined.

Parameters:
  • job_parameters – a JobParameters() instance
  • username – the username of the jobs to count (default is to autodetect)
get_script_str(launch_dir, job_parameters)

returns a (multi-line) String representing the queue script, e.g. PBS script. This string will be written to a file and submitted, for example using the qsub command

Parameters:
  • launch_dir – The directory the job will be launched in
  • job_parameters – A JobParameters() instance
submit_to_queue(script_file)

submits the job to the queue, probably using subprocess or shutil

to_dict(*args, **kwargs)

rocket_launcher Module

This module is used to submit jobs to a queue on a cluster. It can submit a single job, or if used in “rapid-fire” mode, can submit multiple jobs within a directory structure.

The details of job submission and queue communication are handled using JobParameters.

You can directly run this module from the command line on your cluster. See docs of the __main__ method for details.

fireworks.core.rocket_launcher.launch_rocket(job_params, launch_dir='.', script_filename='submit.script')

Submit a single job to the queue.

Parameters:
  • job_params – A JobParameters instance
  • launch_dir – The directory where to submit the job
  • script_filename – desired name for script file
fireworks.core.rocket_launcher.rapid_fire(job_params, launch_dir='.', script_filename='submit.script', njobs_queue=10, njobs_block=500, n_loops=1, t_sleep=3600)

Used to submit many jobs to the queue.

Parameters:
  • job_params – A JobParameters instance
  • launch_dir – directory where we want to write the blocks
  • script_filename – desired name for script file
  • njobs_queue – stops submitting jobs when njobs_queue jobs are in the queue
  • njobs_block – automatically write a new block when njobs_block jobs are in a single block
  • n_loops – number of times to loop rapid-fire mode to maintain njobs_queue
  • t_sleep – sleep time between loops in rapid-fire mode

Table Of Contents

This Page