Unverified Commit 46a4d398 authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

FindImageOverlap optional threaded computation (#4047)

* Made the threaded calculation option in findimageoverlaps function call

* Fixed type in test file name

* Updated change log

* Addressed PR feedback
parent e7e4c755
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ update the Unreleased link so that it compares against the latest release tag.
 - Camera models now use the ALE library to interpolate states and orientations. Users will likely see very small changes in sensor ephemerides. These were tested and are within existing interpolation tolerances. [#2370](https://github.com/USGS-Astrogeology/ISIS3/issues/2370)
 - The isis3VarInit script is now just called isisVarInit and allows for more robust paths. [#3945](https://github.com/USGS-Astrogeology/ISIS3/pull/3945)
 - Isis2raw will now output straight to a 32bit file (no stretch) when stretch is set to None and bittype is set to 32bit. [#3878](https://github.com/USGS-Astrogeology/ISIS3/issues/3878)
 - Findimageoverlaps can now have calculations and writes happen at the same time or sequentially. [#4047](https://github.com/USGS-Astrogeology/ISIS3/pull/4047)

### Fixed

+4 −4
Original line number Diff line number Diff line
@@ -11,13 +11,13 @@ using namespace std;

namespace Isis {

  void findimageoverlaps(UserInterface &ui, Pvl *log) {
  void findimageoverlaps(UserInterface &ui, bool useThread, Pvl *log) {
    FileList images(ui.GetFileName("FROMLIST"));

    findimageoverlaps(images, ui, log);
    findimageoverlaps(images, ui, useThread, log);
  }

  void findimageoverlaps(FileList &images, UserInterface &ui, Pvl *log) {
  void findimageoverlaps(FileList &images, UserInterface &ui, bool useThread, Pvl *log) {
    // list of sns/filenames sorted by serial number
    SerialNumberList serialNumbers(true);

@@ -47,7 +47,7 @@ namespace Isis {
    }

    // Now we want the ImageOverlapSet to calculate our overlaps
    ImageOverlapSet overlaps(true);
    ImageOverlapSet overlaps(true, useThread);

    // Use multi-threading to create the overlaps
    overlaps.FindImageOverlaps(serialNumbers,
+2 −2
Original line number Diff line number Diff line
@@ -6,9 +6,9 @@
#include "UserInterface.h"

namespace Isis {
  extern void findimageoverlaps(UserInterface &ui, Pvl *log=nullptr);
  extern void findimageoverlaps(UserInterface &ui, bool useThread=true, Pvl *log=nullptr);

  extern void findimageoverlaps(FileList &images, UserInterface &ui, Pvl *log=nullptr);
  extern void findimageoverlaps(FileList &images, UserInterface &ui, bool useThread=true, Pvl *log=nullptr);
}

#endif
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ void IsisMain() {
  Pvl appLog;

  try {
    findimageoverlaps(ui, &appLog);
    findimageoverlaps(ui, true, &appLog);
  }
  catch (...) {
    for (auto grpIt = appLog.beginGroup(); grpIt!= appLog.endGroup(); grpIt++) {
+2 −5
Original line number Diff line number Diff line
@@ -33,12 +33,12 @@ namespace Isis {
   *                        addition to logging errors.
   * @see automaticRegistration.doc
   */
  ImageOverlapSet::ImageOverlapSet(bool continueOnError) {
  ImageOverlapSet::ImageOverlapSet(bool continueOnError, bool useThread) {

    p_continueAfterError = continueOnError;
    p_writtenSoFar = 0;
    p_calculatedSoFar = -1;
    p_threadedCalculate = false;
    p_threadedCalculate = useThread;
    p_snlist = NULL;
  }

@@ -181,9 +181,6 @@ namespace Isis {

    p_snlist = &boundaries;

    // This will enable using mutexes and spawning threads where necessary.
    p_threadedCalculate = true;

    FindImageOverlaps(boundaries);

    // While our exit condition is not true, call WriteImageOverlaps with the filename.
Loading