183 {
184 const MInt noDurations = durations.size();
185
186 std::vector<MFloat> maxDurations(noDurations);
187 for(
MInt i = 0; i < noDurations; i++) {
188 maxDurations[i] = durations[i].first;
189 }
190
191 std::vector<MFloat> minDurations = maxDurations;
192 std::vector<MFloat> sumDurations = maxDurations;
193
194
196 "MPI_IN_PLACE", "maxDurations");
198 "MPI_IN_PLACE", "minDurations");
200 "MPI_IN_PLACE", "sumDurations");
201
202 const MInt maxLineLength = 256;
204 for(
MInt i = 0; i < noDurations; i++) {
205 const MString comment = durations[i].second;
206 snprintf(
b, maxLineLength,
"=== MAIA %s DURATION: %-35s | min: %.4e s | avg: %.4e s | max: %.4e s |",
207 module.c_str(), comment.c_str(), minDurations[i], sumDurations[i] / (
MFloat)noDomains, maxDurations[i]);
208 if(domainId == 0) {
209 std::cerr <<
b << std::endl;
210 }
212 }
213}
std::basic_string< char > MString
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce