Skip to content

Working with cudacpp v1.00.00 (October 2024)

Andrea Valassi edited this page Oct 14, 2024 · 2 revisions

Working with cudacpp v1.00.00 (October 2024)

This page provides an update on using the cudacpp (GPU/SIMD) plugin of MG5AMC at the time of its release at the beginning of October 2024.

This is based on the updates and releases of the following projects:

There are two different modes, described below, to install and use the cudacpp plugin:

  • User mode (start from the mg5amcnlo repository, and install cudacpp therein from the madgraph4gpu repository)
  • Developer mode (start from the madgraph4gpu repository hosting cudacpp, and use the mg5amcnlo that it contains as a git submodule)

For more details see also HEPToolsInstallers#6 and madgraph4gpu#1008.

User mode

Create a local installation directory WORKDIR, for instance:

export WORKDIR=/data/avalassi/TMP
rm -rf $WORKDIR
mkdir -p $WORKDIR

Download mg5amcnlo into the local installation directory WORKDIR

cd $WORKDIR
git clone [email protected]:mg5amcnlo/mg5amcnlo.git

You are now on the HEAD version of branch 3.x. You can work here to have the latest development version. Otherwise, you may optionally switch to the released version v3.6.0:

cd $WORKDIR/mg5amcnlo
git checkout v3.6.0

Enter the mg5_aMC interactive shell and install the cudacpp plugin (behind the scenes, this installs the latest HEPToolsInstaller tarball and uses HEPToolsInstaller to download and install the cudacpp v1.0.0 tarball):

cd $WORKDIR/mg5amcnlo
./bin/mg5_aMC 
# The following lines are within the "MG5_aMC>" shell prompt
install cudacpp 

You may now use the cudacpp plugin, for instance to generate and launch a physics process in "madevent_simd" mode. (Preferably, open a browser before calling launch).

# The following lines are within the "MG5_aMC>" shell prompt
generate e+ e- > mu+ mu-
output madevent_simd ee_mumu.mad --hel_recycling=False --vector_size=32 
!firefox &
launch

Developer mode

Create a local installation directory WORKDIR, for instance:

export WORKDIR=/data/avalassi/TMP
rm -rf $WORKDIR
mkdir -p $WORKDIR

Download madgraph4gpu into the local installation directory WORKDIR (do not forget the submodule option!)

cd $WORKDIR
git clone --recurse-submodules [email protected]:madgraph5/madgraph4gpu.git

You are now on the HEAD version of branch master. You can work here to have the latest development version. Otherwise, you may optionally switch to the released version v1.0.0 (do not forget the submodule update!):

cd $WORKDIR/madgraph4gpu
git checkout cudacpp_for3.6.0_v1.00.00
git submodule update

Move to the mg5amcnlo git submodule directory. Enter the mg5_aMC interactive shell (do not forget to set the PYTHONPATH and add the -m option!):

cd $WORKDIR/madgraph4gpu/MG5aMC/mg5amcnlo
PYTHONPATH=.. ./bin/mg5_aMC -m CUDACPP_OUTPUT

You may now use the cudacpp plugin, for instance to generate and launch a physics process in "madevent_simd" mode. (Preferably, open a browser before calling launch).

# The following lines are within the "MG5_aMC>" shell prompt
generate e+ e- > mu+ mu-
output madevent_simd ee_mumu.mad --hel_recycling=False --vector_size=32 
!firefox &
launch

Created by A. Valassi on 2024-10-04