Canoe
Comprehensive Atmosphere N' Ocean Engine
message_traits.cpp
Go to the documentation of this file.
1 // C/C++
2 #include <functional>
3 #include <string>
4 
5 // athena++
6 #include <athena/athena.hpp>
7 #include <athena/bvals/bvals.hpp>
8 
9 // nbody
10 #include <nbody/particles.hpp>
11 
12 // harp
13 #include <harp/radiation_band.hpp>
14 
15 #ifdef MPI_PARALLEL
16 #include <mpi.h>
17 
18 MPI_Datatype MPI_PARTICLE_DATA;
19 MPI_Datatype MessageTraits<ParticleBase>::mpi_type = MPI_PARTICLE_DATA;
20 MPI_Datatype MessageTraits<RadiationBand>::mpi_type = MPI_ATHENA_REAL;
21 
22 #endif // MPI_PARALLEL
23 
24 namespace MessageHelper {
26 
27 int create_mpi_tag(int lid, int tid, std::string name) {
28  int tag = BoundaryBase::CreateBvalsMPITag(lid, tid, 0);
29 
30  std::string str = name + std::to_string(tag);
31  return std::hash<std::string>{}(str) % (mpi_tag_ub);
32 }
33 } // namespace MessageHelper
int create_mpi_tag(int lid, int tid, std::string name)
Traits class providing Message information for class T.