SLURM manager: one node with multiple tasks

Hi,

I have access to a single node with many 24 cores. I want Julia to treat that node as 4 workers with 6 cores per each worker.

My attempt is:

using Distributed, ClusterManagers

addprocs(SlurmManager(1), nodes=1, ntasks_per_node=4, cpus_per_task=6)

@info "STARTED"

hosts = []
pids = []
for i in workers()
	host, pid = fetch(@spawnat i (gethostname(), getpid()))
    @info "host: $host"
    @info "pid: $pid"
	push!(hosts, host)
	push!(pids, pid)
end

# The Slurm resource allocation is released when all the workers have
# exited
for i in workers()
	rmprocs(i)
end

but I can see that only one worker is running.

Maybe I do something wrong?

1 Like

I would think you need to submit four separate,6 core jobs.
Or one 24 core job.

If I am not understanding the aim please make it a bit more clear what you want to achieve