From: Frederic Suter Date: Thu, 26 Jul 2018 07:09:02 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_21~355^2~26 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2fc459da5e81c223895e15121c21678aa8f445f1?hp=c46148013de34cfdc4d4651a26e26cf8c0d974b0 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 31f04052a2..25cd68fa92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,12 +87,15 @@ if ((NOT DEFINED enable_smpi) OR enable_smpi) if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(SMPI_Fortran_FLAGS "\"-fpic\" \"-ff2c\" \"-fno-second-underscore\"") set(SMPI_Fortran_LIBS "\"-lgfortran\"") + set(SMPI_GFORTRAN 1) elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") set(SMPI_Fortran_FLAGS "\"-fPIC\" \"-nofor-main\"") set(SMPI_Fortran_LIBS "\"-lifcore\"") + set(SMPI_IFORT 1) elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI|Flang") # flang set(SMPI_Fortran_FLAGS "\"-fPIC\"") set(SMPI_Fortran_LIBS "") + set(SMPI_FLANG 1) endif() set(SMPI_FORTRAN 1) diff --git a/src/smpi/include/smpi_actor.hpp b/src/smpi/include/smpi_actor.hpp index bf6371cdcc..0f1a13ea4d 100644 --- a/src/smpi/include/smpi_actor.hpp +++ b/src/smpi/include/smpi_actor.hpp @@ -17,8 +17,6 @@ namespace smpi { class ActorExt { private: double simulated_ = 0 /* Used to time with simulated_start/elapsed */; - int* argc_ = nullptr; - char*** argv_ = nullptr; simgrid::s4u::MailboxPtr mailbox_; simgrid::s4u::MailboxPtr mailbox_small_; xbt_mutex_t mailboxes_mutex_; diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index 42847cfb98..c358275cd4 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -75,8 +75,6 @@ void ActorExt::set_data(int* argc, char*** argv) (*argv)[(*argc) - 2] = nullptr; } (*argc) -= 2; - argc_ = argc; - argv_ = argv; // set the process attached to the mailbox mailbox_small_->set_receiver(actor_); XBT_DEBUG("<%ld> SMPI process has been initialized: %p", actor_->get_pid(), actor_.get()); diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 5e70fb2eb6..66a4be23ca 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -42,6 +42,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke #include #include /* trim_right / trim_left */ +#if SMPI_IFORT + extern "C" void for_rtl_init_ (int *, char **); +#elif SMPI_FLANG + extern "C" void __io_set_argc(int); + extern "C" void __io_set_argv(char **); +#elif SMPI_GFORTRAN + extern "C" void _gfortran_set_args(int, char **); +#endif + #ifndef RTLD_DEEPBIND /* RTLD_DEEPBIND is a bad idea of GNU ld that obviously does not exist on other platforms * See https://www.akkadia.org/drepper/dsohowto.pdf @@ -423,9 +432,15 @@ static int smpi_run_entry_point(smpi_entry_point_type entry_point, std::vector [rank 0] -> Tremblay +> [rank 1] -> Jupiter diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 57292dd749..24b8b0775f 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -94,6 +94,20 @@ if(enable_smpi) PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/simgrid) install(TARGETS smpimain # install that binary without breaking the rpath on Mac RUNTIME DESTINATION lib/simgrid) + + if(SMPI_FORTRAN) + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") + SET(SIMGRID_DEP "${SIMGRID_DEP} -lgfortran") + elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") + SET(SIMGRID_DEP "${SIMGRID_DEP} -lifcore") + elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI|Flang") + SET(SIMGRID_DEP "${SIMGRID_DEP} -lflang") + if("${CMAKE_SYSTEM}" MATCHES "FreeBSD") + set(SIMGRID_DEP "${SIMGRID_DEP} -lexecinfo") + endif() + endif() + endif() + endif() if(enable_smpi AND APPLE) diff --git a/tools/cmake/src/internal_config.h.in b/tools/cmake/src/internal_config.h.in index 8b25542733..934d648d58 100644 --- a/tools/cmake/src/internal_config.h.in +++ b/tools/cmake/src/internal_config.h.in @@ -73,8 +73,11 @@ /* SMPI variables */ /* SMPI enabled */ #cmakedefine01 HAVE_SMPI -/* Fortran language is available for SMPI */ +/* Fortran language is available for SMPI, and which one */ #cmakedefine01 SMPI_FORTRAN +#cmakedefine01 SMPI_GFORTRAN +#cmakedefine01 SMPI_FLANG +#cmakedefine01 SMPI_IFORT /* We have mmap and objdump to handle privatization */ #cmakedefine01 HAVE_PRIVATIZATION /* We have PAPI to fine-grain trace execution time */