Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpif90 changes (force gfortran for now), replace "use mpi" by include "mpif.h"
authorAugustin Degomme <degomme@idpann.imag.fr>
Wed, 17 Jul 2013 14:39:34 +0000 (16:39 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Wed, 17 Jul 2013 14:41:30 +0000 (16:41 +0200)
include/smpi/mpif.h
include/smpi/smpi.h
src/smpi/smpif90.in

index 690380e..f8f31e0 100644 (file)
 ! This should be equal to the number of int fields in MPI_Status
       integer MPI_STATUS_SIZE, MPI_STATUSES_IGNORE
       parameter(MPI_STATUS_SIZE=4)
-      parameter(MPI_STATUSES_IGNORE=0)
+      common/smpi/ MPI_STATUSES_IGNORE
 
       integer MPI_STATUS_IGNORE(MPI_STATUS_SIZE)
       common/smpi/ MPI_STATUS_IGNORE
       integer MPI_REQUEST_NULL
       parameter(MPI_REQUEST_NULL=-1)
 
+      integer MPI_INTEGER_KIND
+      parameter(MPI_INTEGER_KIND=4)
+
 ! These should be ordered as in smpi_f77.c
       integer MPI_DATATYPE_NULL, MPI_BYTE, MPI_CHARACTER, MPI_LOGICAL
       integer MPI_INTEGER, MPI_INTEGER1, MPI_INTEGER2, MPI_INTEGER4
index 1eebe9f..2aec62a 100644 (file)
@@ -570,6 +570,7 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_get, (MPI_Comm comm, MPI_Errhandler* er
 MPI_CALL(XBT_PUBLIC(int), MPI_Error_string, (int errorcode, char* string, int* resultlen));
 MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_set, (MPI_Comm comm, MPI_Errhandler errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_errhandler, (MPI_Comm comm, MPI_Errhandler errhandler));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_errhandler, (MPI_Comm comm, MPI_Errhandler *errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create_errhandler,( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_call_errhandler,(MPI_Comm comm,int errorcode));
 MPI_CALL(XBT_PUBLIC(int), MPI_Add_error_class,( int *errorclass));
index 9864551..bb772b5 100644 (file)
@@ -1,11 +1,11 @@
 #! /bin/bash
 
-CC=@CMAKE_Fortran_Compiler@
+CC=gfortran
 
 INCLUDEARGS="@includeflag@"
 CMAKE_LINKARGS="-L@libdir@"
 
-FFLAGS="-ff2c "
+FFLAGS="-ff2c  -fno-second-underscore"
 LINKARGS="-lsimgrid -lm -lgfortran"
 main_name=main
 TMPFILE=$(mktemp).f90
@@ -24,8 +24,9 @@ while [ -n "$1" ]; do
       if [ -z $SRCFILE ] ; then
          SRCFILE="$ARG"
       fi
+      TMPFILE=$ARG\_.f90
       #replace "program main_name by subroutine user\_main (and the end clause as well)"
-      sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/subroutine user\_main /gI'  ${ARG} > ${TMPFILE}
+      sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/subroutine user\_main /gI;s/[[:space:]]*use[[:space:]]*mpi/\include \"mpif\.h\" /gI'  ${ARG} > ${TMPFILE}
       SRCFILE="${TMPFILE}"
       CMDLINE="${CMDLINE} ${SRCFILE} "
       ;;
@@ -37,7 +38,7 @@ done
 
 CMDLINE="${CC} ${FFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
 
-echo "${CMDLINE}"
+#echo "${CMDLINE}"
 ${CMDLINE}
 
 if [ -f ${TMPFILE} ];then