PeriDEM
0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
testUtil.cpp
Go to the documentation of this file.
1
/*
2
* -------------------------------------------
3
* Copyright (c) 2021 - 2024 Prashant K. Jha
4
* -------------------------------------------
5
* PeriDEM https://github.com/prashjha/PeriDEM
6
*
7
* Distributed under the Boost Software License, Version 1.0. (See accompanying
8
* file LICENSE)
9
*/
10
11
#include "
testUtilLib.h
"
12
#include "
util/io.h
"
13
#include "
util/parallelUtil.h
"
// MPI-related functions
14
#include <fmt/format.h>
15
#include <iostream>
16
17
int
main
(
int
argc,
char
*argv[]) {
18
19
// init parallel
20
util::parallel::initMpi
(argc, argv);
21
int
mpiSize =
util::parallel::mpiSize
(), mpiRank =
util::parallel::mpiRank
();
22
util::io::print
(fmt::format(
"Initialized MPI. MPI size = {}, MPI rank = {}\n"
, mpiSize, mpiRank));
23
util::io::print
(
util::parallel::getMpiStatus
()->printStr());
24
25
test::testUtilMethods
();
26
return
EXIT_SUCCESS;
27
}
io.h
test::testUtilMethods
void testUtilMethods()
Test methods
Definition
testUtilLib.cpp:26
util::io::print
void print(const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
Prints formatted information.
Definition
io.h:108
util::parallel::getMpiStatus
const MpiStatus * getMpiStatus()
Returns pointer to MpiStatus struct.
Definition
parallelUtil.cpp:101
util::parallel::initMpi
void initMpi(int argc=0, char *argv[]=nullptr)
Initializes MPI and also creates MpiStatus struct.
Definition
parallelUtil.cpp:25
util::parallel::mpiSize
int mpiSize()
Get size (number) of processors.
Definition
parallelUtil.cpp:77
util::parallel::mpiRank
int mpiRank()
get rank (id) of this processor
Definition
parallelUtil.cpp:85
parallelUtil.h
main
int main()
Definition
testParticle.cpp:16
testUtilLib.h
test
test_exec
util
testUtil.cpp
Generated by
1.9.8