{"id":13473595,"url":"https://github.com/pmodels/mpich","last_synced_at":"2026-04-07T17:01:02.970Z","repository":{"id":37601574,"uuid":"70918679","full_name":"pmodels/mpich","owner":"pmodels","description":"Official MPICH Repository","archived":false,"fork":false,"pushed_at":"2025-03-21T18:56:12.000Z","size":91972,"stargazers_count":594,"open_issues_count":259,"forks_count":291,"subscribers_count":42,"default_branch":"main","last_synced_at":"2025-03-24T16:42:45.643Z","etag":null,"topics":["c","fortran","hpc","mpi"],"latest_commit_sha":null,"homepage":"http://www.mpich.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmodels.png","metadata":{"files":{"readme":"README.vin","changelog":"CHANGES","contributing":"CONTRIBUTING","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-14T14:39:42.000Z","updated_at":"2025-03-21T18:56:17.000Z","dependencies_parsed_at":"2024-11-06T15:32:58.808Z","dependency_job_id":"93d12bd5-1598-4980-b9f3-4d2c95bf01d3","html_url":"https://github.com/pmodels/mpich","commit_stats":{"total_commits":17619,"total_committers":168,"mean_commits":104.875,"dds":0.8060048810942733,"last_synced_commit":"54232f22b36d6ace463ee63ba6f695af6a96da19"},"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmodels%2Fmpich","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmodels%2Fmpich/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmodels%2Fmpich/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmodels%2Fmpich/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmodels","download_url":"https://codeload.github.com/pmodels/mpich/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245722878,"owners_count":20661842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","fortran","hpc","mpi"],"created_at":"2024-07-31T16:01:05.154Z","updated_at":"2026-04-07T17:01:02.881Z","avatar_url":"https://github.com/pmodels.png","language":"C","readme":"\t\t\tMPICH Release %VERSION%\n\nMPICH is a high-performance and widely portable implementation of the\nMPI-4.1 standard from the Argonne National Laboratory.  This release\nhas all MPI 4.1 functions and features required by the standard with\nthe exception of support for user-defined data representations for I/O.\n\nThis README file should contain enough information to get you started\nwith MPICH. More extensive installation and user guides can be found in\nthe doc/installguide/install.pdf and doc/userguide/user.pdf files\nrespectively. Additional information regarding the contents of the\nrelease can be found in the CHANGES file in the top-level\ndirectory. Finally, see the official MPICH GitHub page,\nhttps://github.com/pmodels/mpich, for active development, bug tracking,\nand up-to-date release information.\n\n\n1.  Getting Started\n2.  Reporting Installation or Usage Problems\n3.  Compiler Flags\n4.  Alternate Channels and Devices\n5.  Alternate Process Managers\n6.  Alternate Configure Options\n7.  Testing the MPICH installation\n8.  Fault Tolerance\n9.  Developer Builds\n10. Multiple Fortran compiler support\n11. ABI Compatibility\n12. Capability Sets\n13. Threads\n\n\n-------------------------------------------------------------------------\n\n1. Getting Started\n==================\n\nNote: this guide assumes you are building MPICH from one of the MPICH\nrelease tarballs. If you are starting from a git checkout, you will need\na few additional steps. Please refer to the wiki page --\nhttps://github.com/pmodels/mpich/blob/main/doc/wiki/Index.md.\n\nThe following instructions take you through a sequence of steps to get\nthe default configuration (ch3 device, nemesis channel (with TCP and\nshared memory), Hydra process management) of MPICH up and running.\n\n(a) You will need the following prerequisites.\n\n    - REQUIRED: This tar file mpich-%VERSION%.tar.gz\n\n    - REQUIRED: Perl\n\n    - REQUIRED: A C compiler (C99 support is required. See\n      https://github.com/pmodels/mpich/blob/main/doc/wiki/source_code/Shifting_Toward_C99.md)\n\n    - OPTIONAL: A C++ compiler, if C++ applications are to be used\n      (g++, etc.). If you do not require support for C++ applications,\n      you can disable this support using the configure option\n      --disable-cxx (configuring MPICH is described in step 1(d)\n      below).\n\n    - OPTIONAL: A Fortran compiler, if Fortran applications are to be\n      used (gfortran, ifort, etc.). If you do not require support for\n      Fortran applications, you can disable this support using\n      --disable-fortran (configuring MPICH is described in step 1(d)\n      below).\n\n    - OPTIONAL: Python 3. Python 3 is needed to generate Fortran bindings.\n\n    Also, you need to know what shell you are using since different shell\n    has different command syntax. Command \"echo $SHELL\" prints out the\n    current shell used by your terminal program.\n\n(b) Unpack the tar file and go to the top level directory:\n\n      tar xzf mpich-%VERSION%.tar.gz\n      cd mpich-%VERSION%\n\n    If your tar doesn't accept the z option, use\n\n      gunzip mpich-%VERSION%.tar.gz\n      tar xf mpich-%VERSION%.tar\n      cd mpich-%VERSION%\n\n(c) Choose an installation directory, say\n    /home/\u003cUSERNAME\u003e/mpich-install, which is assumed to non-existent\n    or empty. It will be most convenient if this directory is shared\n    by all of the machines where you intend to run processes. If not,\n    you will have to duplicate it on the other machines after\n    installation.\n\n(d) Configure MPICH specifying the installation directory and device:\n\n    for csh and tcsh:\n\n      ./configure --prefix=/home/\u003cUSERNAME\u003e/mpich-install |\u0026 tee c.txt\n\n    for bash and sh:\n\n      ./configure --prefix=/home/\u003cUSERNAME\u003e/mpich-install 2\u003e\u00261 | tee c.txt\n\n    The configure will try to determine the best device (the internal\n    network modules) based on system environment. You may also supply\n    a device configuration. E.g.\n\n      ./configure --prefix=... --with-device=ch4:ofi |...\n\n    or:\n\n      ./configure --prefix=... --with-device=ch4:ucx |...\n\n    Refer to section below -- Alternate Channels and Devices -- for\n    more details.\n\n    Bourne-like shells, sh and bash, accept \"2\u003e\u00261 |\".  Csh-like shell,\n    csh and tcsh, accept \"|\u0026\". If a failure occurs, the configure\n    command will display the error. Most errors are straight-forward\n    to follow. For example, if the configure command fails with:\n\n       \"No Fortran compiler found. If you don't need to build any\n        Fortran programs, you can disable Fortran support using\n        --disable-fortran. If you do want to build Fortran programs,\n        you need to install a Fortran compiler such as gfortran or\n        ifort before you can proceed.\"\n\n    ... it means that you don't have a Fortran compiler :-). You will\n    need to either install one, or disable Fortran support in MPICH.\n\n    If you are unable to understand what went wrong, please go to step\n    (2) below, for reporting the issue to the MPICH developers and\n    other users.\n\n(e) Build MPICH:\n\n    for csh and tcsh:\n\n      make |\u0026 tee m.txt\n\n    for bash and sh:\n\n      make 2\u003e\u00261 | tee m.txt\n\n    This step should succeed if there were no problems with the\n    preceding step. Check file m.txt. If there were problems, do a\n    \"make clean\" and then run make again with V=1.\n\n      make V=1 |\u0026 tee m.txt       (for csh and tcsh)\n\n      OR\n\n      make V=1 2\u003e\u00261 | tee m.txt   (for bash and sh)\n\n    Then go to step (2) below, for reporting the issue to the MPICH\n    developers and other users.\n\n(f) Install the MPICH commands:\n\n    for csh and tcsh:\n\n      make install |\u0026 tee mi.txt\n\n    for bash and sh:\n\n      make install 2\u003e\u00261 | tee mi.txt\n\n    This step collects all required executables and scripts in the bin\n    subdirectory of the directory specified by the prefix argument to\n    configure.\n\n(g) Add the bin subdirectory of the installation directory to your\n    path in your startup script (.bashrc for bash, .cshrc for csh,\n    etc.):\n\n    for csh and tcsh:\n\n      setenv PATH /home/\u003cUSERNAME\u003e/mpich-install/bin:$PATH\n\n    for bash and sh:\n  \n      PATH=/home/\u003cUSERNAME\u003e/mpich-install/bin:$PATH ; export PATH\n\n    Check that everything is in order at this point by doing:\n\n      which mpicc\n      which mpiexec\n\n    These commands should display the path to your bin subdirectory of\n    your install directory.\n\n    IMPORTANT NOTE: The install directory has to be visible at exactly\n    the same path on all machines you want to run your applications\n    on. This is typically achieved by installing MPICH on a shared\n    NFS file-system. If you do not have a shared NFS directory, you\n    will need to manually copy the install directory to all machines\n    at exactly the same location.\n\n(h) MPICH uses a process manager for starting MPI applications. The\n    process manager provides the \"mpiexec\" executable, together with\n    other utility executables. MPICH comes packaged with multiple\n    process managers; the default is called Hydra.\n\n    Now we will run an MPI job, using the mpiexec command as specified\n    in the MPI standard. There are some examples in the install\n    directory, which you have already put in your path, as well as in\n    the directory mpich-%VERSION%/examples. One of them is the classic\n    CPI example, which computes the value of pi by numerical\n    integration in parallel.\n\n    To run the CPI example with 'n' processes on your local machine,\n    you can use:\n\n      mpiexec -n \u003cnumber\u003e ./examples/cpi\n\n    Test that you can run an 'n' process CPI job on multiple nodes:\n\n      mpiexec -f machinefile -n \u003cnumber\u003e ./examples/cpi\n\n    The 'machinefile' is of the form:\n\n      host1\n      host2:2\n      host3:4   # Random comments\n      host4:1\n\n    'host1', 'host2', 'host3' and 'host4' are the hostnames of the\n    machines you want to run the job on. The ':2', ':4', ':1' segments\n    depict the number of processes you want to run on each node. If\n    nothing is specified, ':1' is assumed.\n\n    More details on interacting with Hydra can be found at\n    https://github.com/pmodels/mpich/blob/main/doc/wiki/how_to/Using_the_Hydra_Process_Manager.md\n\nIf you have completed all of the above steps, you have successfully\ninstalled MPICH and run an MPI example.\n\n-------------------------------------------------------------------------\n\n2. Reporting Installation or Usage Problems\n===========================================\n\n[VERY IMPORTANT: PLEASE COMPRESS ALL FILES BEFORE SENDING THEM TO\nUS. DO NOT SPAM THE MAILING LIST WITH LARGE ATTACHMENTS.]\n\nThe distribution has been tested by us on a variety of machines in our\nenvironments as well as our partner institutes. If you have problems\nwith the installation or usage of MPICH, please follow these steps:\n\n1. First see the Frequently Asked Questions (FAQ) page at\nhttps://github.com/pmodels/mpich/blob/main/doc/wiki/faq/Frequently_Asked_Questions.md\nto see if the problem you are facing has a simple solution. Many common\nproblems and their solutions are listed here.\n\n2. If you cannot find an answer on the FAQ page, look through previous\nemail threads on the discuss@mpich.org mailing list archive\n(https://lists.mpich.org/mailman/listinfo/discuss). It is likely\nsomeone else had a similar problem, which has already been resolved\nbefore.\n\n3. If neither of the above steps work, please send an email to\ndiscuss@mpich.org. You need to subscribe to this list\n(https://lists.mpich.org/mailman/listinfo/discuss) before sending an\nemail.\n\nYour email should contain the following files.  ONCE AGAIN, PLEASE\nCOMPRESS BEFORE SENDING, AS THE FILES CAN BE LARGE.  Note that,\ndepending on which step the build failed, some of the files might not\nexist.\n\n    mpich-%VERSION%/c.txt (generated in step 1(d) above)\n    mpich-%VERSION%/m.txt (generated in step 1(e) above)\n    mpich-%VERSION%/mi.txt (generated in step 1(f) above)\n    mpich-%VERSION%/config.log (generated in step 1(d) above)\n    mpich-%VERSION%/src/mpl/config.log (generated in step 1(d) above)\n    mpich-%VERSION%/src/pm/hydra/config.log (generated in step 1(d) above)\n\n    DID WE MENTION? DO NOT FORGET TO COMPRESS THESE FILES!\n\nIf you have compiled MPICH and are having trouble running an\napplication, please provide the output of the following command in\nyour email.\n\n    mpiexec -info\n\nFinally, please include the actual error you are seeing when running\nthe application, including the mpiexec command used, and the host\nfile. If possible, please try to reproduce the error with a smaller\napplication or benchmark and send that along in your bug report.\n\n4. If you have found a bug in MPICH, you can report it on our Github\npage (https://github.com/pmodels/mpich/issues).\n\n\n-------------------------------------------------------------------------\n\n3. Compiler Flags\n=================\n\nMPICH allows several sets of compiler flags to be used. The first\nthree sets are configure-time options for MPICH, while the fourth is\nonly relevant when compiling applications with mpicc and friends.\n\n(a) CFLAGS, CPPFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS and LIBS\n(abbreviated as xFLAGS): Setting these flags would result in the\nMPICH library being compiled/linked with these flags and the flags\ninternally being used in mpicc and friends.\n\n(b) MPICHLIB_CFLAGS, MPICHLIB_CPPFLAGS, MPICHLIB_CXXFLAGS,\nMPICHLIB_FFLAGS, MPICHLIB_FCFLAGS, MPICHLIB_LDFLAGS and\nMPICHLIB_LIBS (abbreviated as MPICHLIB_xFLAGS): Setting these flags\nwould result in the MPICH library being compiled/linked with these\nflags. However, these flags will *not* be used by mpicc and friends.\n\n(c) MPICH_MPICC_CFLAGS, MPICH_MPICC_CPPFLAGS, MPICH_MPICC_LDFLAGS,\nMPICH_MPICC_LIBS, and so on for MPICXX, MPIF77 and MPIFORT\n(abbreviated as MPICH_MPIX_FLAGS): These flags do *not* affect the\ncompilation of the MPICH library itself, but will be internally used\nby mpicc and friends.\n\n\n  +--------------------------------------------------------------------+\n  |                    |                      |                        |\n  |                    |    MPICH library     |    mpicc and friends   |\n  |                    |                      |                        |\n  +--------------------+----------------------+------------------------+\n  |                    |                      |                        |\n  |     xFLAGS         |         Yes          |           Yes          |\n  |                    |                      |                        |\n  +--------------------+----------------------+------------------------+\n  |                    |                      |                        |\n  |  MPICHLIB_xFLAGS   |         Yes          |           No           |\n  |                    |                      |                        |\n  +--------------------+----------------------+------------------------+\n  |                    |                      |                        |\n  | MPICH_MPIX_FLAGS   |         No           |           Yes          |\n  |                    |                      |                        |\n  +--------------------+----------------------+------------------------+\n\n\nAll these flags can be set as part of configure command or through\nenvironment variables.\n\n\nDefault flags\n--------------\nBy default, MPICH automatically adds certain compiler optimizations\nto MPICHLIB_CFLAGS. The currently used optimization level is -O2.\n\n** IMPORTANT NOTE: Remember that this only affects the compilation of\nthe MPICH library and is not used in the wrappers (mpicc and friends)\nthat are used to compile your applications or other libraries.\n\nThis optimization level can be changed with the --enable-fast option\npassed to configure. For example, to build an MPICH environment with\n-O3 for all language bindings, one can simply do:\n\n  ./configure --enable-fast=O3\n\nOr to disable all compiler optimizations, one can do:\n\n  ./configure --disable-fast\n\nFor more details of --enable-fast, see the output of \"configure\n--help\".\n\nFor performance testing, we recommend the following flags:\n\n  ./configure --enable-fast=O3,ndebug --disable-error-checking --without-timing \\\n              --without-mpit-pvars\n\n\nExamples\n--------\n\nExample 1:\n\n  ./configure --disable-fast MPICHLIB_CFLAGS=-O3 MPICHLIB_FFLAGS=-O3 \\\n        MPICHLIB_CXXFLAGS=-O3 MPICHLIB_FCFLAGS=-O3\n\nThis will cause the MPICH libraries to be built with -O3, and -O3\nwill *not* be included in the mpicc and other MPI wrapper script.\n\nExample 2:\n\n  ./configure --disable-fast CFLAGS=-O3 FFLAGS=-O3 CXXFLAGS=-O3 FCFLAGS=-O3\n\nThis will cause the MPICH libraries to be built with -O3, and -O3\nwill be included in the mpicc and other MPI wrapper script.\n\n-------------------------------------------------------------------------\n\n4. Alternate Channels and Devices\n=================================\n\nThe communication mechanisms in MPICH are called \"devices\". MPICH\nsupports ch3 and ch4 (default), as well as many\nthird-party devices that are released and maintained by other\ninstitutes.\n\n                   *************************************\n\nch3 device\n**********\nThe ch3 device contains different internal communication options\ncalled \"channels\". We currently support nemesis (default) and sock\nchannels.\n\nnemesis channel\n---------------\nNemesis provides communication using different networks (tcp, mx) as\nwell as various shared-memory optimizations. To configure MPICH with\nnemesis, you can use the following configure option:\n\n  --with-device=ch3:nemesis\n\nShared-memory optimizations are enabled by default to improve\nperformance for multi-processor/multi-core platforms. They can be\ndisabled (at the cost of performance) either by setting the\nenvironment variable MPICH_NO_LOCAL to 1, or using the following\nconfigure option:\n\n  --enable-nemesis-dbg-nolocal\n\nThe --with-shared-memory= configure option allows you to choose how\nNemesis allocates shared memory.  The options are \"auto\", \"sysv\", and\n\"mmap\".  Using \"sysv\" will allocate shared memory using the System V\nshmget(), shmat(), etc. functions.  Using \"mmap\" will allocate shared\nmemory by creating a file (in /dev/shm if it exists, otherwise /tmp),\nthen mmap() the file.  The default is \"auto\". Note that System V\nshared memory has limits on the size of shared memory segments so\nusing this for Nemesis may limit the number of processes that can be\nstarted on a single node.\n\nofi network module\n```````````````````\nThe ofi netmod provides support for the OFI network programming interface.\nTo enable, configure with the following option:\n\n  --with-device=ch3:nemesis:ofi\n\nIf the OFI include files and libraries are not in the normal search paths,\nyou can specify them with the following options:\n\n  --with-ofi-include= and --with-ofi-lib=\n\n... or the if lib/ and include/ are in the same directory, you can use\nthe following option:\n\n  --with-ofi=\n\nIf the OFI libraries are shared libraries, they need to be in the\nshared library search path. This can be done by adding the path to\n/etc/ld.so.conf, or by setting the LD_LIBRARY_PATH variable in your\nenvironment. It's also possible to set the shared library search path\nin the binary. If you're using gcc, you can do this by adding\n\n  LD_LIBRARY_PATH=/path/to/lib\n\n  (and)\n\n  LDFLAGS=\"-Wl,-rpath -Wl,/path/to/lib\"\n\n... as arguments to configure.\n\n\nsock channel\n------------\nsock is the traditional TCP sockets based communication channel. It\nuses TCP/IP sockets for all communication including intra-node\ncommunication. So, though the performance of this channel is worse\nthan that of nemesis, it should work on almost every platform. This\nchannel can be configured using the following option:\n\n  --with-device=ch3:sock\n\n\nch4 device\n**********\nThe ch4 device contains different network and shared memory modules\nfor communication. We currently support the ofi and ucx network\nmodules, and posix shared memory module.\n\nofi network module\n```````````````````\nThe ofi netmod provides support for the OFI network programming interface.\nTo enable, configure with the following option:\n\n  --with-device=ch4:ofi[:provider]\n\nIf the OFI include files and libraries are not in the normal search paths,\nyou can specify them with the following options:\n\n  --with-libfabric-include= and --with-libfabric-lib=\n\n... or the if lib/ and include/ are in the same directory, you can use\nthe following option:\n\n  --with-libfabric=\n\nIf specifying the provider, the MPICH library will be optimized specifically\nfor the requested provider by removing runtime branches to determine\nprovider capabilities. Note that using this feature with a version of the\nlibfabric library older than that recommended with this version of MPICH is\nunsupported and may result in unexpected behavior. This is also true when\nusing the environment variable FI_PROVIDER.\n\nThe currently expected version of libfabric is: %LIBFABRIC_VERSION%.\n\nucx network module\n``````````````````\nThe ucx netmod provides support for the Unified Communication X\nlibrary. It can be built with the following configure option:\n\n  --with-device=ch4:ucx\n\nIf the UCX include files and libraries are not in the normal search paths,\nyou can specify them with the following options:\n\n  --with-ucx-include= and --with-ucx-lib=\n\n... or the if lib/ and include/ are in the same directory, you can use\nthe following option:\n\n  --with-ucx=\n\nBy default, the UCX library throws warnings when the system does not\nenable certain features that might hurt performance.  These are\nimportant warnings that might cause performance degradation on your\nsystem.  But you might need root privileges to fix some of them.  If\nyou would like to disable such warnings, you can set the UCX log level\nto \"error\" instead of the default \"warn\" by using:\n\n  UCX_LOG_LEVEL=error\n  export UCX_LOG_LEVEL\n\nGPU support\n***********\n\nGPU support is automatically enabled if CUDA, ZE, or HIP runtime is\ndetected during configure. To specify where your GPU runtime is\ninstalled, use:\n\n  --with-cuda=\u003cpath\u003e  or --with-ze=\u003cpath\u003e or --with-hip=\u003cpath\u003e\n\nIf the lib/ and include/ are not in the same path, both can be specified\nseparately, for example:\n\n  --with-cuda-include= and --with-cuda-lib=\n\nIn addition, GPU support can be explicitly disabled by using:\n\n  --without-cuda  or  --without-ze or --without-hip\n\nIf desirable, GPU support can be disabled during runtime by setting\nenvironment variable MPIR_CVAR_ENABLE_GPU=0. This may help avoid the GPU\ninitialization and detection overhead for non-GPU applications.\n\n-------------------------------------------------------------------------\n\n5. Alternate Process Managers\n=============================\n\nhydra\n-----\nHydra is the default process management framework that uses existing\ndaemons on nodes (e.g., ssh, pbs, slurm, sge) to start MPI\nprocesses. More information on Hydra can be found at\nhttps://github.com/pmodels/mpich/blob/main/doc/wiki/how_to/Using_the_Hydra_Process_Manager.md\n\ngforker\n-------\ngforker is a process manager that creates processes on a single\nmachine, by having mpiexec directly fork and exec them. gforker is\nmostly meant as a research platform and for debugging purposes, as it\nis only meant for single-node systems.\n\nslurm\n-----\nSlurm is an external process manager not distributed with\nMPICH. MPICH's default process manager, hydra, has native support\nfor Slurm and you can directly use it in Slurm environments (it will\nautomatically detect Slurm and use Slurm capabilities). However, if\nyou want to use the Slurm-provided \"srun\" process manager, you can use\nthe \"--with-pmi=slurm --with-pm=no\" option with configure. Note that\nthe \"srun\" process manager that comes with Slurm uses an older PMI\nstandard which does not have some of the performance enhancements that\nhydra provides in Slurm environments.\n\n-------------------------------------------------------------------------\n\n6. Alternate Configure Options\n==============================\n\nMPICH has a number of other features. If you are exploring MPICH as\npart of a development project, you might want to tweak the MPICH\nbuild with the following configure options. A complete list of\nconfiguration options can be found using:\n\n   ./configure --help\n\n-------------------------------------------------------------------------\n\n7. Testing the MPICH installation\n==================================\n\nTo test MPICH, we package the MPICH test suite in the MPICH\ndistribution. You can run the test suite after \"make install\" using:\n\n     make testing\n\nThe results summary will be placed in test/summary.xml.\n\nThe test suite can be used independently to test any installed MPI\nimplementations:\n\n     cd test/mpi\n     ./configure --with-mpi=/path/to/mpi\n     make testing\n\n-------------------------------------------------------------------------\n\n8. Fault Tolerance\n==================\n\nMPICH has some tolerance to process failures, and supports\ncheckpointing and restart. \n\nTolerance to Process Failures\n-----------------------------\n\nThe features described in this section should be considered\nexperimental.  Which means that they have not been fully tested, and\nthe behavior may change in future releases. The below notes are some\nguidelines on what can be expected in this feature:\n\n - ERROR RETURNS: Communication failures in MPICH are not fatal\n   errors.  This means that if the user sets the error handler to\n   MPI_ERRORS_RETURN, MPICH will return an appropriate error code in\n   the event of a communication failure.  When a process detects a\n   failure when communicating with another process, it will consider\n   the other process as having failed and will no longer attempt to\n   communicate with that process.  The user can, however, continue\n   making communication calls to other processes.  Any outstanding\n   send or receive operations to a failed process, or wildcard\n   receives (i.e., with MPI_ANY_SOURCE) posted to communicators with a\n   failed process, will be immediately completed with an appropriate\n   error code.\n\n - COLLECTIVES: For collective operations performed on communicators\n   with a failed process, the collective would return an error on\n   some, but not necessarily all processes. A collective call\n   returning MPI_SUCCESS on a given process means that the part of the\n   collective performed by that process has been successful.\n\n - PROCESS MANAGER: If used with the hydra process manager, hydra will\n   detect failed processes and notify the MPICH library.  Users can\n   query the list of failed processes using MPIX_Comm_group_failed().\n   This functions returns a group consisting of the failed processes\n   in the communicator.  The function MPIX_Comm_remote_group_failed()\n   is provided for querying failed processes in the remote processes\n   of an intercommunicator.\n\n   Note that hydra by default will abort the entire application when\n   any process terminates before calling MPI_Finalize.  In order to\n   allow an application to continue running despite failed processes,\n   you will need to pass the -disable-auto-cleanup option to mpiexec.\n\n - FAILURE NOTIFICATION: THIS IS AN UNSUPPORTED FEATURE AND WILL\n   ALMOST CERTAINLY CHANGE IN THE FUTURE!\n\n   In the current release, hydra notifies the MPICH library of failed\n   processes by sending a SIGUSR1 signal.  The application can catch\n   this signal to be notified of failed processes.  If the application\n   replaces the library's signal handler with its own, the application\n   must be sure to call the library's handler from it's own\n   handler.  Note that you cannot call any MPI function from inside a\n   signal handler.\n\nCheckpoint and Restart\n----------------------\n\nMPICH supports checkpointing and restart fault-tolerance using BLCR.\n\nCONFIGURATION\n\nFirst, you need to have BLCR version 0.8.2 or later installed on your\nmachine.  If it's installed in the default system location, you don't\nneed to do anything.\n\nIf BLCR is not installed in the default system location, you'll need\nto tell MPICH's configure where to find it. You might also need to\nset the LD_LIBRARY_PATH environment variable so that BLCR's shared\nlibraries can be found.  In this case add the following options to\nyour configure command:\n\n  --with-blcr=\u003cBLCR_INSTALL_DIR\u003e \n  LD_LIBRARY_PATH=\u003cBLCR_INSTALL_DIR\u003e/lib\n\nwhere \u003cBLCR_INSTALL_DIR\u003e is the directory where BLCR has been\ninstalled (whatever was specified in --prefix when BLCR was\nconfigured).\n\nAfter it's configured compile as usual (e.g., make; make install).\n\nNote, checkpointing is only supported with the Hydra process manager.\n\n\nVERIFYING CHECKPOINTING SUPPORT\n\nMake sure MPICH is correctly configured with BLCR. You can do this\nusing:\n\n  mpiexec -info\n\nThis should display 'BLCR' under 'Checkpointing libraries available'.\n\n\nCHECKPOINTING THE APPLICATION\n\nThere are two ways to cause the application to checkpoint. You can ask\nmpiexec to periodically checkpoint the application using the mpiexec\noption -ckpoint-interval (seconds):\n\n  mpiexec -ckpointlib blcr -ckpoint-prefix /tmp/app.ckpoint \\\n      -ckpoint-interval 3600 -f hosts -n 4 ./app\n\nAlternatively, you can also manually force checkpointing by sending a\nSIGUSR1 signal to mpiexec.\n\nThe checkpoint/restart parameters can also be controlled with the\nenvironment variables HYDRA_CKPOINTLIB, HYDRA_CKPOINT_PREFIX and\nHYDRA_CKPOINT_INTERVAL.\n\nTo restart a process:\n\n  mpiexec -ckpointlib blcr -ckpoint-prefix /tmp/app.ckpoint -f hosts -n 4 -ckpoint-num \u003cN\u003e\n\nwhere \u003cN\u003e is the checkpoint number you want to restart from.\n\nThese instructions can also be found on the MPICH wiki:\n\n  https://github.com/pmodels/mpich/blob/main/doc/wiki/design/Checkpointing.md\n\n-------------------------------------------------------------------------\n\n9. Developer Builds\n===================\nFor MPICH developers who want to directly work on the primary version\ncontrol system, there are a few additional steps involved (people\nusing the release tarballs do not have to follow these steps). Details\nabout these steps can be found here:\nhttps://github.com/pmodels/mpich/blob/main/doc/wiki/source_code/Github.md\n\n-------------------------------------------------------------------------\n\n10. Multiple Fortran compiler support\n=====================================\n\nIf the C compiler that is used to build MPICH libraries supports both\nmultiple weak symbols and multiple aliases of common symbols, the\nFortran binding can support multiple Fortran compilers. The\nmultiple weak symbols support allow MPICH to provide different name\nmangling scheme (of subroutine names) required by different Fortran\ncompilers. The multiple aliases of common symbols support enables\nMPICH to equal different common block symbols of the MPI Fortran\nconstant, e.g. MPI_IN_PLACE, MPI_STATUS_IGNORE. So they are understood\nby different Fortran compilers.\n\nSince the support of multiple aliases of common symbols is\nnew/experimental, users can disable the feature by using configure\noption --disable-multi-aliases if it causes any undesirable effect,\ne.g. linker warnings of different sizes of common symbols, MPIFCMB*\n(the warning should be harmless).\n\nWe have only tested this support on a limited set of\nplatforms/compilers.  On linux, if the C compiler that builds MPICH is\neither gcc or icc, the above support will be enabled by configure.  At\nthe time of this writing, pgcc does not seem to have this multiple\naliases of common symbols, so configure will detect the deficiency and\ndisable the feature automatically.  The tested Fortran compilers\ninclude GNU Fortran compilers (gfortan), Intel Fortran compiler\n(ifort), Portland Group Fortran compilers (pgfortran), Absoft Fortran\ncompilers (af90), and IBM XL fortran compiler (xlf).  What this means\nis that if mpich is built by gcc/gfortran, the resulting mpich library\ncan be used to link a Fortran program compiled/linked by another\nfortran compiler, say pgf90, say through mpifort -fc=pgf90.  As long\nas the Fortran program is linked without any errors by one of these\ncompilers, the program shall be running fine.\n\n-------------------------------------------------------------------------\n\n11. ABI Compatibility\n=====================\n\nThe MPICH ABI compatibility initiative was announced at SC 2014\n(http://www.mpich.org/abi).  As a part of this initiative, Argonne,\nIntel, IBM and Cray have committed to maintaining ABI compatibility\nwith each other.\n\nAs a first step in this initiative, starting with version 3.1, MPICH\nis binary (ABI) compatible with Intel MPI 5.0.  This means you can\nbuild your program with one MPI implementation and run with the other.\nSpecifically, binary-only applications that were built and distributed\nwith one of these MPI implementations can now be executed with the\nother MPI implementation.\n\nSome setup is required to achieve this.  Suppose you have MPICH\ninstalled in /path/to/mpich and Intel MPI installed in /path/to/impi.\n\nYou can run your application with mpich using:\n\n   % export LD_LIBRARY_PATH=/path/to/mpich/lib:$LD_LIBRARY_PATH\n   % mpiexec -np 100 ./foo\n\nor using Intel MPI using:\n\n   % export LD_LIBRARY_PATH=/path/to/impi/lib:$LD_LIBRARY_PATH\n   % mpiexec -np 100 ./foo\n\nThis works irrespective of which MPI implementation your application\nwas compiled with, as long as you use one of the MPI implementations\nin the ABI compatibility initiative.\n\n-------------------------------------------------------------------------\n\n12. Capability Sets\n=====================\n\nThe CH4 device contains a feature called \"capability sets\" to simplify\nconfiguration of MPICH on systems using the OFI netmod. This feature\nconfigures MPICH to use a predetermined set of OFI features based on the\nprovider being used. Capability sets can be configured at compile time or\nruntime. Compile time configuration provides better performance by\nreducing unnecessary code branches, but at the cost of flexibility.\n\nTo configure at compile time, the device string should be amended to include\nthe OFI provider with the following option:\n\n    --with-device=ch4:ofi:sockets\n\nThis will setup the OFI netmod to use the optimal configuration for the\nsockets provider, and will set various compile time constants. These settings\ncannot be changed at runtime.\n\nIf runtime configuration is needed, use:\n\n    --with-device=ch4:ofi\n\ni.e. without the OFI provider extension, and set various environment variables to\nachieve a similar configuration. To select the desired provider:\n\n    % export FI_PROVIDER=sockets\n\nThis will select the OFI provider and the associated MPICH capability set. To\nchange the preset configuration, there exists an extended set of environment\nvariables. As an example, native provider RMA atomics can be disabled by using\nthe environment variable:\n\n    % export MPIR_CVAR_CH4_OFI_ENABLE_ATOMICS=0\n\nFor some configuration options (in particular, MPIR_CVAR_CH4_OFI_ENABLE_TAGGED and\nMPIR_CVAR_CH4_OFI_ENABLE_RMA), if disabled, some functionality may fallback to\ngeneric implementations.\n\nA full list of capability set configuration variables can be found in the\nenvironment variables README.envvar.\n\n-------------------------------------------------------------------------\n\n13. Threads\n===========\n\nThe supported thread level are configured by option:\n\n    --enable-threads={single,funneled,serialized,multiple}\n\nThe default depends on the configured device. With ch4, \"multiple\" is the\ndefault. Set thread level to \"single\" provides best performance when application\ndoes not use multiple threads. Use \"multiple\" to allow application to access\nMPI from multiple threads concurrently.\n\nWith \"multiple\" thread level, there are a few choices for the internal critical\nsection models. This is controlled by configure option:\n\n    --enable-thread-cs={global,per-vci}\n\nCurrent default is to use \"global\" cs. Applications that do heavy concurrent\nMPI communications may experience slow down due to this global cs. The\n\"per-vci\" cs internally will use multiple VCI (virtual communication\ninterface) critical sections, thus can provide much better performance. To\nachieve the best performance, applications should try to expose as much\nparallel information to MPI as possible. For example, if each threads use\nseparate communicators, MPICH may be able to assign separate VCI for each\nthread, thus achieving the maximum performance.\n\nThe multiple VCI support may increase the resource allocation and overheads\nduring initialization. By default, only a single vci is used. Set\n\n    MPIR_CVAR_CH4_NUM_VCIS=\u003cN\u003e\n\nto enable multiple vcis at runtime. For best performance, match number of VCIs\nto the number threads application is using.\n\nMPICH supports multiple threading packages.  The default is posix\nthreads (pthreads), but solaris threads, windows threads, argobots and\nqthreads are also supported.\n\nTo configure mpich to work with argobots or qthreads, use the\nfollowing configure options:\n\n    --with-thread-package=argobots \\\n        CFLAGS=\"-I\u003cpath_to_argobots/include\u003e\" \\\n        LDFLAGS=\"-L\u003cpath_to_argobots/lib\u003e\"\n\n    --with-thread-package=qthreads \\\n        CFLAGS=\"-I\u003cpath_to_qthreads/include\u003e\" \\\n        LDFLAGS=\"-L\u003cpath_to_qthreads/lib\u003e\"\n\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmodels%2Fmpich","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmodels%2Fmpich","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmodels%2Fmpich/lists"}