Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / smpi / smpi_global.c
index fbf18b4..12da83c 100644 (file)
@@ -79,9 +79,6 @@ void smpi_process_init(int *argc, char ***argv)
     int rank = atoi((*argv)[2]);
     index =  SIMIX_process_get_PID(proc) -1;
 
-#ifdef SMPI_F2C
-    smpi_current_rank = index;
-#endif
     if(!index_to_process_data){
         index_to_process_data=(int*)xbt_malloc(SIMIX_process_count()*sizeof(int));
     }
@@ -93,6 +90,7 @@ void smpi_process_init(int *argc, char ***argv)
     if(temp_bar != NULL) data->finalization_barrier = temp_bar;
     data->index = index;
     data->instance_id = instance_id;
+    xbt_free(simcall_process_get_data(proc));
     simcall_process_set_data(proc, data);
     if (*argc > 3) {
       free((*argv)[1]);
@@ -171,33 +169,6 @@ void smpi_process_mark_as_initialized(void)
 }
 
 
-#ifdef SMPI_F2C
-int smpi_process_argc(void)
-{
-  smpi_process_data_t data = smpi_process_data();
-  return data->argc ? *(data->argc) - 1 : 0;
-}
-
-int smpi_process_getarg(integer * index, char *dst, ftnlen len)
-{
-  smpi_process_data_t data = smpi_process_data();
-  char *arg;
-  ftnlen i;
-
-  if (!data->argc || !data->argv || *index < 1 || *index >= *(data->argc)) {
-    return -1;
-  }
-  arg = (*data->argv)[*index];
-  for (i = 0; i < len && arg[i] != '\0'; i++) {
-    dst[i] = arg[i];
-  }
-  for (; i < len; i++) {
-    dst[i] = ' ';
-  }
-  return 0;
-}
-#endif
-
 int smpi_global_size(void)
 {
   char *value = getenv("SMPI_GLOBAL_SIZE");
@@ -383,6 +354,10 @@ static void smpi_check_options(){
    }
 }
 
+int smpi_enabled(void) {
+  return process_data != NULL;
+}
+
 void smpi_global_init(void)
 {
   int i;
@@ -463,12 +438,6 @@ void smpi_global_destroy(void)
   smpi_free_static();
 }
 
-/* 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;
-
 #ifndef WIN32
 void __attribute__ ((weak)) user_main_()
 {
@@ -488,10 +457,6 @@ int __attribute__ ((weak)) main(int argc, char **argv)
   return smpi_main(smpi_simulated_main_, argc, argv);
 }
 
-int __attribute__ ((weak)) MAIN__()
-{
-  return smpi_main(smpi_simulated_main_, xargc, xargv);
-};
 #endif
 
 static void smpi_init_logs(){
@@ -516,6 +481,7 @@ static void smpi_init_logs(){
   XBT_LOG_CONNECT(smpi_mpi_dt);
   XBT_LOG_CONNECT(smpi_pmpi);
   XBT_LOG_CONNECT(smpi_replay);
+  XBT_LOG_CONNECT(smpi_rma);
 
 }