% setenv OMP_NUM_THREADS 2
% efc -O2 -o hybrid hybrid.f -lmpi -openmp
% mpirun -v -np 2 /usr/bin/dplace -e -c x,8,9,x,x,x,x,10,11 hybrid
-------------------------
# if using cpusets ...
-------------------------
# we need to reorder cpus to logical within the 8-15 set [0-7]
% cpuset -q omp -A mpirun -v -np 2 /usr/bin/dplace -e -c x,0,1,x,x,x,x,2,3,4,5,6,7 hybrid
# We need a table of options for these pairs. "x" means don't
# care. See the dplace man page for more info about the -e option.
# examples at end
-np OMP_NUM_THREADS /usr/bin/dplace -e -c <as shown> a.out
--- --------------- ---------------------------------------
2 2 x,0,1,x,x,x,x,2,3
2 3 x,0,1,x,x,x,x,2,3,4,5
2 4 x,0,1,x,x,x,x,2,3,4,5,6,7
4 2 x,0,1,2,3,x,x,x,x,x,x,x,x,4,5,6,7
4 3
x,0,1,2,3,x,x,x,x,x,x,x,x,4,5,6,7,8,9,10,11
4 4
x,0,1,2,3,x,x,x,x,x,x,x,x,4,5,6,7,8,9,10,11,12,13,14,15
Notes: 0 <- 1 -> <- 2 -> <- 3 -> <------ 4
------------------>
Notes:
0. mpi daemon process
1. mpi child procs, one per np
2. omp daemon procs, one per np
3. omp daemon helper procs, one per np
4. omp thread procs, (OMP_NUM_THREADS - 1) per np
---------------------------------------------
# Example - -np 2 and OMP_NUM_THREADS 2
---------------------------------------------
% setenv OMP_NUM_THREADS 2
% efc -O2 -o hybrid hybrid.f -lmpi -openmp
% mpirun -v -np 2 /usr/bin/dplace -e -c x,8,9,x,x,x,x,10,11 hybrid
% pu
UID PID PPID C STIME TTY TIME CMD
root 21550 21535 0 Mar17 pts/0 00:00:00 login -- guest1
guest1 21551 21550 0 Mar17 pts/0 00:00:00 -csh
guest1 23391 21551 0 00:32 pts/0 00:00:00 mpirun -v -np 2
/usr/bin/dplace
guest1 23394 23391 2 00:32 pts/0 00:00:00 hybrid <-- mpi daemon
guest1 23401 23394 99 00:32 pts/0 00:00:03 hybrid <-- mpi child 1
guest1 23402 23394 99 00:32 pts/0 00:00:03 hybrid <-- mpi child 2
guest1 23403 23402 0 00:32 pts/0 00:00:00 hybrid <-- omp daemon 2
guest1 23404 23401 0 00:32 pts/0 00:00:00 hybrid <-- omp daemon 1
guest1 23405 23404 0 00:32 pts/0 00:00:00 hybrid <-- omp daemon hlpr 1
guest1 23406 23403 0 00:32 pts/0 00:00:00 hybrid <-- omp daemon hlpr 2
guest1 23407 23403 99 00:32 pts/0 00:00:03 hybrid <-- omp thread 2-1
guest1 23408 23404 99 00:32 pts/0 00:00:03 hybrid <-- omp thread 1-1
guest1 23409 21956 0 00:32 pts/1 00:00:00 ps -aef
guest1 23410 21956 0 00:32 pts/1 00:00:00 grep guest1
% top -b -n 1 | sort -n | grep guest1
LC %CPU PID USER PRI NI SIZE RSS SHARE STAT %MEM TIME COMMAND
0 0.0 21551 guest1 15 0 5904 3712 4592 S 0.0 0:00 csh
0 0.0 23394 guest1 15 0 883M 9456 882M S 0.1 0:00 hybrid
4 0.0 21956 guest1 15 0 5856 3616 5664 S 0.0 0:00 csh
4 0.0 23412 guest1 16 0 70048 1600 69840 S 0.0 0:00 sort
4 1.6 23411 guest1 15 0 5056 2832 4288 R 0.0 0:00 top
5 0.0 23413 guest1 16 0 3488 1536 3328 S 0.0 0:00 grep
8 0.0 22005 guest1 15 0 5840 3584 5648 S 0.0 0:00 csh
8 0.0 23404 guest1 15 0 894M 10M 889M S 0.1 0:00 hybrid
8 99.9 23401 guest1 39 0 894M 10M 889M R 0.1 0:09 hybrid
9 0.0 23403 guest1 15 0 894M 10M 894M S 0.1 0:00 hybrid
9 99.9 23402 guest1 25 0 894M 10M 894M R 0.1 0:09 hybrid
10 99.9 23407 guest1 25 0 894M 10M 894M R 0.1 0:09 hybrid
11 99.9 23408 guest1 25 0 894M 10M 889M R 0.1 0:09 hybrid
12 0.0 23391 guest1 15 0 5072 2928 4400 S 0.0 0:00 mpirun
12 0.0 23406 guest1 15 0 894M 10M 894M S 0.1 0:00 hybrid
14 0.0 23405 guest1 15 0 894M 10M 889M S 0.1 0:00 hybrid |