OPM / opm-grid

DUNE module supporting grids in a corner-point format
http://www.opm-project.org
GNU General Public License v3.0
18 stars 77 forks source link

zoltan_test 'MPI_Errhandler_create’ was not declared in this scope #366

Closed fgfuchs closed 4 years ago

fgfuchs commented 5 years ago

When I am compiling, I get the following error:

opm-grid/tests/cpgrid/zoltan_test.cpp:100:9: error: ‘MPI_Errhandler_create’ was not declared in this scope
         MPI_Errhandler_create(MPI_err_handler, &handler);
         ^~~~~~~~~~~~~~~~~~~~~
opm-grid/tests/cpgrid/zoltan_test.cpp:100:9: note: suggested alternative: ‘MPI_Errhandler_free’
         MPI_Errhandler_create(MPI_err_handler, &handler);

My versions are: openmpi 4.0.1-1 zoltan 3.83-5

Can anybody help me with this?

akva2 commented 5 years ago

MPI_Errhandler_create was deprecate in MPI 2 and removed, see https://www.open-mpi.org/faq/?category=mpi-removed#mpi-1-mpi-errhandler-create

akva2 commented 5 years ago
diff --git a/tests/cpgrid/zoltan_test.cpp b/tests/cpgrid/zoltan_test.cpp
index ceadb0c..950c9b0 100644
--- a/tests/cpgrid/zoltan_test.cpp
+++ b/tests/cpgrid/zoltan_test.cpp
@@ -97,7 +97,11 @@ BOOST_AUTO_TEST_CASE(zoltan)
         Zoltan_Set_Param(zz, "PHG_EDGE_SIZE_THRESHOLD", ".35");  /* 0-remove all, 1-remove none */

         MPI_Errhandler handler;
+#ifdef MPI_2
+        MPI_Comm_create_errhandler(MPI_err_handler, &handler);
+#else
         MPI_Errhandler_create(MPI_err_handler, &handler);
+#endif
         MPI_Errhandler_set(MPI_COMM_WORLD, handler);
         MPI_Comm_size(MPI_COMM_WORLD, &procs);
         MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
fgfuchs commented 5 years ago

OK, so this means I need to downgrade my openmpi version?

fgfuchs commented 5 years ago

I will create a pull request based on your diff @akva2 . Thanks

blattms commented 4 years ago

Fixed with merge of #367