-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Lolle2001/master
Master
- Loading branch information
Showing
101 changed files
with
1,877 additions
and
128,604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
data | ||
data/** | ||
output | ||
bin | ||
input/* | ||
bin/** | ||
input/** | ||
.vscode | ||
token | ||
build | ||
*.job | ||
!example.job | ||
|
||
!input/default.par | ||
!input/test.par | ||
src/binaries/** | ||
!src/binaries/ampt-v1.26t9b-v2.26t9b.zip | ||
src/test | ||
src/original_up | ||
ampt-mp | ||
|
||
!input/ampt@default.par | ||
# !input/test.par | ||
|
||
|
||
utils/__pycache__ | ||
# utils/centrality_tables | ||
|
||
|
||
utils/process.sh | ||
|
||
|
||
!data/.gitignore | ||
|
||
server | ||
|
||
src/inputgen.py | ||
|
||
utils/utilsold | ||
utils/runold | ||
runold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,40 @@ | ||
# This CITATION.cff file was generated with cffinit. | ||
# Visit https://bit.ly/cffinit to generate yours today! | ||
|
||
cff-version: 1.2.0 | ||
message: "If you use this software, please cite it as below. Please also cite Zi-Wei Lin" | ||
title: File handling and multiprocessing framework for AMPT | ||
message: Please cite this software and the preferred citation. | ||
type: software | ||
authors: | ||
- family-names: Huisman | ||
given-names: Lieuwe | ||
title: "Wrapper for AMPT Multiprocessing" | ||
version: 3.0.0 | ||
date-released: 2024-02-27 | ||
- given-names: Lieuwe Johannes | ||
family-names: Huisman | ||
repository-code: "https://github.com/Lolle2001/AMPT-Processing" | ||
abstract: >- | ||
This framework is a crude way of running multiple | ||
instances of AMPT simultaneously. To achieve that it | ||
handles files, compilation and moves results to a desired | ||
directory. | ||
keywords: | ||
- AMPT | ||
- Multiprocessing | ||
- Framework | ||
- Heavy ion collisions | ||
license: MIT | ||
version: 1.0.0 | ||
date-released: "2024-07-20" | ||
references: | ||
- type: thesis | ||
authors: | ||
- given-names: Lieuwe Johannes | ||
family-names: Huisman | ||
title: "Characterization of QGP, A comparison between a fluid dynamical approach and transport approach." | ||
thesis-type: BsC | ||
department: Departement Natuurkunde | ||
institution: | ||
name: Universiteit Utrecht | ||
city: Utrecht | ||
country: NL | ||
database: Utrecht University Student Theses Repository | ||
date-published: 2024-07-20 | ||
year: 2024 | ||
url: https://studenttheses.uu.nl/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Lieuwe Huisman | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,120 @@ | ||
# AMPT-Processing | ||
This repositery contains code for running AMPT on multiple cores and processing the (large amount of) data into useful results. Currently it only gives data in a format used for my bachelor thesis. The goal is to convert the AMPT data into histograms, binned into centrality, participating nuclei, transverse momentum and (pseudo)rapidity, for every particle. This converts large amounts of data into a workable format which can be stored in RAM. | ||
# AMPT-FHMPF | ||
|
||
## Running AMPT | ||
> [!IMPORTANT] | ||
> This code was developed for my thesis. If you use/fork this code, please use the following citation in your work:<br><br> | ||
> L. J. Huisman, _File handling and multiprocessing framework for AMPT_, version 1.0.0 (2024). https://github.com/Lolle2001/AMPT-Processing <br><br> | ||
> In addition, AMPT must also be cited, because AMPT source code comes with this repository[^1]. | ||
# | ||
|
||
## :rocket: About | ||
|
||
This repositery contains code for running the single-threaded AMPT model (A Multi-Phase Transport model) on multiple cores[^1]. It includes: | ||
|
||
- Compilation of different versions | ||
- File handling of results | ||
- Generation of input files | ||
|
||
## :wrench: Installation | ||
|
||
### Dependencies | ||
|
||
Installation of **fmt** can be done in two ways: | ||
|
||
### Compiling | ||
Compiling can be done in two ways. One way uses the script ```compile.sh``` in the main folder. This script compiles version `v1.26t9b-v2.26t9b` of AMPT (from [here](https://myweb.ecu.edu/linz/ampt/)). It has one parameter to define the amount of bins that should be created. Because AMPT is inherently a single threaded program, every core needs a seperate directory in which the data is stored. . Example of use: | ||
```shell | ||
bash compile.sh numberofbins | ||
sudo add-apt-repository universe | ||
sudo apt update | ||
sudo apt install libfmt-dev | ||
``` | ||
The other way is to compile the code in a more advanced way. This can be done with `utils/createbins.sh`. It has three parameters: the first two designate the indices of the first and last bin that should be created. The third parameter is the name of the directory in ```./src``` that contains the fortran files of ampt. This way one can choose which version to use and it allows for bins to have different source codes. Example of use: | ||
|
||
or | ||
|
||
```shell | ||
bash utils/createbins.sh startbin endbin sourcecode | ||
git clone https://github.com/fmtlib/fmt.git | ||
cd fmt | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
sudo make install | ||
``` | ||
If this second way is used, then one must define the directories in `utils/directories.sh` before running AMPT. | ||
|
||
An overview of the different source codes included in the repo is listed below: | ||
* currently the source code is based on version ```ampt-v1.26t9b-v2.26t9b```, which can be found at this [website](https://myweb.ecu.edu/linz/ampt/). | ||
* ```original``` is the original, unedited source code of the above described version. | ||
* ```ellipticflow``` is an edited version which at the end calculates elliptic flow properties (from ```ana/ampt.dat``` and ```ana/zpc.dat```) and puts them in a folder ```ana1```. | ||
* ```edited``` is a version that generates animation files, these can become quite large quickly and also make the simulations go very slow. These files are also put in ```ana1```. For animations it is recommended to only run 1 event. | ||
Installation of **argparse** can be done in the following way: | ||
|
||
### Updating | ||
When updating the bin directories one can use the command below in a similar fashion as above: | ||
```shell | ||
bash utils/recompile.sh startbin endbin sourcecode | ||
git clone https://github.com/p-ranav/argparse.git | ||
cd argparse | ||
cd build | ||
cmake .. | ||
make -j 4 | ||
sudo make install | ||
``` | ||
### Running | ||
The code can be run (in the background) by using the command: | ||
|
||
> [!NOTE] | ||
> Make sure that installation with git clone is done in for example downloads or another directory. In addition, make sure that the libraries are correctly added to the path. On Ubuntu this is done automatically. | ||
### Compilation | ||
|
||
The program is called **ampt-mp** and needs to be compiled with **C++17**. In addition the **[fmt](https://github.com/fmtlib/fmt)**, **[argparse](https://github.com/p-ranav/argparse)** and **[OMP](https://github.com/OpenMP/sources)** libraries were used. **OMP** is part of most compilers (see list [here](https://www.openmp.org/resources/openmp-compilers-tools/)) and does not have to be installed. The program is compiled as follows, | ||
|
||
```shell | ||
bash rampt.sh inputfile runnumber startbin endbin &! | ||
bash compile-ampt-mp.sh | ||
``` | ||
* ```inputfile``` the name of the inputfile with the specified parameters for AMPT. | ||
* ```runnumber``` the identification for the run. | ||
|
||
* ```startbin``` the ampt bin directory in which to start. | ||
* ```endbin``` the ampt bin directory in which to end. | ||
* Data will be moved to the directory ```./datafolder/runnumber.``` into subdirectories corresponding to the used bins. | ||
* There will be three files: ```runnumber.log```, ```runnumber.err```, ```runnumber.time``` | ||
* ```runnumber.log``` gives a general overview of the settings for running the code, including the total number of events, used directories and runtime. | ||
* ```runnumber.err``` gives encountered errors. | ||
* ```runnumber.time``` summarises the runtime. | ||
* Similarly each subdirectory also has these log files, giving the output of the `./ampt` executable and runtime. | ||
|
||
If one desires to run a batch of jobs one can generate a `.job` file with consecutive executions of the above. The default can be executed as: | ||
```shell | ||
bash ampt.job &! | ||
|
||
## :books: Documentation | ||
|
||
### Running AMPT | ||
|
||
Using multiple bash scripts does not allow for a good readable code and can cause problems when it comes to file handling. For that reason a **C++** version was developed, which handles the running and compilation. Additional advantages are that command line parsing is easy to setup and that extra functionality was added with respect to the previous method. | ||
|
||
By default it is assumed that all input files are in the directory `./input`, the source is in `./src/original` and the data is stored in `./data`. A compiled program will give the following structure to the program folder: | ||
|
||
``` | ||
Note that first the file must be generated with `utils/inputgen.py`, which is a selfexplanatory code, that must be edited to get desired input files. It can be ran using: | ||
```shell | ||
python3 utils/inputgen.py | ||
AMPT | ||
├── bin | ||
│ ├── ampt-1 | ||
│ ├── ampt-2 | ||
│ ├── ... | ||
│ ├── ampt-n | ||
│ ├── anim-1 | ||
│ └── ... | ||
├── input | ||
│ └── *.par | ||
├── data | ||
│ ├── run-1 | ||
│ ├── run-2 | ||
│ └── ... | ||
├── src | ||
│ ├── original | ||
│ ├── animation | ||
│ ├── hijing-only | ||
│ └── ... | ||
└── ampt-mp | ||
``` | ||
|
||
At first use, the following commands can be ran in the terminal. | ||
|
||
``` | ||
./ampt-mp -h # See options for compiling AMPT | ||
./ampt-mp -h # See options for running AMPT | ||
./ampt-mp compiler -b 1 12 # Compiles every bin with the given source code | ||
./ampt-mp -o test -b 1 12 # Runs AMPT in every bin and stores the data in ./data/test | ||
``` | ||
|
||
> [!WARNING] | ||
> The program has problems with racing conditions, causing a spread in the runtime of seperate instances even when they run the exact same simulation. | ||
### Versions | ||
|
||
By default this framework uses the original AMPT code of version [`v1.26t9b-v2.26t9b`](https://myweb.ecu.edu/linz/ampt/)[^1]. Various modifications have been made in this code. All the frotran files are stored in subfolders of the `src` directory. These are the current options: | ||
|
||
- **original**: Contains the original AMPT code (_v1.26t9b-v2.26t9b_). | ||
- **animation**: Contains a modified version, where animation output is enabled. | ||
- **hijing-only**: Contains a modified version, where all components except for hijing have been disabled to obtain geometrical information faster. | ||
|
||
### Input generation | ||
|
||
## Data processing | ||
### Processing methods | ||
There are two methods to process data from AMPT: | ||
* The first is that one can read all (desired) datafiles into a data-object and then combining all the events from the different bin directories. When working with a small amount of events and not generating large files (with for example the IOSCAR=3 option or animation source code) this method works quick and allows for a nice workflow with ROOT. | ||
* A different method is needed when many events are ran, the file sizes can be too big to have them stored in memory using data objects. In that case one has to process data line by line using a parse function of the data object. Summarised data containing information about the observables listed below can then be written into files. This process can take a little longer and it would be beneficial to multiprocess this properly. This summarised data is generated per event and per particle. The form of the code should allow for trivial modification to add functions in the parse function that calculated other desired observables. | ||
### Observables | ||
* Particle Yields | ||
* Average taken over number of events. | ||
* Calculated for each particle seperately (gives option to combine later if desired). | ||
* Partitioned in centrality bins. | ||
* Only for the $\left \lvert\eta\right \rvert>0.5$ pseudorapidity bin. | ||
* Pseudorapidity Distribution | ||
* Average taken over number of events. | ||
* Calculated for each particle seperately. | ||
* Partitioned in centrality bins. | ||
* Histogram has even binning. | ||
* Transverse Momentum Distribution | ||
* Average taken over number of events. | ||
* Calculated for each particle seperately. | ||
* Partition in centrality bins. | ||
* Histogram has logarthmic binning (similar to that used in ALICE articles for easy comparison). | ||
* Elliptic Flow (and other Flow Coëfficiënts) | ||
* Average taken over total number of particles in all events. | ||
* Calculated for all charged particles (currently). | ||
* Partitioned in centrality bins. | ||
* Only for the $\left \lvert \eta \right \rvert>0.5$ pseudorapidity bin and $0.1 < p_T < 4$ GeV/c transverse momentum bin. | ||
* Transverse Mass Distribution | ||
* [WIP] | ||
* Energy Density Evolution | ||
* [WIP] | ||
* Particle Number Density Evolution | ||
* [WIP] | ||
* Particle Number Evolution | ||
* Both for partons and hadrons. | ||
* [WIP] | ||
* Collision Animation | ||
* Can be combind with particle number evolution. | ||
|
||
## Remarks | ||
* Simulations can be done seperately for different centralities or for all centralties at once. The first assures that each centrality bin has the same amount of events. The second distributes the impact parameter according to the Glauber model. | ||
* Binning for the pseudorapidity and transverse momentum distributions can also be made in small steps. This allows for combining the bins afterwards, to allow a more flexible data processing without having to reproces the large dataset. | ||
* Evolution data should be done for single (or if you are brave enough a small number of) events. | ||
A python script has been created to generate input files. It is located in the `utils` folder. It allows for modification of the desired parameters and gives the option to generate multiple files for multiple centrality bins by using a table. The created parameter file contains the corresponding variable names and their original descriptions. | ||
|
||
[^1]: Z. W. Lin, C. M. Ko, B. A. Li, B. Zhang and S. Pal, A Multi-phase transport model for relativistic heavy ion collisions. Phys. Rev. C 72, 064901 (2005). https://doi.org/10.1103/PhysRevC.72.064901 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
make -f make/Makefile -j 12 |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#! /usr/bin/env bash | ||
bash compile-ampt-mp.sh | ||
./ampt-mp compiler -in ampt -b 1 4 -s original -sd src -bd bin | ||
./ampt-mp -i ampt@default.par -o AuAu@200GeV-S1-C1-00-005-Test -in ampt -b 1 4 | ||
|
Oops, something went wrong.