def _get_env(cls, master_rank=DEFAULT_MASTER): """ Get the SLURM environment variables that are set by sbatch at runtime. """ for k, v in utils.slurm_envs(default.SBATCH_VARS_FOR_KVS).items(): setattr(cls, k, v) if cls.rank == master_rank: cls.is_master = True else: cls.is_master = False
def get_environmentals(self): """ Load environmental variables into class variables """ for k, v in utils.slurm_envs(default.SBATCH_VARS_FOR_WORKFLOW).items(): setattr(self, k, v)