{"id":2078,"date":"2019-01-21T11:49:39","date_gmt":"2019-01-21T11:49:39","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=2078"},"modified":"2025-12-16T14:01:56","modified_gmt":"2025-12-16T14:01:56","slug":"geant-4","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/geant-4\/","title":{"rendered":"Geant 4"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.<\/p>\n<p>The following version is installed on the CSF:<\/p>\n<ul>\n<li>Geant4 11.4.0<\/li>\n<li>Geant4 11.1.3<\/li>\n<\/ul>\n<h2>Restrictions on use<\/h2>\n<p>GEANT4 is not open source software, it has a custom <a href=\"https:\/\/geant4.web.cern.ch\/download\/license\">license<\/a>, which you should read before using GEANT4. GEANT4 is available to all CSF3 users, there is no access to the source code on CSF3 but this can be found on the <a href=\"https:\/\/github.com\/Geant4\">GEANT4 Github<\/a>.<\/p>\n<h2>Set up procedure<\/h2>\n<p>To access the toolkit load <em>one<\/em> of the modulefiles:<\/p>\n<pre>module load apps\/gcc\/geant4\/11.4.0<\/pre>\n<pre>module load apps\/gcc\/geant4\/11.1.3<\/pre>\n<p>For reliable behaviour, we recommend loading module files in your job script rather than on the login node.<\/p>\n<h2>Using the Toolkit<\/h2>\n<h3>Compile  your GEANT4 Application<\/h3>\n<p>Create your build directory: <\/p>\n<pre>\r\nmkdir ~\/scratch\/my_application_build\r\n\r\ncd ~\/scratch\/my_application_build\r\n<\/pre>\n<p>Compile your code with<\/p>\n<pre>\r\ncmake -DGeant4_DIR=$GEANT4DIR ~\/path\/to\/my_application_source\r\n\r\nmake\r\n<\/pre>\n<p>The executable will be created.<\/p>\n<p>Please do not run your Geant4 application on the login node. Jobs should be submitted to the compute nodes via sbatch or srun for an interactive session.<\/p>\n<h2>Run<\/h2>\n<h3>Serial batch job submission<\/h3>\n<p>If your application is interactive, for example, if it produces graphical output, connect to a compute node for an interactive session:<\/p>\n<pre>\r\nsrun -p interactive -t 60 --pty bash\r\n\r\nmodule load apps\/gcc\/geant4\/11.1.3\r\n\r\n~\/path\/to\/my_application\r\n<\/pre>\n<p>If your application isn&#8217;t interactive, please submit jobs via batch:<\/p>\n<pre>\r\n#! \/bin\/bash --login\r\n#SBATCH -p serial        # Run in the \"serial\" partition (compute nodes dedicated to 1-core jobs)\r\n#SBATCH -t 1-00:00:00    # maximum runtime in D-HH-MM-SS\r\n\r\nmodule load apps\/gcc\/geant4\/11.1.3\r\n\r\n~\/path\/to\/my_application\r\n<\/pre>\n<h3>Parallel batch job submission<\/h3>\n<p>From 11.4.0 onwards.<\/p>\n<p>As well as requesting number of cores from SLURM, you will need to specify the number of cores to the code you will run, please refer to the <a href=\"https:\/\/geant4.web.cern.ch\/docs\/\">GEANT4 documentation<\/a> if unsure.<\/p>\n<p>Interactive:<\/p>\n<pre>\r\nsrun -p interactive -n 4 -t 60 --pty bash\r\n\r\nmodule load apps\/gcc\/geant4\/11.1.3\r\n\r\n~\/path\/to\/my_application\r\n<\/pre>\n<p>Batch:<\/p>\n<pre>\r\n#! \/bin\/bash --login\r\n#SBATCH -p multicore     # Run in the \"multicore\" partition (nodes dedicated to >1 core jobs)\r\n#SBATCH -n 4             # Number of cores desired\r\n#SBATCH -t 1-00:00:00    # maximum runtime in D-HH-MM-SS\r\n\r\nmodule purge\r\nmodule load apps\/gcc\/geant4\/11.4.0\r\n\r\n~\/path\/to\/my_application [ARGS]\r\n<\/pre>\n<h2>Further info<\/h2>\n<ul>\n<li>Documentation: <a href=\"https:\/\/geant4.web.cern.ch\/\">Geant4 Website<\/a><\/li>\n<li>Tutorials\/examples are available in <code>$GEANT4DIR\/share\/Geant4\/examples<\/code><\/li>\n<li>GEANT4 datasets available in <code>$GEANT4DIR\/data<\/code><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Overview Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science. The following version is installed on the CSF: Geant4 11.4.0 Geant4 11.1.3 Restrictions on use GEANT4 is not open source software, it has a custom license, which you should read before using GEANT4. GEANT4 is available to all CSF3 users,.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/geant-4\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"parent":86,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2078","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/2078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=2078"}],"version-history":[{"count":20,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/2078\/revisions"}],"predecessor-version":[{"id":11534,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/2078\/revisions\/11534"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/86"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=2078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}