DistSIIterBot_state::mergeMinorCycleSummary(const Array<Double>& summary) {
std::lock_guard<std::recursive_mutex> guard(recordMutex);
IPosition accSummaryShape = itsSummaryMinor.shape();
IPosition summaryShape = summary.shape();
if (accSummaryShape.nelements() != 2
|| accSummaryShape[0] != itsNSummaryFields
|| accSummaryShape[0] != SIMinorCycleController::nSummaryFields
|| summaryShape.nelements() != 2
|| summaryShape[0] != itsNSummaryFields)
|| summaryShape[0] != SIMinorCycleController::nSummaryFields)
"Internal error in shape of global minor-cycle summary record");
IPosition(2, itsNSummaryFields, accSummaryShape[1] + summaryShape[1]),
IPosition(2, SIMinorCycleController::nSummaryFields, accSummaryShape[1] + summaryShape[1]),
ArrayIterator<Double> summaryIter(summary, IPosition(1, 1), false);
ArrayIterator<Double> accSummaryIter(itsSummaryMinor, IPosition(1, 1),
accSummaryIter.set(IPosition(1, accSummaryShape[1]));
IPosition i0 = IPosition(1, 0);
IPosition i0 = IPosition(1, 0); // iterations done
IPosition i7 = IPosition(1, 7); // cycle start iterations done
IPosition i8 = IPosition(1, 8); // starting iterations done
while (!summaryIter.pastEnd()) {
accSummaryIter.array() = summaryIter.array();
accSummaryIter.array()(i0) += itsIterDone;
accSummaryIter.array()(i7) += itsIterDone;
accSummaryIter.array()(i8) += itsIterDone;
DistSIIterBot_state::getSummaryRecord() {
LogIO os(LogOrigin("DistSIIterBot_state", __FUNCTION__, WHERE));
std::lock_guard<std::recursive_mutex> guard(recordMutex);
std::memcpy(acc.data(), summaryStore, summarySize * sizeof(double));
itsSummaryMinor.freeVStorage(summaryStore, delSummaryStore);
((rank == 0) ? MPI_IN_PLACE : acc.data()), summarySize, MPI_DOUBLE,
acc.data(), allSizes.data(), displs.data(), MPI_DOUBLE,
// Create Array of expected shape from acc
IPosition totalSummaryShape(2, itsNSummaryFields,
totalSize / itsNSummaryFields);
IPosition totalSummaryShape(2, SIMinorCycleController::nSummaryFields,
totalSize / SIMinorCycleController::nSummaryFields);
Array<Double> totalSummary(totalSummaryShape, acc.data(), SHARE);
Record returnRecord = getDetailsRecord();
returnRecord.define("interactiveiterdone",
returnRecord.asInt("interactiveiterdone")
+ returnRecord.asInt("cycleiterdone"));
returnRecord.define("summaryminor", totalSummary);
returnRecord.define("summarymajor", itsSummaryMajor);