job dependency

This commit is contained in:
Benoît Sierro
2021-07-13 08:50:15 +02:00
parent ab5e7dde9a
commit 63835b6e05
2 changed files with 7 additions and 1 deletions

View File

@@ -9,7 +9,7 @@
### Give all resources to a single Ray task, ray can manage the resources internally
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task={cpus_per_node}
{dependency}
# Load modules or your own conda environment here
{environment_setup}

View File

@@ -92,6 +92,7 @@ def create_parser():
parser.add_argument(
"--command", default="run", choices=["run", "resume", "merge"], help="command to run"
)
parser.add_argument("--dependency", default=None, help="sbatch dependency argument")
return parser
@@ -112,6 +113,11 @@ def main():
template = Paths.gets("submit_job_template")
args = parser.parse_args()
if args.dependency is None:
args.dependency = ""
else:
args.dependency = f"#SBATCH --dependency={args.dependency}"
if not re.match(r"^[0-9]{2}:[0-9]{2}:[0-9]{2}$", args.time) and not re.match(
r"^[0-9]+$", args.time
):