File tree Expand file tree Collapse file tree 10 files changed +28
-12
lines changed Expand file tree Collapse file tree 10 files changed +28
-12
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,16 @@ scalable I/O performance.
4040 export PNETCDF_DIR=/path/to/pnetcdf/dir
4141 pip install --no-build-isolation -e .
4242 ```
43- * Testing -- Command ` "make check" ` tests all the programs available in folders
44- [ "test/"] ( ./test ) and [ "examples/"] ( ./examples ) .
43+ * Testing
44+ + Command ` "make check" ` tests all the programs available in folders
45+ [ "test/"] ( ./test ) and [ "examples/"] ( ./examples ) by running one MPI process.
46+ + Command ` "make ptests" ` tests all the programs by running more than one MPI
47+ process.
48+ + Note when using OpenMPI, use command below.
49+ ```
50+ make check TESTMPIRUN="/path/to/OpenMPI/bin/mpirun --oversubscribe"
51+ make ptests TESTMPIRUN="/path/to/OpenMPI/bin/mpirun --oversubscribe"
52+ ```
4553
4654### Additional Resources
4755* [Example python programs](./examples#pnetcdf-python-examples) available in
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ check_PROGRAMS = mnist_main.py
77
88MNIST_URL = https://raw.githubusercontent.com/pytorch/examples/main/mnist/main.py
99
10+ TESTMPIRUN = $(shell dirname ${CC}) /mpirun
11+
1012all :
1113
1214mnist_main.py :
@@ -45,7 +47,7 @@ ptests check: mnist_main.py
4547 @echo " ======================================================================"
4648 @echo " examples/MNIST: Parallel testing on 4 MPI processes"
4749 @echo " ======================================================================"
48- @mpiexec -n 4 python mnist_main.py --batch-size 4 --test-batch-size 2 --epochs 3 --input-file mnist_images.nc
50+ @${TESTMPIRUN} -n 4 python mnist_main.py --batch-size 4 --test-batch-size 2 --epochs 3 --input-file mnist_images.nc
4951 @echo " "
5052
5153clean :
Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ check_PROGRAMS = collective_write.py \
1717 put_var.py \
1818 get_var.py
1919
20-
20+ TESTMPIRUN = $( shell dirname ${CC}) /mpirun
2121TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
2222TESTS_ENVIRONMENT += export PNETCDF_DIR="${PNETCDF_DIR}";
23+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
2324
2425OUTPUT_DIR = _tmp_output
2526
Original file line number Diff line number Diff line change 66check_PROGRAMS = torch_ddp_skeleton.py
77
88
9+ TESTMPIRUN = $(shell dirname ${CC}) /mpirun
910TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
1011TESTS_ENVIRONMENT += export PNETCDF_DIR="${PNETCDF_DIR}";
12+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
1113
1214OUTPUT_DIR = _tmp_output
1315
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ for prog in $check_PROGRAMS; do
3131 printf ' %-60s' " Testing $prog "
3232
3333 if test $prog = " torch_ddp_skeleton.py" ; then
34- CMD=" mpiexec -n $NPROC python $prog -q"
34+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q"
3535 fi
3636 $CMD
3737 status=$?
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ check_PROGRAMS = nonblocking_write_def.py \
77 nonblocking_write.py \
88 nonblocking_read.py
99
10-
10+ TESTMPIRUN = $( shell dirname ${CC}) /mpirun
1111TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
1212TESTS_ENVIRONMENT += export PNETCDF_DIR="${PNETCDF_DIR}";
13+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
1314
1415OUTPUT_DIR = _tmp_output
1516
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ for prog in $check_PROGRAMS; do
6161 printf ' %-60s' " Testing $prog "
6262
6363 if test " x$prog " = " xnonblocking_read.py" ; then
64- CMD=" mpiexec -n $NPROC python $prog -q $OUT_DIR /nonblocking_write.nc"
64+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q $OUT_DIR /nonblocking_write.nc"
6565 else
66- CMD=" mpiexec -n $NPROC python $prog -q $OUT_DIR /${prog% .* } .nc"
66+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q $OUT_DIR /${prog% .* } .nc"
6767 fi
6868 # echo "$CMD"
6969
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ for prog in $check_PROGRAMS; do
6161 printf ' %-60s' " Testing $prog "
6262
6363 if test $prog = " get_var.py" ; then
64- CMD=" mpiexec -n $NPROC python $prog -q $OUT_DIR /put_var.nc"
64+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q $OUT_DIR /put_var.nc"
6565 else
66- CMD=" mpiexec -n $NPROC python $prog -q $OUT_DIR /${prog% .* } .nc"
66+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q $OUT_DIR /${prog% .* } .nc"
6767 fi
6868 $CMD
6969 status=$?
Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ check_PROGRAMS = tst_atts.py \
5050 tst_wait.py \
5151 tst_libver.py
5252
53+ TESTMPIRUN = $(shell dirname ${CC}) /mpirun
5354TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
55+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
5456OUTPUT_DIR = _tmp_output
5557
5658all :
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ for prog in ${check_PROGRAMS} ; do
3131 printf ' %-60s' " Testing $prog "
3232
3333 if test $prog = " tst_libver.py" ; then
34- CMD=" mpiexec -n $NPROC python $prog -q"
34+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q"
3535 else
36- CMD=" mpiexec -n $NPROC python $prog $OUT_DIR "
36+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog $OUT_DIR "
3737 fi
3838 $CMD
3939 status=$?
You can’t perform that action at this time.
0 commit comments