-
Instructions on how to make sure madgraph in the madminer examples works:
Step 1: Download and execute script that copies and patches
f2py
such that it uses python 2 even if python 3 environment is loaded:wget -O f2py-2.7-setup --no-check-certificate https://llrgit.in2p3.fr/snippets/2/raw sh f2py-2.7-setup
Step 2: Set the f2py compiler in the
input/mg5_configuration.txt
file in your madgraph directory:f2py_compiler = f2py-2.7
Step 3: Add alias to your
.bash_profile
(or.zshrc
if you use zsh) to getgfortran
which madgrahph needs (more info on modules on this page):# Use modules to get newer software on the UIs module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7 # In particular, we want modern compilers #module load compilers/gcc/7.1.1 module load compilers/gcc/6.3.1
Step 4: Add alias to your
.bash_profile
(or.zshrc
if you use zsh) to load python 3 environment for madminer notebooks when you need it (especially before starting the notebook server withjupyter-notebook
):alias python3env="source /home/llr/cms/rembser/.python3_profile"
Either source the profile again or restart the session now. Of course nothing prevents you to directly put the sourcing of
.python3_profile
in your profile, but I like to have it as an alias to only enable it when needed. It clashes with the CMSSW environment otherwise.Step 5: Make sure to have the following parameters in your calls to
MadMiner.run()
or MadMiner.run_multiple()`:python2_override=True, initial_command="PYTHONPATH=/usr/lib64/python",
This will ensure python 2 is used for madgraph and it does not accidentally try to load python 3 libraries.
Notes: For convenience, here the commands to download and unpack the madgraph version used in madminer:
wget https://launchpad.net/mg5amcnlo/2.0/2.6.x/+download/MG5_aMC_v2.6.7.tar.gz tar -xf MG5_aMC_v2.6.7.tar.gz
I like to switch off the automatic HTML opening of madgraph, which you can also switch off in the
input/mg5_configuration.txt
:automatic_html_opening = False
Edited by Jonas REMBSER
Please register or sign in to comment