Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fortran-smpi was broken
authorAugustin Degomme <degomme@idpann.imag.fr>
Fri, 26 Oct 2012 08:55:36 +0000 (10:55 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Fri, 26 Oct 2012 08:55:36 +0000 (10:55 +0200)
include/smpi/smpi.h
src/smpi/smpi_global.c

index 7a2ea0d..567cafa 100644 (file)
@@ -129,12 +129,12 @@ XBT_PUBLIC( MPI_Datatype ) MPI_OFFSET;
 XBT_PUBLIC( MPI_Datatype ) MPI_LB;
 XBT_PUBLIC( MPI_Datatype ) MPI_UB;
 //The following are datatypes for the MPI functions MPI_MAXLOC  and MPI_MINLOC.
-extern MPI_Datatype MPI_FLOAT_INT;
-extern MPI_Datatype MPI_LONG_INT;
-extern MPI_Datatype MPI_DOUBLE_INT;
-extern MPI_Datatype MPI_SHORT_INT;
-extern MPI_Datatype MPI_2INT;
-extern MPI_Datatype MPI_LONG_DOUBLE_INT;
+XBT_PUBLIC(MPI_Datatype) MPI_FLOAT_INT;
+XBT_PUBLIC(MPI_Datatype) MPI_LONG_INT;
+XBT_PUBLIC(MPI_Datatype) MPI_DOUBLE_INT;
+XBT_PUBLIC(MPI_Datatype) MPI_SHORT_INT;
+XBT_PUBLIC(MPI_Datatype) MPI_2INT;
+XBT_PUBLIC(MPI_Datatype) MPI_LONG_DOUBLE_INT;
 XBT_PUBLIC(MPI_Datatype) MPI_2FLOAT;
 XBT_PUBLIC(MPI_Datatype) MPI_2DOUBLE;
 
@@ -511,7 +511,8 @@ XBT_PUBLIC(void*) smpi_shared_set_call(const char* func, const char* input, void
 
 /* Fortran specific stuff */
 XBT_PUBLIC(int) __attribute__((weak)) smpi_simulated_main(int argc, char** argv);
-XBT_PUBLIC(int) MAIN__(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]);
+XBT_PUBLIC(int) __attribute__((weak)) MAIN__(void);
+XBT_PUBLIC(int) smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]);
 
 XBT_PUBLIC(int) smpi_process_index(void);
 
index 24e869c..1baf3ea 100644 (file)
@@ -286,16 +286,24 @@ void smpi_global_destroy(void)
 /* Fortran specific stuff */
 /* With smpicc, the following weak symbols are used */
 /* With smpiff, the following weak symbols are replaced by those in libf2c */
+
+int __attribute__((weak)) xargc;
+char** __attribute__((weak)) xargv;
+
 int __attribute__((weak)) smpi_simulated_main(int argc, char** argv) {
   xbt_die("Should not be in this smpi_simulated_main");
   return 1;
 }
 
 int __attribute__((weak)) main(int argc, char** argv) {
-   return MAIN__(smpi_simulated_main,argc,argv);
+   return smpi_main(smpi_simulated_main,argc,argv);
 }
 
-int MAIN__(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
+int __attribute__((weak)) MAIN__(){
+  return smpi_main(smpi_simulated_main,xargc, xargv);
+};
+
+int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
 {
   srand(SMPI_RAND_SEED);