Skip to content

Commit

Permalink
[RF] change default LikelihoodJob task splitting mode
Browse files Browse the repository at this point in the history
Set the default LikelihoodJob tasks to be component-wise splits rather than event-wise splits
  • Loading branch information
egpbos committed Sep 23, 2024
1 parent 9b5309f commit 4b6f1ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions roofit/roofitcore/src/TestStatistics/LikelihoodJob.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,26 @@ void LikelihoodJob::update_state()
}
}

/// \warning In automatic mode, this function can start MultiProcess (forks, starts workers, etc)!
std::size_t LikelihoodJob::getNEventTasks()
{
std::size_t val = n_event_tasks_;
if (val == MultiProcess::Config::LikelihoodJob::automaticNEventTasks) {
val = get_manager()->process_manager().N_workers();
val = 1;
}
if (val > likelihood_->getNEvents()) {
val = likelihood_->getNEvents();
}
return val;
}

/// \warning In automatic mode, this function can start MultiProcess (forks, starts workers, etc)!
std::size_t LikelihoodJob::getNComponentTasks()
{
std::size_t val = n_component_tasks_;
if (val == MultiProcess::Config::LikelihoodJob::automaticNComponentTasks) {
val = 1;
val = get_manager()
->process_manager()
.N_workers(); // get_manager() is the call that can start MultiProcess, mentioned above
}
if (val > likelihood_->getNComponents()) {
val = likelihood_->getNComponents();
Expand Down

0 comments on commit 4b6f1ca

Please sign in to comment.