JuliaParallel / ClusterManagers.jl

Other
242 stars 74 forks source link

How to utilize hyper-threading when addprocs? #138

Closed zxjroger closed 4 years ago

zxjroger commented 4 years ago

Suppose I have reserved 20 CPUs on an HPC (with slurm):

#!/bin/bash
#SBATCH --ntasks=20
#SBATCH --threads-per-core=2

julia test.jl

Because each CPU has two threads, so I would like to add 20*2=40 processes. How can I declare that in my Julia script? Should I just simply put this in my Julia script?

using ClusterManagers
addprocs_slurm(40)

Will ClusterManagers know that I am asking for 20 CPUs with 2 threads per CPU but not 40 CPUs? Thank you.

juliohm commented 4 years ago

Please consult https://github.com/juliohm/julia-distributed-computing for simple instructions.