Changes

Jump to navigation Jump to search
1,333 bytes added ,  20:27, 24 January 2017
Line 115: Line 115:     
Remember to replace ".username" with your stats cluster username. This sample submit script can be used for shortjob and longjob groups by replacing "testjob" with either "shortjob" or "longjob".
 
Remember to replace ".username" with your stats cluster username. This sample submit script can be used for shortjob and longjob groups by replacing "testjob" with either "shortjob" or "longjob".
 +
 +
=== GCC 4.9.2 ===
 +
CentOS 6 uses the default 4.4.7 GCC compiler. The version 4.9.2 is available but it needs to be set by the user. To do this, it is recommended to include it in your job's executable. For example, you could make /bin/bash your executable and then transfer an executable bash script. Within this bash script, you can set gcc to 4.9.2 and then execute your code.
 +
 +
The submit file
 +
<pre>
 +
...
 +
Executable = /bin/bash
 +
Arguments = myBashScript
 +
# if your script takes in arguments, write it like below
 +
Arguments = myBashScript arg1 arg2 ...
 +
transfer_input_files = myBashScript
 +
...
 +
</pre>
 +
 +
myBashScript (make sure this is executable, chmod +x myBashScript)
 +
<pre>
 +
# At the very beginning of your script you should add this line
 +
source scl_source enable devtoolset-3
 +
 +
# If you want to convince yourself that you are now using gcc 4.9.2, add the following line to get the gcc version in your output file
 +
gcc --version
 +
 +
# Now include the necessary commands in the remaining bash script to execute your code
 +
exe="root"
 +
opt1="-l"
 +
opt2="-b"
 +
macro="runDSelector.C(\"$1\")"
 +
 +
command=( "$exe" "$opt1" "$opt2" "$macro" )
 +
 +
"${command[@]}"
 +
</pre>
 +
 +
This is just an example bash script that will open the software ROOT and execute a macro called runDSelector.C with a solitary argument. This is not the only way to structure a bash script.
191

edits

Navigation menu