How to use the libensemble.resources.env_resources.EnvResources function in libensemble

To help you get started, we’ve selected a few libensemble examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
if len(part_splitstr) == 1:     # Single Partition
            splitstr = fullstr.split('[', 1)
            if len(splitstr) == 1:      # Single Node
                return splitstr
            prefix = splitstr[0]
            nidstr = splitstr[1].strip("]")
            nidlst = EnvResources._noderange_append(prefix, nidstr)
        else:                           # Multiple Partitions
            splitgroups = [str.split('[', 1) for str in part_splitstr]
            prefixgroups = [group[0] for group in splitgroups]
            nodegroups = [group[1].strip(']') for group in splitgroups]
            nidlst = []
            for i in range(len(prefixgroups)):
                prefix = prefixgroups[i]
                nidstr = nodegroups[i]
                nidlst.extend(EnvResources._noderange_append(prefix, nidstr))

        return sorted(nidlst)
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
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 auto_resources=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 and auto_resources=True.

        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 and auto_resources=True.
        """

        self.schedular = None
        self.nodelists = {}
        self.nodelists['Slurm'] = nodelist_env_slurm or EnvResources.default_nodelist_env_slurm
        self.nodelists['Cobalt'] = nodelist_env_cobalt or EnvResources.default_nodelist_env_cobalt
        self.nodelists['LSF'] = nodelist_env_lsf or EnvResources.default_nodelist_env_lsf
        self.nodelists['LSF_shortform'] = nodelist_env_lsf_shortform or EnvResources.default_nodelist_env_lsf_shortform

        self.ndlist_funcs = {}
        self.ndlist_funcs['Slurm'] = EnvResources.get_slurm_nodelist
        self.ndlist_funcs['Cobalt'] = EnvResources.get_cobalt_nodelist
        self.ndlist_funcs['LSF'] = EnvResources.get_lsf_nodelist
        self.ndlist_funcs['LSF_shortform'] = EnvResources.get_lsf_nodelist_frm_shortform
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
Note: This is queried only if a node_list file is not provided and auto_resources=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 and auto_resources=True.

        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 and auto_resources=True.
        """

        self.schedular = None
        self.nodelists = {}
        self.nodelists['Slurm'] = nodelist_env_slurm or EnvResources.default_nodelist_env_slurm
        self.nodelists['Cobalt'] = nodelist_env_cobalt or EnvResources.default_nodelist_env_cobalt
        self.nodelists['LSF'] = nodelist_env_lsf or EnvResources.default_nodelist_env_lsf
        self.nodelists['LSF_shortform'] = nodelist_env_lsf_shortform or EnvResources.default_nodelist_env_lsf_shortform

        self.ndlist_funcs = {}
        self.ndlist_funcs['Slurm'] = EnvResources.get_slurm_nodelist
        self.ndlist_funcs['Cobalt'] = EnvResources.get_cobalt_nodelist
        self.ndlist_funcs['LSF'] = EnvResources.get_lsf_nodelist
        self.ndlist_funcs['LSF_shortform'] = EnvResources.get_lsf_nodelist_frm_shortform
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
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 and auto_resources=True.
        """

        self.schedular = None
        self.nodelists = {}
        self.nodelists['Slurm'] = nodelist_env_slurm or EnvResources.default_nodelist_env_slurm
        self.nodelists['Cobalt'] = nodelist_env_cobalt or EnvResources.default_nodelist_env_cobalt
        self.nodelists['LSF'] = nodelist_env_lsf or EnvResources.default_nodelist_env_lsf
        self.nodelists['LSF_shortform'] = nodelist_env_lsf_shortform or EnvResources.default_nodelist_env_lsf_shortform

        self.ndlist_funcs = {}
        self.ndlist_funcs['Slurm'] = EnvResources.get_slurm_nodelist
        self.ndlist_funcs['Cobalt'] = EnvResources.get_cobalt_nodelist
        self.ndlist_funcs['LSF'] = EnvResources.get_lsf_nodelist
        self.ndlist_funcs['LSF_shortform'] = EnvResources.get_lsf_nodelist_frm_shortform
github Libensemble / libensemble / libensemble / resources / resources.py View on Github external
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 and auto_resources=True.

        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 only queried if a node_list file is not provided and auto_resources=True.

        """

        self.top_level_dir = top_level_dir or os.getcwd()
        self.central_mode = central_mode
        if self.central_mode:
            logger.debug('Running in central mode')
        self.allow_oversubscribe = allow_oversubscribe

        self.env_resources = EnvResources(nodelist_env_slurm=nodelist_env_slurm,
                                          nodelist_env_cobalt=nodelist_env_cobalt,
                                          nodelist_env_lsf=nodelist_env_lsf,
                                          nodelist_env_lsf_shortform=nodelist_env_lsf_shortform)

        # This is global nodelist avail to workers - may change to global_worker_nodelist
        if node_file is None:
            node_file = Resources.DEFAULT_NODEFILE
        self.global_nodelist = Resources.get_global_nodelist(node_file=node_file,
                                                             rundir=self.top_level_dir,
                                                             env_resources=self.env_resources)

        self.launcher = launcher
        remote_detect = False
        if socket.gethostname() not in self.global_nodelist:
            remote_detect = True
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
def abbrev_nodenames(self, node_list):
        """Returns nodelist with entries in abbreviated form"""
        if self.schedular == 'Slurm':
            return EnvResources.slurm_abbrev_nodenames(node_list)
        if self.schedular == 'Cobalt':
            return EnvResources.cobalt_abbrev_nodenames(node_list)
        return node_list
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
Note: This is queried only if a node_list file is not provided and auto_resources=True.

        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 and auto_resources=True.
        """

        self.schedular = None
        self.nodelists = {}
        self.nodelists['Slurm'] = nodelist_env_slurm or EnvResources.default_nodelist_env_slurm
        self.nodelists['Cobalt'] = nodelist_env_cobalt or EnvResources.default_nodelist_env_cobalt
        self.nodelists['LSF'] = nodelist_env_lsf or EnvResources.default_nodelist_env_lsf
        self.nodelists['LSF_shortform'] = nodelist_env_lsf_shortform or EnvResources.default_nodelist_env_lsf_shortform

        self.ndlist_funcs = {}
        self.ndlist_funcs['Slurm'] = EnvResources.get_slurm_nodelist
        self.ndlist_funcs['Cobalt'] = EnvResources.get_cobalt_nodelist
        self.ndlist_funcs['LSF'] = EnvResources.get_lsf_nodelist
        self.ndlist_funcs['LSF_shortform'] = EnvResources.get_lsf_nodelist_frm_shortform
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
def abbrev_nodenames(self, node_list):
        """Returns nodelist with entries in abbreviated form"""
        if self.schedular == 'Slurm':
            return EnvResources.slurm_abbrev_nodenames(node_list)
        if self.schedular == 'Cobalt':
            return EnvResources.cobalt_abbrev_nodenames(node_list)
        return node_list
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
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 and auto_resources=True.
        """

        self.schedular = None
        self.nodelists = {}
        self.nodelists['Slurm'] = nodelist_env_slurm or EnvResources.default_nodelist_env_slurm
        self.nodelists['Cobalt'] = nodelist_env_cobalt or EnvResources.default_nodelist_env_cobalt
        self.nodelists['LSF'] = nodelist_env_lsf or EnvResources.default_nodelist_env_lsf
        self.nodelists['LSF_shortform'] = nodelist_env_lsf_shortform or EnvResources.default_nodelist_env_lsf_shortform

        self.ndlist_funcs = {}
        self.ndlist_funcs['Slurm'] = EnvResources.get_slurm_nodelist
        self.ndlist_funcs['Cobalt'] = EnvResources.get_cobalt_nodelist
        self.ndlist_funcs['LSF'] = EnvResources.get_lsf_nodelist
        self.ndlist_funcs['LSF_shortform'] = EnvResources.get_lsf_nodelist_frm_shortform
github Libensemble / libensemble / libensemble / resources / env_resources.py View on Github external
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 and auto_resources=True.
        """

        self.schedular = None
        self.nodelists = {}
        self.nodelists['Slurm'] = nodelist_env_slurm or EnvResources.default_nodelist_env_slurm
        self.nodelists['Cobalt'] = nodelist_env_cobalt or EnvResources.default_nodelist_env_cobalt
        self.nodelists['LSF'] = nodelist_env_lsf or EnvResources.default_nodelist_env_lsf
        self.nodelists['LSF_shortform'] = nodelist_env_lsf_shortform or EnvResources.default_nodelist_env_lsf_shortform

        self.ndlist_funcs = {}
        self.ndlist_funcs['Slurm'] = EnvResources.get_slurm_nodelist
        self.ndlist_funcs['Cobalt'] = EnvResources.get_cobalt_nodelist
        self.ndlist_funcs['LSF'] = EnvResources.get_lsf_nodelist
        self.ndlist_funcs['LSF_shortform'] = EnvResources.get_lsf_nodelist_frm_shortform