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.
40
40
export PNETCDF_DIR=/path/to/pnetcdf/dir
41
41
pip install --no-build-isolation -e .
42
42
```
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
+ ```
45
53
46
54
### Additional Resources
47
55
* [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
7
7
8
8
MNIST_URL = https://raw.githubusercontent.com/pytorch/examples/main/mnist/main.py
9
9
10
+ TESTMPIRUN = $(shell dirname ${CC}) /mpirun
11
+
10
12
all :
11
13
12
14
mnist_main.py :
@@ -45,7 +47,7 @@ ptests check: mnist_main.py
45
47
@echo " ======================================================================"
46
48
@echo " examples/MNIST: Parallel testing on 4 MPI processes"
47
49
@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
49
51
@echo " "
50
52
51
53
clean :
Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ check_PROGRAMS = collective_write.py \
17
17
put_var.py \
18
18
get_var.py
19
19
20
-
20
+ TESTMPIRUN = $( shell dirname ${CC}) /mpirun
21
21
TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
22
22
TESTS_ENVIRONMENT += export PNETCDF_DIR="${PNETCDF_DIR}";
23
+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
23
24
24
25
OUTPUT_DIR = _tmp_output
25
26
Original file line number Diff line number Diff line change 6
6
check_PROGRAMS = torch_ddp_skeleton.py
7
7
8
8
9
+ TESTMPIRUN = $(shell dirname ${CC}) /mpirun
9
10
TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
10
11
TESTS_ENVIRONMENT += export PNETCDF_DIR="${PNETCDF_DIR}";
12
+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
11
13
12
14
OUTPUT_DIR = _tmp_output
13
15
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ for prog in $check_PROGRAMS; do
31
31
printf ' %-60s' " Testing $prog "
32
32
33
33
if test $prog = " torch_ddp_skeleton.py" ; then
34
- CMD=" mpiexec -n $NPROC python $prog -q"
34
+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q"
35
35
fi
36
36
$CMD
37
37
status=$?
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ check_PROGRAMS = nonblocking_write_def.py \
7
7
nonblocking_write.py \
8
8
nonblocking_read.py
9
9
10
-
10
+ TESTMPIRUN = $( shell dirname ${CC}) /mpirun
11
11
TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
12
12
TESTS_ENVIRONMENT += export PNETCDF_DIR="${PNETCDF_DIR}";
13
+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
13
14
14
15
OUTPUT_DIR = _tmp_output
15
16
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ for prog in $check_PROGRAMS; do
61
61
printf ' %-60s' " Testing $prog "
62
62
63
63
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"
65
65
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"
67
67
fi
68
68
# echo "$CMD"
69
69
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ for prog in $check_PROGRAMS; do
61
61
printf ' %-60s' " Testing $prog "
62
62
63
63
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"
65
65
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"
67
67
fi
68
68
$CMD
69
69
status=$?
Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ check_PROGRAMS = tst_atts.py \
50
50
tst_wait.py \
51
51
tst_libver.py
52
52
53
+ TESTMPIRUN = $(shell dirname ${CC}) /mpirun
53
54
TESTS_ENVIRONMENT = export check_PROGRAMS="${check_PROGRAMS}";
55
+ TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
54
56
OUTPUT_DIR = _tmp_output
55
57
56
58
all :
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ for prog in ${check_PROGRAMS} ; do
31
31
printf ' %-60s' " Testing $prog "
32
32
33
33
if test $prog = " tst_libver.py" ; then
34
- CMD=" mpiexec -n $NPROC python $prog -q"
34
+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog -q"
35
35
else
36
- CMD=" mpiexec -n $NPROC python $prog $OUT_DIR "
36
+ CMD=" ${TESTMPIRUN} -n $NPROC python $prog $OUT_DIR "
37
37
fi
38
38
$CMD
39
39
status=$?
You can’t perform that action at this time.
0 commit comments