Peano
Loading...
Searching...
No Matches
parallel.cpp
Go to the documentation of this file.
1
#include "
parallel.h
"
2
3
#include "
tarch/Assertions.h
"
4
#include "
tarch/logging/Log.h
"
5
#include "
tarch/mpi/Rank.h
"
6
7
8
namespace
{
9
std::vector< std::string > classNamesForTaskType;
10
}
11
12
13
int
peano4::parallel::getTaskType
(
const
std::string& className) {
14
static
int
taskTypeCounter = -1;
15
taskTypeCounter++;
16
17
classNamesForTaskType.push_back( className );
18
19
#if PeanoDebug>0
20
std::cout <<
"assign task "
<< className <<
" id "
<< taskTypeCounter << std::endl;
21
#endif
22
23
return
taskTypeCounter;
24
}
25
26
27
std::string
peano4::parallel::getClassNameOfType
(
int
taskType) {
28
assertion
( taskType>=0 );
29
assertion
( taskType<classNamesForTaskType.size() );
30
return
classNamesForTaskType.at(taskType);
31
}
32
Assertions.h
assertion
#define assertion(expr)
Definition
Assertions.h:1017
Log.h
Rank.h
peano4::parallel::getClassNameOfType
std::string getClassNameOfType(int taskType)
Definition
parallel.cpp:27
peano4::parallel::getTaskType
int getTaskType(const std::string &className)
Get unique number (id) for task.
Definition
parallel.cpp:13
parallel.h
src
peano4
parallel
parallel.cpp
Generated on
for Peano by
1.14.0