File: openmpi5

package info (click to toggle)
gyoto 2.0.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,420 kB
  • sloc: cpp: 42,317; sh: 4,512; python: 3,436; xml: 2,865; makefile: 685; ansic: 346
file content (50 lines) | stat: -rw-r--r-- 1,494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/yorick/check-mpi.i b/yorick/check-mpi.i
index 77c27cc..b5fb11a 100644
--- a/yorick/check-mpi.i
+++ b/yorick/check-mpi.i
@@ -39,7 +39,7 @@ if (MPI_Initialized()) error, "MPI should not be initialized yet";
 done;
 
 doing, "Calling MPI_Init";
-if (MPI_Init() && have_mpi) error, "MPI INIT FAILED";
+if (MPI_Init("yorick") && have_mpi) error, "MPI INIT FAILED";
 done;
 
 doing, "Calling MPI_Initiliazed again";
diff --git a/yorick/gyoto_utils.C b/yorick/gyoto_utils.C
index 6ffcf76..0ec8242 100644
--- a/yorick/gyoto_utils.C
+++ b/yorick/gyoto_utils.C
@@ -334,6 +334,7 @@ extern "C" {
   Y_gyoto_MPI_Init(int argc)
   {
 #if defined HAVE_MPI
+    // Prepare argument for MPI_Init
     long int mpiargcl=0;
     char **mpiargv=NULL;
     long index=-1;
@@ -343,7 +344,23 @@ extern "C" {
       if (!yarg_nil(0)) mpiargv=ygeta_q(0, &mpiargcl, NULL);
     }
     int mpiargc=mpiargcl;
-    ypush_long(MPI_Init(&mpiargc, &mpiargv));
+    GYOTO_DEBUG_EXPR(mpiargc);
+    GYOTO_DEBUG_EXPR(mpiargv);
+    for (long int k=0; k<mpiargc; ++k)
+      GYOTO_DEBUG_EXPR(mpiargv[k]);
+
+    // In OpenMPI 5, MPI_Init triggers FPE exceptions.
+    // Ignore FPE exceptions for this call..
+# if defined HAVE_FENV_H
+    fenv_t envp;
+    feholdexcept(&envp);
+# endif
+    long int status = MPI_Init(&mpiargc, &mpiargv);
+# if defined HAVE_FENV_H
+    fesetenv(&envp);
+# endif
+    ypush_long(status);
+
     if (index>=0) {
       long dims[]={1, mpiargc};
       ystring_t * out=ypush_q(dims);