intel / mpi-benchmarks

145 stars 63 forks source link

Compiling IMB with -DCHECK gives error #21

Closed jyoti2306 closed 5 years ago

jyoti2306 commented 5 years ago

I want to compile IMB with MVAPICH2-2.1 with -DCHECK option enabled. I have got 2 issues here.

  1. After exporting CPPFLAGS = -DCHECK and running make, it gives the following error.

    make -j8 -C src_cpp -f Makefile TARGET=MPI1 make[1]: Entering directory '/home/jyoti/Desktop/mpi-benchmarks-master/src_cpp' mpiicpc -DCHECK -Ihelpers -I../src_c -DMPI1 -I. -O0 -Wall -Wextra -pedantic -Wno-long-long -c -o imb.o imb.cpp mpiicpc -DCHECK -Ihelpers -I../src_c -DMPI1 -I. -O0 -Wall -Wextra -pedantic -Wno-long-long -c -o args_parser.o args_parser.cpp make[1]: mpiicpc: Command not found /bin/sh: 1: [: unexpected operator make[1]: mpiicpc: Command not found Makefile:181: recipe for target 'imb.o' failed make[1]: [imb.o] Error 127 make[1]: Waiting for unfinished jobs.... Makefile:181: recipe for target 'args_parser.o' failed make[1]: [args_parser.o] Error 127 /bin/sh: 1: [: unexpected operator make[1]: Leaving directory '/home/jyoti/Desktop/mpi-benchmarks-master/src_cpp' Makefile:53: recipe for target 'IMB-MPI1' failed make: [IMB-MPI1] Error 2

    mpiicpc belongs to IntelMPI but I want to compile it with MVAPICH2-2.1. How can I enable DCHECK?

  2. I want to use the files in src_c only. So when I export CFLAGS = -DCHECK and do make in src_c folder, it gives the following error.

    make -f Makefile TARGET=MPI1 make[1]: Entering directory '/home/jyoti/Desktop/mpi-benchmarks-master/src_c' mkdir -p build_MPI1 mpicc -DCHECK -DMPI1 -c IMB.c -o build_MPI1/IMB.o IMB.c: In function ‘main’: IMB.c:391:8: error: expected ‘(’ before ‘num_alloc’ if num_alloc == num_free) ^ IMB.c:391:29: error: expected statement before ‘)’ token if num_alloc == num_free) ^ IMB.c:393:5: error: ‘else’ without a previous ‘if’ else { ^ Makefile:112: recipe for target 'build_MPI1/IMB.o' failed make[1]: [build_MPI1/IMB.o] Error 1 make[1]: Leaving directory '/home/jyoti/Desktop/mpi-benchmarks-master/src_c' Makefile:87: recipe for target 'all' failed make: [all] Error 2

    This seems to be an error in the code.

How can I resolve these?

Thanks

dmitrygx commented 5 years ago

@jyoti2306

  1. After exporting CPPFLAGS = -DCHECK and running make, it gives the following error.

from my personal experience w/ IMB compiling w/ OpenMPI, try to set your compiler preferences manually using: make CC=mpicc CXX=mpicxx

There are tons of warnings, but it compiles successfully:

...
../src_c/IMB_scatter.c:170:19: warning: (this will be reported only once per input file) [enabled by default]
In file included from ../src_c/IMB_scatter.c:71:0:
../src_c/IMB_declare.h:194:12: warning: ‘asize’ defined but not used [-Wunused-variable]
 static int asize = (int) sizeof(assign_type);
            ^
mpicc -O0 -Wall -Wextra -pedantic -Wno-long-long -Ihelpers -I../src_c -DMPI1 -I. -DMPI1 -c -o MPI1/IMB_warm_up.o ../src_c/IMB_warm_up.c
In file included from ../src_c/IMB_comm_info.h:68:0,
                 from ../src_c/IMB_declare.h:87,
                 from ../src_c/IMB_scatterv.c:71:
../src_c/IMB_declare.h:198:21: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
     MIN = 0,        // Min time by ranks
                     ^
../src_c/IMB_declare.h:198:21: warning: (this will be reported only once per input file) [enabled by default]
In file included from ../src_c/IMB_scatterv.c:71:0:
../src_c/IMB_declare.h:198:21: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
     MIN = 0,        // Min time by ranks
                     ^
../src_c/IMB_declare.h:198:21: warning: (this will be reported only once per input file) [enabled by default]
In file included from ../src_c/IMB_declare.h:66:0,
                 from ../src_c/IMB_sendrecv.c:71:
/hpc/local/benchmarks/hpcx_install_2019-05-01/hpcx-gcc-redhat7.4/ompi/include/mpi.h:319:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 // This macro definition may show up in compiler output.  So we both
 ^
/hpc/local/benchmarks/hpcx_install_2019-05-01/hpcx-gcc-redhat7.4/ompi/include/mpi.h:319:1: warning: (this will be reported only once per input file) [enabled by default]
In file included from ../src_c/IMB_scatterv.c:72:0:
../src_c/IMB_benchmark.h:145:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 // failure flags for single samples
 ^
../src_c/IMB_benchmark.h:145:1: warning: (this will be reported only once per input file) [enabled by default]
In file included from ../src_c/IMB_scatterv.c:74:0:
../src_c/IMB_prototypes.h:118:8: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 #endif // MPI1
        ^
../src_c/IMB_prototypes.h:118:8: warning: (this will be reported only once per input file) [enabled by default]
../src_c/IMB_scatterv.c: In function ‘IMB_scatterv’:
../src_c/IMB_scatterv.c:150:9: warning: implicit declaration of function ‘IMB_Barrier’ [-Wimplicit-function-declaration]
         IMB_do_n_barriers(c_info->communicator, N_BARR);
         ^
../src_c/IMB_scatterv.c:91:25: warning: unused parameter ‘RUN_MODE’ [-Wunused-parameter]
                   MODES RUN_MODE, double* time) {
                         ^
../src_c/IMB_scatterv.c: At top level:
../src_c/IMB_scatterv.c:178:19: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 #elif defined NBC // MPI1
...

2, I want to use the files in src_c only.

It was fixed in IMB 2019 U2 release (master branch contains the fix): https://github.com/intel/mpi-benchmarks/blob/d18eeceddd05bc3440d15016c9aee6aaf5a0ca52/src_c/IMB.c#L393

jyoti2306 commented 5 years ago

This helped. Thanks!

dmitrygx commented 5 years ago

This helped. Thanks!

folks from IMB may consider this as a request to improve UX design ;)