Skip to content

RooFit::MultiProcess & TestStatistics part 2b: MultiProcess#8412

Closed
egpbos wants to merge 9 commits into
root-project:masterfrom
roofit-dev:RooFit_MultiProcess_PR_2b_MultiProcess
Closed

RooFit::MultiProcess & TestStatistics part 2b: MultiProcess#8412
egpbos wants to merge 9 commits into
root-project:masterfrom
roofit-dev:RooFit_MultiProcess_PR_2b_MultiProcess

Conversation

@egpbos

@egpbos egpbos commented Jun 11, 2021

Copy link
Copy Markdown
Contributor

This PR is the third part of a split and clean-up of #8294, as suggested by @guitargeek.

In this PR, we introduce the RooFit::MultiProcess package. RooFit::MultiProcess is a task-based parallelization framework that will be used to parallelize gradients in RooFit/Minuit2 fits.

It uses forked processes for parallelization, as opposed to threads. We chose this approach because A) the existing RooRealMPFE parallelization framework already made use of forks as well, so we had something to build on and B) it was at the time deemed infeasible to check the entire RooFit code for thread-safety. Moreover, we use MultiProcess to parallelize gradients -- i.e. the tasks to be executed in parallel are partial derivatives -- and these are sufficiently large tasks that communication in between tasks is not a big concern in the big fits that we aimed to parallelize.

The communication between processes is done using ZeroMQ, accessed through convenience functions in RooFitZMQ introduced in #8385.

Notes:

  • This PR branch is forked off of the branch in RooFit::MultiProcess & TestStatistics part 2: ZeroMQ #8385, so until that is merged first, I may do some rebasing in this branch, so please be aware of that if you want to check this branch out locally.
  • test_Job still fails, it has to be updated to the latest communication framework.

With that in mind, this PR is ready for review.

egpbos added 9 commits June 9, 2021 15:44
The files in here are modified versions of the ZMQ convenience functions from https://gitlab.cern.ch/raaij/generate_and_sort, contributed by @roelaaij.
This is a reimplementation of ZMQ's poll function that mimics the POSIX ppoll function. The difference with regular poll is that ppoll blocks incoming POSIX signals, allowing graceful handling of these signals. We use this in RooFit::MultiProcess to shut down forked child processes.

The motivation behind this addition is discussed more in this blog post: https://blog.esciencecenter.nl/combining-zeromq-posix-signals-b754f6f29cd6, or more succinctly in Martin Sustrik's blog post, in the edit at the bottom: https://250bpm.com/blog:12/
The option builtin_zeromq is set to ON by default and controls whether RooFitZMQ is built. At some point, we should also add the option to use a system installed ZeroMQ, so that people can avoid the built-in, if they wish, e.g. for the conda-forge build.
Should have been added in ppoll commit before.
RooFit::MultiProcess is a task-based parallelization framework that will be used to parallelize gradients in RooFit/Minuit2 fits.

It uses forked processes for parallelization, as opposed to threads. We chose this approach because A) the existing RooRealMPFE parallelization framework already made use of forks as well, so we had something to build on and B) it was at the time deemed infeasible to check the entire RooFit code for thread-safety. Moreover, we use MultiProcess to parallelize gradients -- i.e. the tasks to be executed in parallel are partial derivatives -- and these are sufficiently large tasks that communication in between tasks is not a big concern in the big fits that we aimed to parallelize.

The communication between processes is done using ZeroMQ, accessed through convenience functions in RooFitZMQ.

Note: test_Job still fails, it has to be updated to the latest communication framework.
@ghost

ghost commented Jun 11, 2021

Copy link
Copy Markdown

DeepCode's analysis on #fc0ac8 found:

  • ⚠️ 1 warning, ℹ️ 1 minor issue. 👇

Top issues

Description Example fixes
Rethrow the original exception object using an empty throw. Otherwise a copy of e is created and the original exception type is lost and replaced by its (potential) super-type zmq::error_t. Occurrences: 🔧 Example fixes
Rethrow the original exception object using an empty throw. Otherwise a copy of e2 is created and the original exception type is lost and replaced by its (potential) super-type zmq::error_t. Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

👉 The DeepCode service and API will be deprecated in August, 2021. Here is the information how to migrate. Thank you for using DeepCode 🙏 ❤️ !

If you are using our plugins, you might be interested in their successors: Snyk's JetBrains plugin and Snyk's VS Code plugin.

@phsft-bot

Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@egpbos

egpbos commented Oct 6, 2021

Copy link
Copy Markdown
Contributor Author

Made obsolete by #9078.

@egpbos egpbos closed this Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants