-
Notifications
You must be signed in to change notification settings - Fork 2
/
README-OCL-MPI
32 lines (23 loc) · 1.33 KB
/
README-OCL-MPI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
The following instructions describe how to use multiple GPUs with the
standard MPI decomposition in LAMMPS. This technique requires using
coprthr-v1.2 (pre-release) which is designated as the 'current' branch
of coprthr at the present time. Additionally, this requires using
'make openmpi' to build LAMMPS, which is the the only makefile that has
been modified for the LAMMPS-OCL work.
In order to use multiple GPUs, LAMMPS should be run with one MPI process
per GPU across the target system.
The critical step is to set the environment variable STDGPU_LOCK to a number
common across the MPI job, but otherwise unique (in the unlikely event that
someone is using the system at the same time).
For example (bash),
export STDGPU_LOCK 123456; \
mpirun -np 4 ./lmp_openmpi < in.lj_ocl
would run LAMMPS using 4 GPUs on a workstation with 4 graphics cards. This
can be extended to larger MPI jobs across multiple nodes.
The environment variable STDGPU_LOCK causes the stdgpu context to contain
GPUs exclusive to each process within the same locking group using the same
specified key. This completely resolves the issue of requiring MPI processes
to figure out which GPU they are supposed to use. The result is that there
is absolutely no source code changes required to support multiple GPUs, or
MPI jobs in general, from an OpenCL perspective.
-DAR