Git Product home page Git Product logo

kaphleamrit2 / geant4-gpu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from studouglas/geant4-gpu

0.0 0.0 0.0 60.46 MB

Port existing GEANT4 particle simulation code to make use of GPU computational power. Software will be used to study particle interactions in a variety of contexts at McMaster and beyond.

Shell 0.06% C++ 93.43% Python 0.38% Perl 0.01% C 0.55% Java 0.02% Fortran 1.48% CSS 0.01% Pawn 0.01% SourcePawn 0.01% Cuda 0.01% Hack 0.26% Makefile 0.47% HTML 1.88% CMake 1.32% GLSL 0.14%

geant4-gpu's Introduction

Porting G4-STORK particle simulation software to GPU

Geant4 is a widely-used software toolkit used to simulate particle interactions with matter. Several members of McMaster's Engineering Physics department have created G4-STORK, a program that uses the Geant4 toolkit to simulate particle interactions in McMaster's nuclear reactor. Due to the computation time needed to run these simulations, they cannot simulate particle interactions that take place over the course of minutes (or even seconds), or that have a large numbers of particles.

The goal of this project is to port some of the calculations done by Geant4 to a GPU architecture using CUDA. This will significantly increase the performance of the simulations, allowing researchers to use more accurate models of the system.

Table of Contents

Prerequisites
Installation
Testing Installation
Compiling After Changes
Troubleshooting
FAQ

Prerequisites

The following software is required:

  • gcc (must be version 4.8 - 4.9)

The following hardware is required:

  • NVIDIA GPU with CUDA compute capability of at least 2.0

Installation

Install cmake

  1. Download cmake 2.8.4 from https://cmake.org/files/v2.8/
  2. Follow the instructions in the Readme included with the download

Install Geant4
If installing on McMaster's servers, add . /opt/rh/devtoolset-3/enable to your bash_profile to use the newer version of gcc.

  1. mkdir /path/to/Geant4-GPU/geant4.10.02-build
  2. mkdir /path/to/Geant4-GPU/geant4.10.02-install
  3. cd /path/to/Geant4-GPU/geant4.10.02-build
  4. cmake -DGEANT4_ENABLE_CUDA=ON -DGEANT4_USE_SYSTEM_EXPAT=OFF -DCMAKE_INSTALL_PREFIX=/path/to/Geant4-GPU/geant4.10.02-install ../geant4.10.02
    IF installing on McMaster's server, you must add flag -DCUDA_HOST_COMPILER=/usr/bin/g++
  5. make install -jN where N is the number of processors on your computer

Installing Geant4 on McMaster's Server (no root privileges)

  1. Clone the repo
  2. Download the latest version of CMake onto your local desktop
  3. Copy the tarred file to McMaster's server via SSH: scp cmake-3.4.0.tar [email protected]:/u50/yourMacId/
  4. Return to your SSH terminal and untar the file (this may take a while): tar -xvf cmake-3.4.0.tar
  5. Build and install cmake: cd cmake-3.4.0;./bootstrap;make;make install
  6. Add cmake's bin folder to your path. Open /u50/yourMacId/.bash_profile and add the following line right before export PATH: PATH=$PATH:$HOME/cmake-3.4.0/bin
  7. Follow the instructions above to "Install Geant4"

Setting Environment Variables
It is recommended to add a line to your bash_profile that loads the Geant4 environment variables when you login, like so:

source /path/to/Geant4.10.02-install/bin/Geant4.sh

Testing Installation

Testing Geant4

Compiling After Changes

Every time you change the source code of Geant4, you need to recompile by running make install from /path/to/Geant4-GPU/geant4.10.02-build

Troubleshooting

Potential problems include:

  • Spaces in pathname to GEANT-GPU
  • Unsupported OS

FAQ

What is Geant4
Many physics researchers use Geant4 to learn about how particles interact with a specific environment. It is a toolkit (i.e. library) that uses the Monte Carlo model, meaning each particle's properties are calculated independently according to certain probabilities. It runs all those calculations, and provides output.

Why will running the simulations on a GPU improve the performance
GPU's contain a large amount of cores that can perform calculations much more quickly than a CPU if the problem is well-suited to parallelization. Geant4 runs relatively simple calculations on millions of particles, and each particle is completely independent of the others. This is exactly that sort of well-suited problem, and stands to see large performance gains.

geant4-gpu's People

Contributors

studouglas avatar fythal avatar scoochflex avatar gorriexiv avatar szymczdm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.