Changeset 456f19 for src/Fragmentation


Ignore:
Timestamp:
Apr 5, 2018, 9:03:48 PM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
1e58bb
Parents:
0542e2
git-author:
Frederik Heber <frederik.heber@…> (04/05/18 12:36:19)
git-committer:
Frederik Heber <frederik.heber@…> (04/05/18 21:03:48)
Message:

SpecificFragmentController checks whether there are still workers left alive.

  • this avoids all workers having crashed over a job but the server is still present and thus the action hangs indefinitely.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Automation/SpecificFragmentController_ReceiveResultContainer_impl.hpp

    r0542e2 r456f19  
    2020#include "CodePatterns/toString.hpp"
    2121
     22#include <numeric>
    2223
    2324template <typename T>
     
    7273      LOG(1, "INFO: #" << JobStatus.first << " are waiting in the queue and #" << NoReceivedResults << " of " << NoExpectedResults << " jobs are calculated so far.");
    7374    }
    74   }
     75
     76    // if not all jobs are done yet, check number of present workers
     77    if (NoReceivedResults != NoExpectedResults) {
     78      callback.checkEnrolledWorkers(callback.host, callback.port);
     79      callback.RunService("Checking on number of workers");
     80      if (callback.getExitflag() != 0)
     81        break;
     82      const std::vector<size_t>& NumberWorkers = callback.getNumberOfWorkers();
     83      const int TotalNumberWorkers = std::accumulate(
     84          NumberWorkers.begin(), NumberWorkers.end(), 0);
     85      if (TotalNumberWorkers == 0) {
     86        ELOG(0, "Not all jobs are finished, but no workers are present working on it?!");
     87        callback.setExitflag(ExitflagContainer::ErrorFlag);
     88        break;
     89      } else {
     90        LOG(4, "There are " << NumberWorkers << " workers enrolled.");
     91      }
     92    }
     93}
    7594}
    7695
Note: See TracChangeset for help on using the changeset viewer.