fireworks.user_objects.queue_adapters package — FireWorks 2.0.4 documentation

# fireworks.user_objects.queue_adapters package

## Subpackages

- fireworks.user_objects.queue_adapters.tests package
  - Submodules
  - fireworks.user_objects.queue_adapters.tests.test_common_adapter module
    - `CommonAdapterTest`
      - `CommonAdapterTest.test_override()`
      - `CommonAdapterTest.test_parse_jobid()`
      - `CommonAdapterTest.test_parse_njobs()`
      - `CommonAdapterTest.test_serialization()`
      - `CommonAdapterTest.test_status_cmd_pbs()`
      - `CommonAdapterTest.test_yaml_load()`
  - Module contents

## Submodules

## fireworks.user_objects.queue_adapters.common_adapter module

This module implements a CommonAdaptor that supports standard PBS and SGE queues.

class fireworks.user_objects.queue_adapters.common_adapter.CommonAdapter(q_type, q_name=None, template_file=None, timeout=None, **kwargs)

  Bases: `QueueAdapterBase`

  An adapter that works on most PBS (including derivatives such as TORQUE), SGE, and SLURM queues.

  __init__(q_type, q_name=None, template_file=None, timeout=None, **kwargs) → None

    Initializes a new QueueAdapter object.

    Parameters:

      - q_type (str) – The type of queue. Right now it should be either PBS, SGE, SLURM, Cobalt or LoadLeveler.

      - q_name (str, optional) – A name for the queue. Can be any string.

      - template_file (str, optional) – The path to the template file. Leave it as None (the default) to use Fireworks’ built-in templates for PBS and SGE, which should work on most queues.

      - timeout (int, optional) – The amount of seconds to wait before raising an error when checking the number of jobs in the queue. Default 5 seconds.

      - **kwargs – Series of keyword args for queue parameters.

  default_q_commands = {'Cobalt': {'status_cmd': 'qstat', 'submit_cmd': 'qsub'}, 'LoadLeveler': {'status_cmd': 'llq', 'submit_cmd': 'llsubmit'}, 'LoadSharingFacility': {'status_cmd': 'bjobs', 'submit_cmd': 'bsub'}, 'MOAB': {'status_cmd': 'showq', 'submit_cmd': 'msub'}, 'PBS': {'status_cmd': 'qstat', 'submit_cmd': 'qsub'}, 'SGE': {'status_cmd': 'qstat', 'submit_cmd': 'qsub'}, 'SLURM': {'status_cmd': 'squeue', 'submit_cmd': 'sbatch'}}
  classmethod from_dict(m_dict)
  get_njobs_in_queue(username=None, shell: bool = False)

    returns the number of jobs currently in the queue for the user.

    Parameters:

      username – (str) the username of the jobs to count (default is to autodetect)

    Returns:

      (int) number of jobs in the queue

  submit_to_queue(script_file)

    submits the job to the queue and returns the job id.

    Parameters:

      script_file – (str) name of the script file to use (String)

    Returns:

      (int) job_id

  to_dict(*args, **kwargs)

## fireworks.user_objects.queue_adapters.pbs_newt_adapter module

class fireworks.user_objects.queue_adapters.pbs_newt_adapter.PBSAdapterNEWT

  Bases: `QueueAdapterBase`

  A special PBS adapter that works via the NEWT interface (https://newt.nersc.gov) Only intended for job submission via the RESTful NEWT web interface.

  defaults = {}
  get_njobs_in_queue(username=None)

    Returns the number of jobs currently in the queue for the user.

    Parameters:

      username (str) – the username of the jobs to count (default is to autodetect)

    Returns:

      (int) number of jobs in the queue

  q_name = 'pbs_newt'
  resource = 'carver'
  submit_cmd = ''
  submit_to_queue(script_file)

    Submits the job to the queue and returns the job id.

    Parameters:

      script_file – (str) name of the script file to use (String)

    Returns:

      (int) job_id

  template_file = '/Users/ajain/Documents/code_venvs/fireworks/fireworks/fireworks/user_objects/queue_adapters/PBS_template.txt'

## Module contents