Difference between revisions of "Instructions to run Trajectum at Nikhef"

From ALICE Wiki
Jump to navigation Jump to search
Line 132: Line 132:
 
Make sure you point <code>outdir</code> and <code>TRAJECTUM_DIR</code> to the right directories.
 
Make sure you point <code>outdir</code> and <code>TRAJECTUM_DIR</code> to the right directories.
  
Before submitting the submission file make sure that you make your shell script an executable by running <code>chmod +x testJob.sh</code> otherwise the system considers it to be just a text file and it will not run. If you submit the script like this, the log, output and error files will be created in the same directory as the submission file, add a different path if you'd like to save it elsewhere.  
+
Before submitting the submission file make sure that you make your shell script an executable by running <code>chmod +x testJob.sh</code> otherwise the system considers it to be just a text file and it will not run. If you submit the script like this, the log, output and error files will be created in the same directory as the submission file, add a different path if you'd like to save it elsewhere. Make sure you’ve completed all the steps on this wiki up to and including the “Executing Collide” section — specifically, up to successfully running <code>make</code> in your cloned ''Trajectum'' directory.  
  
 
To submit your workflow run:
 
To submit your workflow run:
 
  condor_submit <filename>.sub  
 
  condor_submit <filename>.sub  
You can check the status of your job using <code>condor_q</code>
+
You can check the status of your job using <code>condor_q</code> for more advanced commands please check the [https://htcondor.readthedocs.io/en/latest/ HTCondor manual].
  
 
And check your output, error & log files to see if everything works.  
 
And check your output, error & log files to see if everything works.  
  
 
'''TIP:'''  First test your executable on the interactive nodes to debug any issues, if it runs without problems submit it to the cluster!
 
'''TIP:'''  First test your executable on the interactive nodes to debug any issues, if it runs without problems submit it to the cluster!

Revision as of 12:55, 16 May 2025

NOTE: This page is still work in progress!

Before you start running your jobs at Nikhef, please make sure you join the stbc-mattermost channel using the following link.

Pre-installed packages

The packages needed to configure trajectum are stored at: /project/alice/trajectum_packages

In this directory you find:

  • LHAPDF-6.5.4
  • fastjet-3.4.2
  • gemini_2024.8.8
  • pythia8309
  • smash
  • autoconf-archive

All users read and execute.

Access to Trajectum source code

In order to work on Trajectum you need to be part of the trajectum repository at codeberg.org

If you want you can request acces by creating an account, with your usename including: FirstnameLastname

Then send an email to ... including your username to get access.

Setting up Trajectum

The following steps can be used alongside the description of setting up Trajectum in the README file of the source code.

Execute the following commands:

source /cvmfs/alice.cern.ch/etc/login.sh

source /cvmfs/sft.cern.ch/lcg/views/setupViews.sh LCG_107 x86_64-el9-gcc14-opt

export PKG_CONFIG=/usr/bin/pkg-config

Go to /data/alice/<yourNikhefusername> (or any other preferred directory)

Clone the Trajectum source code:

git clone https://codeberg.org/Trajectum/Trajectum.git  

This will create a Trajectum directory. In this directory execute:

autoreconf --install -I /project/alice/trajectum_packages/autoconf-archive/m4/

which will create the configure executable with which you can run

./configure --with-lhapdf-prefix=/project/alice/trajectum_packages --with-fastjet-prefix=/project/alice/trajectum_packages --with-pythia-prefix=/project/alice/trajectum_packages/pythia8309 --with-gemini-prefix=/project/alice/trajectum_packages

Then execute (still in the Trajectum directory)

make

Executing collide

In order to run collide you need to set:

export LD_LIBRARY_PATH=/project/alice/trajectum_packages/pythia8309/lib/:/project/alice/trajectum_packages/lib/:$LD_LIBRARY_PATH

followed by:

export GINPUT=/project/alice/trajectum_packages/share/gemini/

Within the Trajectum directory change to src/

In the src directory execute

./collide ../parfiles/collisionpp.par

collisionpp.par is an example file with parameter setting for a pp collision. You can use all the example parameter files in parfiles/

This command should output 5 files starting with pp.

Known issues

If you already (before following the steps above) executed make in your Trajectum directory within a slightly different environment as setup in "Setting up Trajectum".

./collide ../parfiles/collisionpp.par can crash with a segmentation fault giving multiple errors containing: ./collide: Symbol `<name>' has different size in shared object, consider re-linking

If you get these errors, before executing make , execute make clean before following the rest of the remaining steps.

Run your Trajectum jobs on the Stoomboot cluster

For general information about the CPU Batch system at Nikhef and general guidelines on how to submit jobs, visit CT wiki and the HTCondor manual.

To submit your jobs to the Nikhef cluster you need a submission script <filename>.sub and an executable <filename>.sh that contains the code you want to execute.

An example submission script:

executable              = testJob.sh
log                     = test.log
output                  = outfile.txt
error                   = errors.txt

+UseOS                  = "el9"
+JobCategory            = "short"

request_cpus            = 4
request_memory          = 8G

queue

If you need to pass arguments to your executable you can add them by adding the following line to your submission script:

arguments               = "var1 var2 var3"

The workflow in your testJob.sh could contain the following

#!/bin/bash

source /cvmfs/alice.cern.ch/etc/login.sh
source /cvmfs/sft.cern.ch/lcg/views/setupViews.sh LCG_107 x86_64-el9-gcc14-opt
export PKG_CONFIG=/usr/bin/pkg-config
export TRAJECTUM_DIR=/path/to/Trajectum/directory
outdir=/path/to/directory/where/you/want/to/store/your/output/files

#create output directory if it does not exist yet
if [ ! -d ${outdir} ]
   then
 mkdir -p ${outdir}
fi

cd ${TRAJECTUM_DIR}
autoreconf --install -I /project/alice/trajectum_packages/autoconf-archive/m4/
cd ${TMPDIR}

export LD_LIBRARY_PATH=/project/alice/trajectum_packages/pythia8309/lib/:/project/alice/trajectum_packages/lib/:$LD_LIBRARY_PATH
export GINPUT=/project/alice/trajectum_packages/share/gemini

${TRAJECTUM_DIR}/src/collide ${TRAJECTUM_DIR}/parfiles/collisionpp.par

ls
mv pp.* ${outdir}

echo "Anything left?"
ls

Make sure you point outdir and TRAJECTUM_DIR to the right directories.

Before submitting the submission file make sure that you make your shell script an executable by running chmod +x testJob.sh otherwise the system considers it to be just a text file and it will not run. If you submit the script like this, the log, output and error files will be created in the same directory as the submission file, add a different path if you'd like to save it elsewhere. Make sure you’ve completed all the steps on this wiki up to and including the “Executing Collide” section — specifically, up to successfully running make in your cloned Trajectum directory.

To submit your workflow run:

condor_submit <filename>.sub 

You can check the status of your job using condor_q for more advanced commands please check the HTCondor manual.

And check your output, error & log files to see if everything works.

TIP: First test your executable on the interactive nodes to debug any issues, if it runs without problems submit it to the cluster!