Compilation error when openmpi is upgraded to 4.0.0
I was able to test it on Openmpi-3.0.0 and it worked fine. However, when I moved my system to 4.0.0 I was hit with an error at this line.
ierr = MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
SOLUTION:
I removed the line from main and everything compiled perfectly. However, as I am not one of the application developers. I would like to know if you can take a look and if removing that line does not trigger other things to fail throughout the different application components.
Hey, what error did you get during the compile?
Hey, what error did you get during the compile?
mpicc -o ma.x block.o check_sum.o comm_block.o comm.o comm_parent.o comm_refine.o comm_util.o driver.o init.o main.o move.o pack.o plot.o profile.o rcb.o refine.o stencil.o target.o util.o -lm
main.o: In function main': main.c:(.text.startup+0x1bc): undefined reference to MPI_Errhandler_set'
collect2: error: ld returned 1 exit status
Makefile:15: recipe for target 'ma.x' failed
make: *** [ma.x] Error 1
@nmhamster #6289 https://github.com/open-mpi/ompi/issues/6289#issue-401045341
@nmhamster The issue is that Open MPI v4.0.0 finally removed some MPI APIs that were removed from the MPI v3.0 spec back in 2012.
Fortunately, updating to stop using MPI_Errhandle_set is trivial: just use MPI_Comm_set_errhandler instead -- the arguments and behavior is exactly the same (see https://www.open-mpi.org/faq/?category=mpi-removed#mpi-1-mpi-errhandler-set). MPI_Comm_set_errhandler has been in the MPI spec since v2.0 -- i.e., 1996. So every MPI implementation has it; you shouldn't have any portability problems when you switch over to it.