Skip to content

Commit

Permalink
add error when submitting from srun
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Feb 27, 2025
1 parent 1573d44 commit be7223d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fairchem/core/_cli_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import logging
import os
import random
import sys
import tempfile
import uuid
from dataclasses import dataclass, field
Expand Down Expand Up @@ -304,6 +305,11 @@ def main(
scheduler_cfg = cfg.job.scheduler
logging.info(f"Running fairchemv2 cli with {cfg}")
if scheduler_cfg.mode == SchedulerType.SLURM: # Run on cluster
if os.getenv("SLURM_SUBMIT_HOST"):
logging.error(
"SLURM DID NOT SUBMIT JOB!! Please do not submit jobs from an active slurm job (srun or otherwise)"
)
sys.exit(1)
executor = AutoExecutor(folder=log_dir, slurm_max_num_timeout=3)
executor.update_parameters(
name=cfg.job.run_name,
Expand Down

0 comments on commit be7223d

Please sign in to comment.