Environment Resources Module

This module stores environment variables for use in resource detection

class env_resources.EnvResources(nodelist_env_slurm=None, nodelist_env_cobalt=None, nodelist_env_lsf=None, nodelist_env_lsf_shortform=None)

Stores environment variables to query for system resource information

Class Attributes:

Variables
  • default_nodelist_env_slurm (string) – Default SLRUM nodelist environment variable

  • default_nodelist_env_cobalt (string) – Default Cobal nodelist environment variable

  • default_nodelist_env_lsf (string) – Default LSF nodelist environment variable

  • default_nodelist_env_lsf_shortform (string) – Default LSF short-form nodelist environment variable

Object Attributes:

These are set on initialization.

Variables
  • nodelists (dict) – Environment variable names to query for nodelists by scheduler

  • ndlist_funcs (dict) – Functions to extract nodelists from environment by scheduler

__init__(nodelist_env_slurm=None, nodelist_env_cobalt=None, nodelist_env_lsf=None, nodelist_env_lsf_shortform=None)

Initializes a new EnvResources instance

Determines the environment variables to query for resource information. These are either provided or given defaults.

Parameters
  • nodelist_env_slurm (String, optional) – The environment variable giving a node list in Slurm format (Default: uses SLURM_NODELIST). Note: This is queried only if a node_list file is not provided.

  • nodelist_env_cobalt (String, optional) – The environment variable giving a node list in Cobalt format (Default: uses COBALT_PARTNAME). Note: This is queried only if a node_list file is not provided and disable_resource_manager=True.

  • nodelist_env_lsf (String, optional) – The environment variable giving a node list in LSF format (Default: uses LSB_HOSTS). Note: This is queried only if a node_list file is not provided.

  • nodelist_env_lsf_shortform (String, optional) – The environment variable giving a node list in LSF short-form format (Default: uses LSB_MCPU_HOSTS). Note: This is queried only if a node_list file is not provided.

get_nodelist()

Returns nodelist from environment or an empty list

static abbrev_nodenames(node_list, prefix=None)

Returns nodelist with only string up to first dot

static cobalt_abbrev_nodenames(node_list, prefix='nid')

Returns nodelist with prefix and leading zeros stripped

shortnames(node_list)

Returns nodelist with entries in abbreviated form

static get_slurm_nodelist(node_list_env)

Gets global libEnsemble nodelist from the Slurm environment

static get_cobalt_nodelist(node_list_env)

Gets global libEnsemble nodelist from the Cobalt environment

static get_lsf_nodelist(node_list_env)

Gets global libEnsemble nodelist from the LSF environment

static get_lsf_nodelist_frm_shortform(node_list_env)

Gets global libEnsemble nodelist from the LSF environment from short-form version