Skip to content

Commit 9f77b20

Browse files
committed
add mpi_op test in CI
Signed-off-by: heyujiao99 <[email protected]>
1 parent 0ca4183 commit 9f77b20

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/riscv64-qemu-test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ jobs:
5757
grep "bogomips" /proc/cpuinfo | head -n 1 | awk '{printf("%d", $3*500000)}' | perl -e 'print pack("N", <STDIN>)' > /opt/riscv/sysroot/proc/device-tree/cpus/timebase-frequency
5858
cd test/util
5959
qemu-riscv64 -cpu rv64,v=true,vext_spec=v1.0,vlen=128 /opt/riscv/bin/mpirun -n 1 ./opal_timer
60+
61+
- name: Run MPI_OP
62+
run: |
63+
export QEMU_LD_PREFIX=/opt/riscv/sysroot
64+
export PATH="/opt/riscv/bin:$PATH"
65+
export LD_LIBRARY_PATH="/opt/riscv/lib:$LD_LIBRARY_PATH"
66+
cd test/datatype
67+
qemu-riscv64 -cpu rv64,v=true,vext_spec=v1.0,vlen=128 /opt/riscv/bin/ompi_info --param all all --level 9 | grep "MCA op "
68+
qemu-riscv64 -cpu rv64,v=true,vext_spec=v1.0,vlen=128 /opt/riscv/bin/mpirun -n 1 ./reduce_local -l 1024 -u 1024

test/datatype/reduce_local.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ do { \
127127
const TYPE *_p1 = ((TYPE*)(INBUF)), *_p3 = ((TYPE*)(CHECK_BUF)); \
128128
TYPE *_p2 = ((TYPE*)(INOUT_BUF)); \
129129
skip_op_type = 0; \
130-
for(int _k = 0; _k < min((COUNT), max_shift); +_k++ ) { \
130+
int min_count = min((COUNT), max_shift); \
131+
for(int _k = 0; _k < min_count; +_k++ ) { \
131132
duration[_k] = 0.0; \
132133
for(int _r = repeats; _r > 0; _r--) { \
133134
memcpy(_p2, _p3, sizeof(TYPE) * (COUNT)); \
@@ -155,7 +156,8 @@ do { \
155156
const TYPE *_p1 = ((TYPE*)(INBUF)), *_p3 = ((TYPE*)(CHECK_BUF)); \
156157
TYPE *_p2 = ((TYPE*)(INOUT_BUF)); \
157158
skip_op_type = 0; \
158-
for(int _k = 0; _k < min((COUNT), max_shift); +_k++ ) { \
159+
int min_count = min((COUNT), max_shift); \
160+
for(int _k = 0; _k < min_count; +_k++ ) { \
159161
duration[_k] = 0.0; \
160162
for(int _r = repeats; _r > 0; _r--) { \
161163
memcpy(_p2, _p3, sizeof(TYPE) * (COUNT)); \

0 commit comments

Comments
 (0)