Commits

Benjamin Bean authored and Ville Suoranta committed 1f1818cc262 Merge
Pull request #563: CAS-6692

Merge in CASA/casa6 from CAS-6692 to master * commit '63b925d53ef0a18dd4f892c87e0b2bcbc4239eb0': (57 commits) CAS-6692 undo changes from accidental merge of CAS-13569 CAS-13569 get python version dynamically instead of hardcoding 3.6 CAS-6692 use a standard imagename for tclean tests add history_filter argument to gclean to allow for abbreviated masks in tclean command history (CAS-6692) Revert "CAS-6692 remove all the temporary workarounds necessary until CAS-13683 is done, recommit after Urvashi's and Darrel's suggested changes" CAS-6692 remove all the temporary workarounds necessary until CAS-13683 is done, recommit after Urvashi's and Darrel's suggested changes CAS-6692 added unit test to ensure gclean runs successfully CAS-6692 fix multifield imaging return record from SummaryMinor add copyright (CAS-6692) CAS-6692 including development code _gclean.py under private access for Darrel's new interactive tclean gui CAS-6692 ACTUALLY fix imagetesthelpers.py CAS-6692 rename 'stok' to 'stoke' CAS-6692 don't add convenience values because they get in the way of list comprehensions, fix summaryminor usage in imagetesthelpers.py CAS-6692 change all references to polarity to stokes, don't include any of multifieldId/chan/stok/deconId as summaryKeys CAS-6692 ensure that channel and polarity ids are always ordered, regardless of whether the underlying dict is ordered Revert "CAS-6692 remove all the temporary workarounds necessary until CAS-13683 is done, and don't mess up test_tclean.py in the process, recommit after reworking SummaryMinor to be a standard dict" CAS-6692 remove all the temporary workarounds necessary until CAS-13683 is done, and don't mess up test_tclean.py in the process, recommit after reworking SummaryMinor to be a standard dict CAS-6692 making SummaryMinor compatible with MPI again until CAS-13683 can be implemented, fix some bugs related to testing/0 iterdon CAS-6692 applying a few fixes since conversion of SummaryMinor back into a standard dictionary CAS-6692 reverting SummaryMinor object back to a standard dictionary ...

casa5/code/synthesis/ImagerObjects/DistSIIterBot.cc

Modified
18 18 //#
19 19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 20 //# Internet email: aips2-request@nrao.edu.
21 21 //# Postal address: AIPS++ Project Office
22 22 //# National Radio Astronomy Observatory
23 23 //# 520 Edgemont Road
24 24 //# Charlottesville, VA 22903-2475 USA
25 25 //#
26 26 #include <synthesis/ImagerObjects/DistSIIterBot.h>
27 27 #include <synthesis/ImagerObjects/SIIterBot.h>
28 +#include <synthesis/ImagerObjects/SIMinorCycleController.h>
28 29 #include <casadbus/session/DBusSession.h>
29 30 #include <casadbus/utilities/Conversion.h>
30 31
31 32 /* Records Interface */
32 33 #include <casa/Containers/Record.h>
33 34
34 35 #include <cstddef>
35 36 #include <cstring>
36 37 #include <functional>
37 38 #include <algorithm>
381 382 }
382 383
383 384 void
384 385 DistSIIterBot_state::mergeMinorCycleSummary(const Array<Double>& summary) {
385 386 std::lock_guard<std::recursive_mutex> guard(recordMutex);
386 387
387 388 IPosition accSummaryShape = itsSummaryMinor.shape();
388 389 IPosition summaryShape = summary.shape();
389 390
390 391 if (accSummaryShape.nelements() != 2
391 - || accSummaryShape[0] != itsNSummaryFields
392 + || accSummaryShape[0] != SIMinorCycleController::nSummaryFields
392 393 || summaryShape.nelements() != 2
393 - || summaryShape[0] != itsNSummaryFields)
394 + || summaryShape[0] != SIMinorCycleController::nSummaryFields)
394 395 throw AipsError(
395 396 "Internal error in shape of global minor-cycle summary record");
396 397
397 398 itsSummaryMinor.resize(
398 - IPosition(2, itsNSummaryFields, accSummaryShape[1] + summaryShape[1]),
399 + IPosition(2, SIMinorCycleController::nSummaryFields, accSummaryShape[1] + summaryShape[1]),
399 400 true);
400 401
401 402 ArrayIterator<Double> summaryIter(summary, IPosition(1, 1), false);
402 403 ArrayIterator<Double> accSummaryIter(itsSummaryMinor, IPosition(1, 1),
403 404 false);
404 405 accSummaryIter.set(IPosition(1, accSummaryShape[1]));
405 406
406 - IPosition i0 = IPosition(1, 0);
407 + IPosition i0 = IPosition(1, 0); // iterations done
408 + IPosition i7 = IPosition(1, 7); // cycle start iterations done
409 + IPosition i8 = IPosition(1, 8); // starting iterations done
407 410 while (!summaryIter.pastEnd()) {
408 411 accSummaryIter.array() = summaryIter.array();
409 412 accSummaryIter.array()(i0) += itsIterDone;
413 + accSummaryIter.array()(i7) += itsIterDone;
414 + accSummaryIter.array()(i8) += itsIterDone;
410 415 accSummaryIter.next();
411 416 summaryIter.next();
412 417 }
413 418 }
414 419
415 420 Record
416 421 DistSIIterBot_state::getSummaryRecord() {
417 422 LogIO os(LogOrigin("DistSIIterBot_state", __FUNCTION__, WHERE));
418 423 std::lock_guard<std::recursive_mutex> guard(recordMutex);
419 424
449 454 std::memcpy(acc.data(), summaryStore, summarySize * sizeof(double));
450 455 itsSummaryMinor.freeVStorage(summaryStore, delSummaryStore);
451 456
452 457 // Gather summaries
453 458 MPI_Gatherv(
454 459 ((rank == 0) ? MPI_IN_PLACE : acc.data()), summarySize, MPI_DOUBLE,
455 460 acc.data(), allSizes.data(), displs.data(), MPI_DOUBLE,
456 461 0, comm);
457 462
458 463 // Create Array of expected shape from acc
459 - IPosition totalSummaryShape(2, itsNSummaryFields,
460 - totalSize / itsNSummaryFields);
464 + IPosition totalSummaryShape(2, SIMinorCycleController::nSummaryFields,
465 + totalSize / SIMinorCycleController::nSummaryFields);
461 466 Array<Double> totalSummary(totalSummaryShape, acc.data(), SHARE);
462 467
463 468 // Create return Record
464 469 Record returnRecord = getDetailsRecord();
465 470 returnRecord.define("interactiveiterdone",
466 471 returnRecord.asInt("interactiveiterdone")
467 472 + returnRecord.asInt("cycleiterdone"));
468 473 returnRecord.define("summaryminor", totalSummary);
469 474 returnRecord.define("summarymajor", itsSummaryMajor);
470 475 return returnRecord;

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut