22namespace shamsys::mpidtypehandler {
24 using fct_sig = std::function<void()>;
26 inline std::vector<fct_sig> static_init_shamrock_mpidtype{};
27 inline std::vector<fct_sig> static_free_shamrock_mpidtype{};
29 inline std::vector<std::string> static_init_shamrock_mpidtype_names{};
30 inline std::vector<std::string> static_free_shamrock_mpidtype_names{};
32 inline void init_mpidtype() {
33 for (
u32 i = 0; i < static_init_shamrock_mpidtype.size(); i++) {
34 auto fct = static_init_shamrock_mpidtype[i];
35 auto name = static_init_shamrock_mpidtype_names[i];
36 shamlog_debug_mpi_ln(
"MpiDTypehandler",
"initialising type :", name);
41 inline void free_mpidtype() {
42 for (
u32 i = 0; i < static_free_shamrock_mpidtype.size(); i++) {
43 auto fct = static_free_shamrock_mpidtype[i];
44 auto name = static_free_shamrock_mpidtype_names[i];
45 shamlog_debug_mpi_ln(
"MpiDTypehandler",
"freeing type :", name);
51 inline explicit MPIDTypeinit(fct_sig t, std::string name) {
52 static_init_shamrock_mpidtype.push_back(std::move(t));
53 static_init_shamrock_mpidtype_names.push_back(name);
58 inline explicit MPIDTypefree(fct_sig t, std::string name) {
59 static_free_shamrock_mpidtype.push_back(std::move(t));
60 static_free_shamrock_mpidtype_names.push_back(name);
70#define Register_MPIDtypeInit(placeholdername, name) \
71 void mpiinit_##placeholdername(); \
72 void (*mpiinit_ptr_##placeholdername)() = mpiinit_##placeholdername; \
73 shamsys::mpidtypehandler::MPIDTypeinit mpiinit_class_obj_##placeholdername( \
74 mpiinit_ptr_##placeholdername, name); \
75 void mpiinit_##placeholdername()
81#define Register_MPIDtypeFree(placeholdername, name) \
82 void mpifree_##placeholdername(); \
83 void (*mpifree_ptr_##placeholdername)() = mpifree_##placeholdername; \
84 shamsys::mpidtypehandler::MPIDTypefree mpifree_class_obj_##placeholdername( \
85 mpifree_ptr_##placeholdername, name); \
86 void mpifree_##placeholdername()
std::uint32_t u32
32 bit unsigned integer
std::function< void(py::module &)> fct_sig
alias to pybind11 namespace