{"id":1525,"date":"2015-12-22T17:07:48","date_gmt":"2015-12-22T22:07:48","guid":{"rendered":"http:\/\/jungwon.kim\/blog\/?p=1525"},"modified":"2018-01-09T10:08:30","modified_gmt":"2018-01-09T15:08:30","slug":"multithreading-mpi","status":"publish","type":"post","link":"https:\/\/blog.jungwon.kim\/?p=1525","title":{"rendered":"Multithreading MPI"},"content":{"rendered":"<p>Intel MPI<\/p>\n<p><strong>mpiicc thread_support.c -mt_mpi<\/strong><\/p>\n<p>MVAPICH2<\/p>\n<p><strong>mpirun_rsh \u00c2\u00a0-np 2 \u00e2\u20ac\u201cenv MV2_USE_CUDA=1\u00c2\u00a0<\/strong><strong>MV2_ENABLE_<wbr \/>AFFINITY=<\/strong><strong>0 \u00c2\u00a0.\/mpi app<\/strong><\/p>\n<p>Cary MPICH2<\/p>\n<p>Fine-grained Multi-threading Support<br \/>\nCray-MPICH now offers improved support for multi-threaded applications<br \/>\nthat perform MPI operations within threaded regions. Currently, this<br \/>\nfeature is available as a separate version of the Cray-MPICH library<br \/>\nthat is invoked by using a new compiler driver option, -craympich-mt.<\/p>\n<p>This feature requires CLE release 5.1 or higher, CrayPE version 2.2.0<br \/>\nor higher, and supports both C\/C++ and Fortran in the PrgEnv-cray,<br \/>\nPrgEnv-intel, PrgEnv-gnu, and PrgEnv-pgi programming environments.<\/p>\n<p>At this time, this library supports only MPI point-to-point<br \/>\noperations. Applications that perform collective, one-sided, or MPI-<br \/>\nI\/O operations within threaded regions will not see any benefits.<br \/>\nSingle-threaded applications, or applications that do not currently<br \/>\nperform MPI operations within threaded regions, should continue to use<br \/>\nthe default Cray-MPICH library. This feature does not alter the<br \/>\nthread-safety behavior of the default Cray-MPICH library.<\/p>\n<p>Support for larger subsets of MPI operations will be provided in<br \/>\nfuture releases.<\/p>\n<p>To use the fine-grained threading feature, follow these steps.<\/p>\n<p>Step 1. Compile a multi-threaded MPI application using the<br \/>\n-craympich-mt compiler driver option.<\/p>\n<p>If the code uses static linking:<\/p>\n<p>cc -craympich-mt -o mpi_mt_test.x mpi_mt_test.c<\/p>\n<p>If the code uses dynamic linking:<\/p>\n<p>cc -dynamic -craympich-mt -o mpi_mt_test.x mpi_mt_test.c<\/p>\n<p>Note: The -craympich-mt and -default64 compiler command line<br \/>\noptions are mutually exclusive. If both of these options are<br \/>\nspecified on a command line, the compiler will ignore the first<br \/>\none specified and use the second one.<\/p>\n<p>Step 2. Set the environment variables.<\/p>\n<p>export MPICH_MAX_THREAD_SAFETY=multiple<\/p>\n<p>export MPICH_VERSION_DISPLAY=1<\/p>\n<p>Step 3. Run the executable.<\/p>\n<p>aprun arguments .\/executable_name<\/p>\n<p>The MPICH_VERSION_DISPLAY environment variable is set in order to<br \/>\ndisplay the version string and verify that the desired library has<br \/>\nbeen used. The default threading library displays this version string:<\/p>\n<p>BUILD INFO : Built Date Time Year (svn rev rev) MT-G CPR-R<\/p>\n<p>Where MT-G corresponds to the default Multi-threaded MPI library with<br \/>\nglobal locks.<\/p>\n<p>The new fine-grained threading library displays this version string:<\/p>\n<p>BUILD INFO : Built Date Time Year (svn rev rev) MT-O CPR-R<\/p>\n<p>Where MT-O corresponds to the fine-grained Multi-threaded MPI library<br \/>\nwith per-object locks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Intel MPI mpiicc thread_support.c -mt_mpi MVAPICH2 mpirun_rsh \u00c2\u00a0-np 2 \u00e2\u20ac\u201cenv MV2_USE_CUDA=1\u00c2\u00a0MV2_ENABLE_AFFINITY=0 \u00c2\u00a0.\/mpi app Cary MPICH2 Fine-grained Multi-threading Support Cray-MPICH now offers improved support for multi-threaded applications that perform MPI operations within threaded regions. Currently, this feature is available as a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1525","post","type-post","status-publish","format-standard","hentry","category-cs"],"_links":{"self":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts\/1525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1525"}],"version-history":[{"count":1,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts\/1525\/revisions"}],"predecessor-version":[{"id":1800,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=\/wp\/v2\/posts\/1525\/revisions\/1800"}],"wp:attachment":[{"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jungwon.kim\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}