Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI_INFO_ENV ... Still does nothing for now
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 14 Apr 2019 14:46:37 +0000 (16:46 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 14 Apr 2019 16:15:50 +0000 (18:15 +0200)
src/smpi/include/smpi_actor.hpp
src/smpi/internals/smpi_actor.cpp
src/smpi/internals/smpi_global.cpp
teshsuite/smpi/mpich3-test/info/infoenv.c

index 0986429..58e7e48 100644 (file)
@@ -37,6 +37,7 @@ class ActorExt {
   int optind_                                     = 1; /*for getopt replacement */
 #endif
   std::string tracing_category_                  = "";
   int optind_                                     = 1; /*for getopt replacement */
 #endif
   std::string tracing_category_                  = "";
+  MPI_Info info_env_;
 
 #if HAVE_PAPI
   /** Contains hardware data as read by PAPI **/
 
 #if HAVE_PAPI
   /** Contains hardware data as read by PAPI **/
@@ -81,6 +82,7 @@ public:
   s4u::ActorPtr get_actor();
   int get_optind();
   void set_optind(int optind);
   s4u::ActorPtr get_actor();
   int get_optind();
   void set_optind(int optind);
+  MPI_Info info_env();
 };
 
 } // namespace smpi
 };
 
 } // namespace smpi
index 7b81cdd..44e9d5a 100644 (file)
@@ -27,6 +27,7 @@ ActorExt::ActorExt(s4u::ActorPtr actor, s4u::Barrier* finalization_barrier)
   mailboxes_mutex_ = s4u::Mutex::create();
   timer_           = xbt_os_timer_new();
   state_           = SmpiProcessState::UNINITIALIZED;
   mailboxes_mutex_ = s4u::Mutex::create();
   timer_           = xbt_os_timer_new();
   state_           = SmpiProcessState::UNINITIALIZED;
+  info_env_        = MPI_INFO_NULL;
   if (MC_is_active())
     MC_ignore_heap(timer_, xbt_os_timer_size());
 
   if (MC_is_active())
     MC_ignore_heap(timer_, xbt_os_timer_size());
 
@@ -193,6 +194,11 @@ MPI_Comm ActorExt::comm_self()
   return comm_self_;
 }
 
   return comm_self_;
 }
 
+MPI_Info ActorExt::info_env()
+{
+  return info_env_;
+}
+
 MPI_Comm ActorExt::comm_intra()
 {
   return comm_intra_;
 MPI_Comm ActorExt::comm_intra()
 {
   return comm_intra_;
@@ -248,6 +254,7 @@ int ActorExt::get_optind()
 {
   return optind_;
 }
 {
   return optind_;
 }
+
 void ActorExt::set_optind(int new_optind)
 {
   optind_ = new_optind;
 void ActorExt::set_optind(int new_optind)
 {
   optind_ = new_optind;
index 425d737..9ad0c6d 100644 (file)
@@ -127,6 +127,10 @@ MPI_Comm smpi_process_comm_self(){
   return smpi_process()->comm_self();
 }
 
   return smpi_process()->comm_self();
 }
 
+MPI_Info smpi_process_info_env(){
+  return smpi_process()->info_env();
+}
+
 void smpi_process_init(int *argc, char ***argv){
   simgrid::smpi::ActorExt::init();
 }
 void smpi_process_init(int *argc, char ***argv){
   simgrid::smpi::ActorExt::init();
 }
index 5b0fa1c..08da1d1 100644 (file)
@@ -12,7 +12,7 @@ static int verbose = 0;
 int main(int argc, char *argv[])
 {
     char value[MPI_MAX_INFO_VAL];
 int main(int argc, char *argv[])
 {
     char value[MPI_MAX_INFO_VAL];
-    char *keys[] = { "command", "argv", "maxprocs", "soft", "host", "arch", "wdir", "file",
+    const char *keys[] = { "command", "argv", "maxprocs", "soft", "host", "arch", "wdir", "file",
         "thread_level", 0
     };
     int flag, i;
         "thread_level", 0
     };
     int flag, i;
@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
     MPI_Init(NULL, NULL);
 
     for (i = 0; keys[i]; i++) {
     MPI_Init(NULL, NULL);
 
     for (i = 0; keys[i]; i++) {
-        MPI_Info_get(MPI_INFO_ENV, keys[i], MPI_MAX_INFO_VAL, value, &flag);
+        MPI_Info_get(MPI_INFO_ENV, (char*)keys[i], MPI_MAX_INFO_VAL, value, &flag);
         if (flag && verbose)
             printf("command: %s\n", value);
     }
         if (flag && verbose)
             printf("command: %s\n", value);
     }