MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
globalmpiinfo.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#include "globalmpiinfo.h"
8#include "mpioverride.h"
9
11
12
14void printMpiInfo(MPI_Info& mpiInfo) {
15 MInt i, nkeys;
16
17 MPI_Info_get_nkeys(mpiInfo, &nkeys, AT_);
18 std::cerr << "MPI Info: nkeys = " << nkeys << std::endl;
19 for(i = 0; i < nkeys; i++) {
20 char key[MPI_MAX_INFO_KEY], value[MPI_MAX_INFO_VAL];
21 MInt valuelen, flag;
22
23 MPI_Info_get_nthkey(mpiInfo, i, key, AT_);
24 MPI_Info_get_valuelen(mpiInfo, key, &valuelen, &flag, AT_);
25 MPI_Info_get(mpiInfo, key, valuelen + 1, value, &flag, AT_);
26 std::cerr << "MPI Info: [" << i << "] key = " << key << ", value = " << value << std::endl;
27 }
28}
Class to store global MPI information and to prevent accidental changes.
Definition: globalmpiinfo.h:22
void printMpiInfo(MPI_Info &mpiInfo)
Print all information of the given MPI_Info object.
GlobalMpiInformation g_mpiInformation
int32_t MInt
Definition: maiatypes.h:62
int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value, int *flag, const MString &name)
same as MPI_Info_get
int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag, const MString &name)
same as MPI_Info_get_valuelen
int MPI_Info_get_nthkey(MPI_Info info, int n, char *key, const MString &name)
same as MPI_Info_get_nthkey
int MPI_Info_get_nkeys(MPI_Info info, int *nkeys, const MString &name)
same as MPI_Info_get_nkeys