From: Augustin Degomme Date: Sun, 14 Apr 2019 14:46:37 +0000 (+0200) Subject: MPI_INFO_ENV ... Still does nothing for now X-Git-Tag: v3.22.2~134 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2bb3a0d042a8a1deb91c18dba0cbdf42237413d4 MPI_INFO_ENV ... Still does nothing for now --- diff --git a/src/smpi/include/smpi_actor.hpp b/src/smpi/include/smpi_actor.hpp index 098642963f..58e7e48954 100644 --- a/src/smpi/include/smpi_actor.hpp +++ b/src/smpi/include/smpi_actor.hpp @@ -37,6 +37,7 @@ class ActorExt { 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 **/ @@ -81,6 +82,7 @@ public: s4u::ActorPtr get_actor(); int get_optind(); void set_optind(int optind); + MPI_Info info_env(); }; } // namespace smpi diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index 7b81cdddb2..44e9d5ab27 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -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; + info_env_ = MPI_INFO_NULL; if (MC_is_active()) MC_ignore_heap(timer_, xbt_os_timer_size()); @@ -193,6 +194,11 @@ MPI_Comm ActorExt::comm_self() return comm_self_; } +MPI_Info ActorExt::info_env() +{ + return info_env_; +} + MPI_Comm ActorExt::comm_intra() { return comm_intra_; @@ -248,6 +254,7 @@ int ActorExt::get_optind() { return optind_; } + void ActorExt::set_optind(int new_optind) { optind_ = new_optind; diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 425d737af4..9ad0c6d881 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -127,6 +127,10 @@ MPI_Comm 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(); } diff --git a/teshsuite/smpi/mpich3-test/info/infoenv.c b/teshsuite/smpi/mpich3-test/info/infoenv.c index 5b0fa1c31e..08da1d16f1 100644 --- a/teshsuite/smpi/mpich3-test/info/infoenv.c +++ b/teshsuite/smpi/mpich3-test/info/infoenv.c @@ -12,7 +12,7 @@ static int verbose = 0; 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; @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) 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); }