miniAMR icon indicating copy to clipboard operation
miniAMR copied to clipboard

Compilation error when openmpi is upgraded to 4.0.0

Open abeltre1 opened this issue 7 years ago • 4 comments

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.

abeltre1 avatar Jan 20 '19 21:01 abeltre1

Hey, what error did you get during the compile?

nmhamster avatar Jan 21 '19 04:01 nmhamster

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

abeltre1 avatar Jan 21 '19 04:01 abeltre1

@nmhamster #6289 https://github.com/open-mpi/ompi/issues/6289#issue-401045341

abeltre1 avatar Jan 22 '19 19:01 abeltre1

@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.

jsquyres avatar Jan 22 '19 20:01 jsquyres