Skip to content

Commit

Permalink
Merge pull request #437 from ExaWorks/identify_more_schedulers
Browse files Browse the repository at this point in the history
Add (lousy) detection of schedulers other than Slurm.
  • Loading branch information
hategan authored Jan 15, 2024
2 parents 92525d9 + af10707 commit b6cccf0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ def _translate_executor(config: Dict[str, str], executor: str) -> List[str]:
if executor == 'auto_q':
if config.option.environment.get('has_slurm'):
return ['slurm']
elif config.option.environment.get('has_pbs'):
return ['pbs']
elif config.option.environment.get('has_lsf'):
return ['lsf']
elif config.option.environment.get('has_cobalt'):
return ['cobalt']
elif config.option.environment.get('has_flux'):
return ['flux']
else:
Expand Down Expand Up @@ -408,6 +414,10 @@ def _discover_environment(config):
logger.warning('Cannot get git repository information.')
try:
env['has_slurm'] = shutil.which('sbatch') is not None
if 'has_slurm' not in env:
env['has_pbs'] = shutil.which('qsub') is not None
env['has_lsf'] = shutil.which('bsub') is not None
env['has_cobalt'] = shutil.which('cqsub') is not None
env['has_mpirun'] = shutil.which('mpirun') is not None
env['has_flux'] = _has_flux()
env['can_ssh_to_localhost'] = _try_run_command(['ssh', '-oBatchMode=yes',
Expand Down

0 comments on commit b6cccf0

Please sign in to comment.