-
Notifications
You must be signed in to change notification settings - Fork 11
How to perform PyECLOUD PyHEADTAIL simulations
PyECLOUD can be used in combination with PyHEADTAIL to simulate in a self-consistent manner the interaction of the particle beam circulating in an accelerator ring with multiple e-clouds.
This is done by using the PyECLOUD.PyEC4PyHT module to instantiate e-cloud elements that can be installed in a PyHEADTAIL ring.
These simulations can be computationally very intensive. In order to speed-up the simulation it is possible to resort to parallel computing. This is done by a separate package PyPARIS which handles the parallelization.
As setting up such a simulation from scratch can be quite cumbersome, we provide simulation packages with ready-to-use simulations, which can be configured through a simple input file. The packages are
- PyPARIS_sim_class for single-bunch instability simulations;
- PyPARIS_CoupledBunch_sim_class for coupled-bunch instability simulations.
A simple procedure on how to setup a single-bunch e-cloud instability using PyPARIS_sim_class simulation is illustrated in the following (similarly coupled-bunch simulations can be setup using PyPARIS_CoupledBunch_sim_class).
If you don't have it yet, please install the PyECLOUD-PyHEADTAIL suite following the instruction available here. We assume that the tools are installed in /home/user/tools
.
Make sure that the packages are in the PYTHON_PATH. They can be added by typing:
export FOLDER_WITH_PACKAGES=/home/user/tools
export PYTHONPATH=$FOLDER_WITH_PACKAGES:$FOLDER_WITH_PACKAGES/PyHEADTAIL:$FOLDER_WITH_PACKAGES/NAFFlib:$PYTHONPATH
Create a folder for the simulation:
mkdir /home/user/Desktop/ecloud_instab_simulation
cd ecloud_instab_simulation
Copy one of the example simulations of PyPARIS_sim_class:
cp -r /home/user/tools/PyPARIS_sim_class/examples/001b_simulation_with_eclouds_synchrotron/* .
The simulation configuration can be changed by editing the input file Simulation_parameters.py. A detailed description of the different parameters can be found in a dedicated documentation page.
To run the simulation on a single CPU-core, execute:
bash 000_run_serial.sh
To run the simulation on multiple CPU-core on a single compute (node) using python-multiprocessing, execute:
bash 001_run_multiproc.sh
You can edit the script to increase the number of CPU-cores. Using 8 cores is advisable for this simulation.
To run the simulation on multiple CPU-core on multiple interconnected computers using mpi4py, execute:
bash 002_run_MPI.sh
You can edit the script to increase the number of CPU-cores. 8 cores are advised for this simulation.
At the end of the simulation, basic plots of the output results can be made by executing:
python 004_some_checks.py