X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/edd8f5616a931d04369d7ec6fddb81793419d15b..00b2e701ab8ca3dd350bb8e9d65313986cabe8f0:/doc/doxygen/module-smpi.doc diff --git a/doc/doxygen/module-smpi.doc b/doc/doxygen/module-smpi.doc index aa82ab0c35..ede94c177d 100644 --- a/doc/doxygen/module-smpi.doc +++ b/doc/doxygen/module-smpi.doc @@ -4,8 +4,6 @@ @tableofcontents -[TOC] - SMPI enables the study of MPI application by emulating them on top of the SimGrid simulator. This is particularly interesting to study existing MPI applications within the comfort of the simulator. The @@ -34,6 +32,7 @@ requires some specific care from you. - @ref SMPI_use - @ref SMPI_use_compile - @ref SMPI_use_exec + - @ref SMPI_use_debug - @ref SMPI_use_colls - @ref SMPI_use_colls_algos - @ref SMPI_use_colls_tracing @@ -45,7 +44,9 @@ requires some specific care from you. - @ref SMPI_adapting_speed - @ref SMPI_accuracy - @ref SMPI_troubleshooting - - @ref SMPI_trouble_buildchain + - @ref SMPI_trouble_configure_refuses_smpicc + - @ref SMPI_trouble_configure_dont_find_smpicc + - @ref SMPI_trouble_useconds_t @section SMPI_use Using SMPI @@ -87,6 +88,21 @@ by running smpirun -help @endverbatim +@subsection SMPI_use_debug Debugging your code on top of SMPI + +If you want to explore the automatic platform and deployment files +that are generated by @c smpirun, add @c -keep-temps to the command +line. + +You can also run your simulation within valgrind or gdb using the +following commands. Once in GDB, each MPI ranks will be represented as +a regular thread, and you can explore the state of each of them as +usual. +@verbatim +smpirun -wrapper valgrind ...other args... +smpirun -wrapper "gdb --args" --cfg=contexts/factory:thread ...other args... +@endverbatim + @subsection SMPI_use_colls Simulating collective operations MPI collective operations are crucial to the performance of MPI @@ -150,7 +166,7 @@ Most of these are best described in mmap approach, SMPI duplicates and dynamically switch the \c .data and \c .bss segments of the ELF process when switching @@ -508,6 +524,8 @@ the exact same file several times, be it a library or a relocatable executable. It makes perfectly sense in the general case, but we need to circumvent this rule of thumb in our case. To that extend, the binary is copied in a temporary file before being re-linked against. +`dlmopen()` cannot be used as it only allows 256 contextes, and as it +would also dupplicate simgrid itself. This approach greatly speeds up the context switching, down to about 40 CPU cycles with our raw contextes, instead of requesting several @@ -522,7 +540,9 @@ href="https://lwn.net/Articles/415889/">punch holes in the files before dl-loading them to remove the code and constants, and mmap these area onto a unique copy. If done correctly, this would reduce the disk- and memory- usage to the bare minimum, and would also reduce -the pressure on the CPU instruction cache.\n +the pressure on the CPU instruction cache. See +the relevant +bug on github for implementation leads.\n Also, currently, only the binary is copied and dlopen-ed for each MPI rank. We could probably extend this to external dependencies, but for @@ -622,11 +642,10 @@ in modeling distributed systems. @section SMPI_troubleshooting Troubleshooting with SMPI -@subsection SMPI_trouble_buildchain My ./configure refuses to use smpicc +@subsection SMPI_trouble_configure_refuses_smpicc ./configure refuses to use smpicc -Alas, some building infrastructures cannot use smpicc as a project -compiler, and your ./configure may report that the compiler -is not functional. If this happens, define the +If your ./configure reports that the compiler is not +functional or that you are cross-compiling, try to define the SMPI_PRETEND_CC environment variable before running the configuration. @@ -635,12 +654,45 @@ SMPI_PRETEND_CC=1 ./configure # here come the configure parameters make @endverbatim +Indeed, the programs compiled with smpicc cannot be executed +without smpirun (they are shared libraries, and they do weird +things on startup), while configure wants to test them directly. +With SMPI_PRETEND_CC smpicc does not compile as shared, +and the SMPI initialization stops and returns 0 before doing anything +that would fail without smpirun. + \warning Make sure that SMPI_PRETEND_CC is only set when calling ./configure, - not during the actual compilation. With that variable, smpicc does - not do anything, to not hurt the ./configure feelings. But you need - smpicc do actually do something to get your application compiled. + not during the actual execution, or any program compiled with smpicc + will stop before starting. + +@subsection SMPI_trouble_configure_dont_find_smpicc ./configure does not pick smpicc as a compiler + +In addition to the previous answers, some projects also need to be +explicitely told what compiler to use, as follows: + +@verbatim +SMPI_PRETEND_CC=1 ./configure CC=smpicc # here come the other configure parameters +make +@endverbatim + +Maybe your configure is using another variable, such as cc or +similar. Just check the logs. + +@subsection SMPI_trouble_useconds_t error: unknown type name 'useconds_t' + +Try to add -D_GNU_SOURCE to your compilation line to get ride +of that error. + +The reason is that SMPI provides its own version of usleep(3) +to override it and to block in the simulation world, not in the real +one. It needs the useconds_t type for that, which is declared +only if you declare _GNU_SOURCE before including +unistd.h. If your project includes that header file before +SMPI, then you need to ensure that you pass the right configuration +defines as advised above. + */