20 #ifndef SELDON_FILE_COMMON_CXX
24 #ifdef SELDON_WITH_SLEPC
33 size_t index = nom.find_last_of(
'.');
34 if (index == string::npos)
37 string extension = nom.substr(index+1, nom.size()-index);
45 size_t index = nom.find_last_of(
'.');
46 if (index == string::npos)
49 string base = nom.substr(0, index);
54 #ifdef SELDON_WITH_HDF5
61 hid_t GetH5Type(T& input)
73 unsigned long long ull;
75 if (
typeid(input) ==
typeid(d))
76 return H5T_NATIVE_DOUBLE;
77 if (
typeid(input) ==
typeid(f))
78 return H5T_NATIVE_FLOAT;
79 if (
typeid(input) ==
typeid(i))
80 return H5T_NATIVE_INT;
81 if (
typeid(input) ==
typeid(l))
82 return H5T_NATIVE_LONG;
83 if (
typeid(input) ==
typeid(c))
84 return H5T_NATIVE_CHAR;
85 if (
typeid(input) ==
typeid(uc))
86 return H5T_NATIVE_UCHAR;
87 if (
typeid(input) ==
typeid(ll))
88 return H5T_NATIVE_LLONG;
89 if (
typeid(input) ==
typeid(ui))
90 return H5T_NATIVE_UINT;
91 if (
typeid(input) ==
typeid(us))
92 return H5T_NATIVE_USHORT;
93 if (
typeid(input) ==
typeid(ul))
94 return H5T_NATIVE_ULONG;
95 if (
typeid(input) ==
typeid(ull))
96 return H5T_NATIVE_ULLONG;
98 throw Error(
"hid_t GetH5Type(T& input)",
99 "Type has no corresponding native HDF5 datatype.");
111 #ifdef SELDON_WITH_MPI
113 #ifdef MONTJOIE_WITHOUT_THREAD
114 MPI_Init(&argc, &argv);
116 int required = MPI_THREAD_MULTIPLE;
118 int rank, print_level = 1;
119 MPI_Init_thread(&argc, &argv, required, &provided);
120 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
121 if ((rank == 0) && (print_level > 0))
125 case MPI_THREAD_SINGLE:
126 cout <<
"MPI_Init_thread level = MPI_THREAD_SINGLE" << endl;
128 case MPI_THREAD_FUNNELED:
129 cout <<
"MPI_Init_thread level = MPI_THREAD_FUNNELED" << endl;
131 case MPI_THREAD_SERIALIZED:
132 cout <<
"MPI_Init_thread level = MPI_THREAD_SERIALIZED" << endl;
134 case MPI_THREAD_MULTIPLE:
135 cout <<
"MPI_Init_thread level = MPI_THREAD_MULTIPLE" << endl;
138 cout <<
"MPI_Init_thread level = ???" << endl;
143 #ifdef SELDON_WITH_SLEPC
144 string help(
"Slepc interface");
145 SlepcInitialize(&argc, &argv, (
char*)0, help.data());
158 #ifdef SELDON_WITH_SLEPC
162 #ifdef SELDON_WITH_MPI
171 #define SELDON_FILE_COMMON_CXX