Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multivariate random number generation #7186

Merged
merged 4 commits into from
May 10, 2021

Conversation

jolopezl
Copy link
Contributor

@jolopezl jolopezl commented Feb 12, 2021

Add multivariate gaussian random number generation with GSLRndmEngines. Example/use case in /tutorials/math/multivarGaus.C.

Related to ROOT-767.

@phsft-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@couet couet removed their request for review February 12, 2021 07:15
Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this nice contribution.
Looks good to me.

@lmoneta
Copy link
Member

lmoneta commented Feb 18, 2021

@phsft-bot build!

@phsft-bot
Copy link
Collaborator

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

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-3.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-02-18T13:45:54.468Z] FAILED: /usr/bin/ccache /usr/bin/c++ -DVECCORE_ENABLE_VC -I/mnt/build/workspace/root-pullrequests-build/root/math/mathmore/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/unix/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/clingutils/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/textinput/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/thread/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/zip/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/rint/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/clib/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/meta/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/gui/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/cont/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/foundation/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/base/inc -Iginclude -I/mnt/build/workspace/root-pullrequests-build/root/math/mathcore/inc -I/mnt/build/workspace/root-pullrequests-build/root/math/mathcore/v7/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/imt/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/multiproc/inc -Iexternals/mnt/build/workspace/root-pullrequests-build/install/include -I/mnt/build/workspace/root-pullrequests-build/root/net/net/inc -I/mnt/build/workspace/root-pullrequests-build/root/io/io/inc -fdiagnostics-color=always -std=c++11 -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -fPIC -std=c++11 -MD -MT math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o -MF math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o.d -o math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o -c /mnt/build/workspace/root-pullrequests-build/root/math/mathmore/src/GSLRndmEngines.cxx
  • [2021-02-18T13:45:54.468Z] /mnt/build/workspace/root-pullrequests-build/root/math/mathmore/src/GSLRndmEngines.cxx:225:68: error: ‘gsl_ran_multivariate_gaussian’ was not declared in this scope

@phsft-bot
Copy link
Collaborator

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

@lmoneta
Copy link
Member

lmoneta commented Mar 1, 2021

@phsft-bot build!

@phsft-bot
Copy link
Collaborator

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

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-3.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-03-01T16:00:58.827Z] FAILED: /usr/bin/ccache /usr/bin/c++ -DVECCORE_ENABLE_VC -I/mnt/build/workspace/root-pullrequests-build/root/math/mathmore/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/unix/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/clingutils/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/textinput/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/thread/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/zip/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/rint/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/clib/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/meta/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/gui/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/cont/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/foundation/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/base/inc -Iginclude -I/mnt/build/workspace/root-pullrequests-build/root/math/mathcore/inc -I/mnt/build/workspace/root-pullrequests-build/root/math/mathcore/v7/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/imt/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/multiproc/inc -Iexternals/mnt/build/workspace/root-pullrequests-build/install/include -I/mnt/build/workspace/root-pullrequests-build/root/net/net/inc -I/mnt/build/workspace/root-pullrequests-build/root/io/io/inc -fdiagnostics-color=always -std=c++11 -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -fPIC -std=c++11 -MD -MT math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o -MF math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o.d -o math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o -c /mnt/build/workspace/root-pullrequests-build/root/math/mathmore/src/GSLRndmEngines.cxx
  • [2021-03-01T16:00:58.827Z] /mnt/build/workspace/root-pullrequests-build/root/math/mathmore/src/GSLRndmEngines.cxx:225:68: error: ‘gsl_ran_multivariate_gaussian’ was not declared in this scope

@jolopezl
Copy link
Contributor Author

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-3.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-03-01T16:00:58.827Z] FAILED: /usr/bin/ccache /usr/bin/c++ -DVECCORE_ENABLE_VC -I/mnt/build/workspace/root-pullrequests-build/root/math/mathmore/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/unix/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/clingutils/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/textinput/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/thread/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/zip/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/rint/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/clib/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/meta/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/gui/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/cont/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/foundation/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/base/inc -Iginclude -I/mnt/build/workspace/root-pullrequests-build/root/math/mathcore/inc -I/mnt/build/workspace/root-pullrequests-build/root/math/mathcore/v7/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/imt/inc -I/mnt/build/workspace/root-pullrequests-build/root/core/multiproc/inc -Iexternals/mnt/build/workspace/root-pullrequests-build/install/include -I/mnt/build/workspace/root-pullrequests-build/root/net/net/inc -I/mnt/build/workspace/root-pullrequests-build/root/io/io/inc -fdiagnostics-color=always -std=c++11 -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -fPIC -std=c++11 -MD -MT math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o -MF math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o.d -o math/mathmore/CMakeFiles/MathMore.dir/src/GSLRndmEngines.cxx.o -c /mnt/build/workspace/root-pullrequests-build/root/math/mathmore/src/GSLRndmEngines.cxx
  • [2021-03-01T16:00:58.827Z] /mnt/build/workspace/root-pullrequests-build/root/math/mathmore/src/GSLRndmEngines.cxx:225:68: error: ‘gsl_ran_multivariate_gaussian’ was not declared in this scope

Sorry that it took me a while to look at this. I had to create an Ubuntu 16.04 virtual machine for testing.

@lmoneta, unfortunately, this error happens because Ubuntu 16.04 ships GSL version 2.1, which hasn't gsl_ran_multivariate_gaussian. The multivariate Gaussian random number generation in GSL was only introduced in version 2.2.1. I bypass this with an #ifdef that will define the function if the GSL version is < 2.2 by simply copying it from a higher version of GSL. Hopefully, this doesn't break the GPL license under which GSL is distributed. I think that I could also replace the function call to gsl_ran_multivariate_gaussian with the wrapper's full implementation. I am open to comments.

I don't have access to a windows machine now; I will do the same and use a virtual machine to test that part.

@jolopezl
Copy link
Contributor Author

@phsft-bot build just on ROOT-ubuntu16/nortcxxmod!

@jolopezl jolopezl requested a review from lmoneta March 21, 2021 01:58
@oshadura
Copy link
Contributor

@phsft-bot build!

@phsft-bot
Copy link
Collaborator

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

@lmoneta
Copy link
Member

lmoneta commented May 10, 2021

Thank you for the contribution and for fixing for GSL versions < 2.1
Looks good to me and I will merge it now

@lmoneta lmoneta merged commit e0085be into root-project:master May 10, 2021
@jolopezl jolopezl deleted the GaussianND branch May 10, 2021 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants