Raad2: Topas

From TAMUQ Research Computing User Documentation Wiki
Jump to navigation Jump to search


Introduction to Topas

"TOPAS wraps and extends the Geant4 Simulation Toolkit to provide an easier-to-use application for the medical physicist. TOPAS’s unique parameter control system lets you assemble and control a rich library of simulation objects (geometry components, particle sources, scorers, etc.) with no need to write C++ code."

More information can be found here: Topas Website

Usage on raad2

TOPAS is distributed under a Single User License scheme described here: Topas License

Every individual user must have his/her own valid license to run TOPAS. Access to this software is therefore restricted. If you wish to access Topas, please obtain a license from topasmc.org and then send an email to servicedesk@qatar.tamu.edu requesting access on raad2 on the basis of that license.

Example Files

You may copy Topas example files to your home directory for your convenience if you like.

muarif092@raad2a:~> cp -R /ddn/sw/xc40/cle7/topas/examples ~/

Interactive Mode

Interactive mode allows you to run your code interactively on raad2 - this is useful if your application has a GUI frontend or if you want to test your code/configuration before long runs.

muarif092@raad2a:~> sinteractive
muarif092@nid00190:~> module load topas/37
muarif092@nid00190:~> topas
Welcome to TOPAS, Tool for Particle Simulation (Version 3.7)
muarif092@nid00190:~> 

If you want to view any GUI output, you should setup DISPLAY variable on a compute node (i.e. Node assigned to you after issuing sinteractive command).
Here is a guide on this: Setting up Display Variable for X11 Forwarding

Batch Mode

A sample slurm.job file is placed at

/ddn/sw/xc40/cle7/topas/slurm.job
#!/bin/bash
#SBATCH -J topas
#SBATCH -p s_long
#SBATCH --qos=sl
#SBATCH --time=168:00:00
#SBATCH -N 1
#SBATCH --ntasks=1
#SBATCH --hint=nomultithread

module load topas/37

examplesDir=/ddn/sw/xc40/cle7/topas/examples
myExampleDir=/ddn/home/$USER/topas/examples
mkdir -p $myExampleDir

cp -R $examplesDir/SpecialComponents $myExampleDir
cd $myExampleDir/SpecialComponents

srun -n 1 topas MultiLeafCollimator_sequence.txt

Multithreaded Version in Batch Mode

"TOPAS fully supports the Multi-Threaded simulation capability of Geant4". More information here

You will need to modify your input file and add or modify the line below;

i:Ts/NumberOfThreads = 4 # defaults to 1

Then in slurm.job file, change following parameters

 #SBATCH --ntasks=4 

and

 srun -n 4 

Where '4' is the number of threads you want to scale your code to.