From 63dd32904792f4d3ecdd980ba29ddb8e1f732d41 Mon Sep 17 00:00:00 2001 From: nebmit <76664673+nebmit@users.noreply.github.com> Date: Tue, 5 Dec 2023 09:41:20 +0100 Subject: [PATCH] test: added slurm process creation --- julia/tests/DistributedTest.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/julia/tests/DistributedTest.jl b/julia/tests/DistributedTest.jl index a9234d2..b10daf9 100644 --- a/julia/tests/DistributedTest.jl +++ b/julia/tests/DistributedTest.jl @@ -1,4 +1,5 @@ using BenchmarkTools +using ClusterManagers using CSV using DataFrames using Distributed @@ -10,7 +11,13 @@ using .TUG # 1. Environment Setup function setup_environment(num_procs::Int) if num_procs > 0 - added_procs = addprocs(num_procs) + if haskey(ENV, "SLURM_JOB_ID") + # Add SLURM processes + added_procs = addprocs(SlurmManager(num_procs), exclusive="") + else + # Add local processes + added_procs = addprocs(num_procs) + end # Use remotecall to include TUG on each new worker for proc in added_procs