Use TBB on the Cluster¶
module avail tbband
module avail intelto see all the versions of intel compilers and TBB available on the cluster
- Load the version of the intel compilers you want in your
module load intel/<version number>.
module load intelloads the default version.
- Load the version of the TBB you want in your
module load tbb/<version number>.
module load tbbloads the default version.
- In your
PBSscript, after the lines for loading the correct modules, compile your C++ program with
- Then below that line, execute the C++ program
- Submit the job with
qsub <.pbs filename>and collect results
Walkthrough: Use TBB on the Cluster¶
- This walkthrough will use a simple C++ program that imports a header file from the TBB library and prints a string
- Example C program: tbb_example.cpp
- PBS Script: tbb.pbs
- To follow along, manually copy these files into the same directory in your account on the cluster, or transfer them to your account (again put them in the same folder).
Part 1: The PBS Script¶
#PBS -N tbbTest #PBS -l nodes=1:ppn=2 #PBS -l walltime=1:00 #PBS -q iw-shared-6 #PBS -j oe #PBS -o tbb.out cd $PBS_O_WORKDIR module load intel module load tbb icc tbb_example.cpp -o example ./example
#PBSdirectives are standard, requesting just 1 minute of walltime and 1 node with 2 cores. More on
#PBSdirectives can be found in the PBS guide
$PBS_O_WORKDIRis simply a variable that represents the directory you submit the PBS script from. Make sure the
.cppfile you want to run is in the same directory you put the PBS script. Otherwise, the C++ program wont be found when the job is run.
Output Files, such as the resulting executable, will also show up in the same directory as the
module loadlines load gcc (compiler) and gsl.
iccline compiles the C++ program into an executable called
./exampleruns the program
Part 2: Submit Job and Check Status¶
- Make sure you're in the directory that contains the
PBSscript and the
- Submit as normal, with
qsub <pbs script name>. In this case
- Check job status with
qstat -u username3 -n, replacing "username3" with your gtusername
- You can delete the job with
qdel 22182721, replacing the number with the jobid returned after running qsub
Part 3: Collecting Results¶
- In the directory where you submitted the
PBSscript, you should see a couple of newly generated files, including
exampleis the executable file created
tbb.outcontains the results of the job
vim tbb.out(you can use any text editor).
- The output should contain the result of the computation:
Job name: tbbTest Queue: iw-shared-6 End PBS Prologue Fri Nov 30 10:07:38 EST 2018 --------------------------------------- Simple test importing tbb --------------------------------------- Begin PBS Epilogue Fri Nov 30 10:07:39 EST 2018 Job ID: 23019307.shared-sched.pace.gatech.edu
- After the result files are produced, you can move the out file as well as any other files off the cluster. Refer to the file transfer guide for help.
- Congratulations! You successfully used TBB on the cluster.