aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/MPIInitHelpers.H
blob: d0c2f8e1de6024b0167033cb0c488e7704309e0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Copyright 2020 Axel Huebl
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */
#ifndef WARPX_MPI_INIT_HELPERS_H_
#define WARPX_MPI_INIT_HELPERS_H_

#include <utility>

namespace utils
{
    /** Return the required MPI threading
     *
     * @return the MPI_THREAD_* level required for MPI_Init_thread
     */
    int
    warpx_mpi_thread_required ();

    /** Initialize MPI
     *
     * @return pair(required, provided) of MPI thread level from MPI_Init_thread
     */
    std::pair< int, int >
    warpx_mpi_init (int argc, char* argv[]);

    /** Check if the requested MPI thread level is valid
     *
     * Prints warnings and notes otherwise.
     */
    void
    warpx_check_mpi_thread_level ();

} // namespace utils

#endif // WARPX_MPI_INIT_HELPERS_H_