PETSc/config/BuildSystem/config/packages/MPI.py: Difference between revisions

From Arbeitsgruppe Kuiper
Jump to navigation Jump to search
(new)
 
m (→‎Patch: 1140850688)
 
Line 14: Line 14:


<code>MPI_Comm_f2c()</code> expects an <code>int</code>. A failure of this check makes HAVE_MPI_COMM_F2C ''not'' being defined, which in turn activates the dubious macro <code>#define MPI_Comm_f2c(a) (a)</code> (i.e. a substitution by the identity) in "conffix.h", which in turns ruins the prototype in <mpi.h>.
<code>MPI_Comm_f2c()</code> expects an <code>int</code>. A failure of this check makes HAVE_MPI_COMM_F2C ''not'' being defined, which in turn activates the dubious macro <code>#define MPI_Comm_f2c(a) (a)</code> (i.e. a substitution by the identity) in "conffix.h", which in turns ruins the prototype in <mpi.h>.
Remark: The number 1140850688 (=0x44000000) is not important, it's just that [https://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2009/msg00024.html MPICH used it to mean MPI_COMM_WORLD in Fortran].

Latest revision as of 16:48, 13 June 2025

Patch

 --- petsc-3.1-p8/config/BuildSystem/config/packages/MPI.py~     2025-06-13 10:40:37.944362909 +0200
 +++ petsc-3.1-p8/config/BuildSystem/config/packages/MPI.py      2025-06-13 10:51:54.113711183 +0200
 @@ -198,7 +198,7 @@
      oldLibs  = self.compilers.LIBS
      self.compilers.CPPFLAGS += ' '+self.headers.toString(self.include)
      self.compilers.LIBS = self.libraries.toString(self.lib)+' '+self.compilers.LIBS
 -    if self.checkLink('#include <mpi.h>\n', 'if (MPI_Comm_f2c(MPI_COMM_WORLD));\n'):
 +    if self.checkLink('#include <mpi.h>\n', 'if (MPI_Comm_f2c(1140850688));\n'):
        self.commf2c = 1
        self.addDefine('HAVE_MPI_COMM_F2C', 1)
      if self.checkLink('#include <mpi.h>\n', 'if (MPI_Comm_c2f(MPI_COMM_WORLD));\n'):

MPI_Comm_f2c() expects an int. A failure of this check makes HAVE_MPI_COMM_F2C not being defined, which in turn activates the dubious macro #define MPI_Comm_f2c(a) (a) (i.e. a substitution by the identity) in "conffix.h", which in turns ruins the prototype in <mpi.h>.

Remark: The number 1140850688 (=0x44000000) is not important, it's just that MPICH used it to mean MPI_COMM_WORLD in Fortran.