Skip to content

Instantly share code, notes, and snippets.

@lcw
Last active February 24, 2023 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcw/30f8a42bd632009742915fc64f64bdaf to your computer and use it in GitHub Desktop.
Save lcw/30f8a42bd632009742915fc64f64bdaf to your computer and use it in GitHub Desktop.
MPI.jl working
Hello, world, I am rank 0 of 6.
Hello, world, I am rank 1 of 6.
Hello, world, I am rank 2 of 6.
Hello, world, I am rank 3 of 6.
Hello, world, I am rank 4 of 6.
Hello, world, I am rank 5 of 6.
using MPI
MPI.Init()
comm = MPI.COMM_WORLD
println("Hello, world, I am rank $(MPI.Comm_rank(comm)) of $(MPI.Comm_size(comm)).")
#!/bin/bash
#SBATCH --time=0:10:00
#SBATCH --nodes=2 # node count
#SBATCH --ntasks-per-node=3 # number of tasks per node
#SBATCH --cpus-per-task=1 # cpu-cores per task
#SBATCH --mem=2G
#SBATCH --output=output-%j.txt
source /etc/profile
module load sdk/nvidia/22.7
# have the shell echo the commands that are run
set -x
export JULIA_NUM_THREADS=1
julia --project -e 'using Pkg; pkg"instantiate"'
julia --project -e 'using Pkg; pkg"precompile"'
mpiexec --mca mpi_cuda_support 0 -output-filename $SLURM_JOB_ID julia hello.jl
#mpiexec --mca mpi_cuda_support 0 -output-filename $SLURM_JOB_ID ./hello
exit 0
+ export JULIA_NUM_THREADS=1
+ JULIA_NUM_THREADS=1
+ julia --project -e 'using Pkg; pkg"instantiate"'
┌ Warning: The Pkg REPL mode is intended for interactive use only, and should not be used from scripts. It is recommended to use the functional API instead.
└ @ Pkg.REPLMode /cache/build/default-aws-shared0-3/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/REPLMode/REPLMode.jl:379
+ julia --project -e 'using Pkg; pkg"precompile"'
┌ Warning: The Pkg REPL mode is intended for interactive use only, and should not be used from scripts. It is recommended to use the functional API instead.
└ @ Pkg.REPLMode /cache/build/default-aws-shared0-3/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/REPLMode/REPLMode.jl:379
+ mpiexec --mca mpi_cuda_support 0 -output-filename 45886644 julia hello.jl
--------------------------------------------------------------------------
WARNING: No preset parameters were found for the device that Open MPI
detected:
Local host: compute-2-30
Device name: mlx5_0
Device vendor ID: 0x02c9
Device vendor part ID: 4123
Default device parameters will be used, which may result in lower
performance. You can edit any of the files specified by the
btl_openib_device_param_files MCA parameter to set values for your
device.
NOTE: You can turn off this warning by setting the MCA parameter
btl_openib_warn_no_device_params_found to 0.
--------------------------------------------------------------------------
Hello, world, I am rank 2 of 6.
Hello, world, I am rank 3 of 6.
Hello, world, I am rank 4 of 6.Hello, world, I am rank 5 of 6.
Hello, world, I am rank 0 of 6.
Hello, world, I am rank 1 of 6.
[compute-2-30.hamming.cluster:55987] 5 more processes have sent help message help-mpi-btl-openib.txt / no device params found
[compute-2-30.hamming.cluster:55987] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
+ exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment