Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
sendrecv-impl.jl | 2017-04-21 10:34 | 603 | ||
script.mpi | 2017-04-21 11:04 | 172 | ||
script.parallel | 2017-04-20 12:09 | 144 | ||
sendrecv.jl | 2017-04-21 10:34 | 125 | ||
ex_parallel.jl | 2017-04-20 11:40 | 88 | ||
hello.jl | 2017-04-20 11:07 | 24 | ||
Load a Julia module before run these codes,
module load julia/0.5.1
Launch Julia and then run this code in Julia platform (after the prompt julia>
),
julia
julia> inlcude("hello.jl")
or run it directly in Linux shell,
julia hello.jl
(1) Run this code using multiple (e.g. 28) CPU cores on one node. Frist, request an interactvie session with one node,
qlogin -pe mpi_28_tasks_per_node 28
Then run the code by specifying the number of CPU cores,
julia -p 28
julia> inlcude("ex_parallel.jl")
or,
julia -p 28 ex_parallel.jl
(2) Run this code using multiple (e.g. 2) nodes. Frist, request an interactvie session with two ndoes,
qlogin -pe mpi_28_tasks_per_node 56
Then run the code by specifying the host file,
julia --machinefile $TMPDIR/machines
julia> inlcude("ex_parallel.jl")
or,
julia --machinefile $TMPDIR/machines ex_parallel.jl
Alternatively, submit a batch job to run this code,
qsub script.parallel
See the conents of the script in the file named script.paralel.
If the MPI.jl
package has not been instlled, install it first,
export JULIA_PKGDIR=/projectnb/group/user/.julia
julia
julia> Pkg.init()
julia> Pkg.add("MPI")
julia> exit()
Once request for an interactive session, run julia with MPI on one node,
mpirun -np 28 julia sendrecv.jl
or on multiple (e.g. 2) nodes,
mpirun -np 56 julia sendrecv.jl
Note that users do not need to specify host file for mpirun
, because the job scheduler on SCC automatically did it.
Alternatively, submit a batch job to run this code,
qsub script.mpi
See the conents of the script in the file named script.mpi.