Skip to content

Commit 8aeefd5

Browse files
committed
Added readme for GPU project
1 parent e090656 commit 8aeefd5

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Projects
5353
projects/compression.rst
5454
projects/second_order.rst
5555
projects/monodomain.rst
56+
projects/GPU.rst
5657

5758

5859
API documentation

docs/source/projects/GPU.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: /../../pySDC/projects/GPU/README.rst
Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
pySDC using GPUs
2-
===================
2+
================
3+
34
Installation
45
------------
5-
In order to start playing on GPU, install `pySDC` and it's dependencies, ideally in developer mode.
6+
In order to start playing on GPU, install `pySDC` and its dependencies, ideally in developer mode.
67
First start by setting up a virtual environment, e.g. by using [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
78
Then also add the CuPy Package (the cuda-toolkit will be installed automatically):
89

@@ -13,28 +14,49 @@ Then also add the CuPy Package (the cuda-toolkit will be installed automatically
1314
When this is done (and it can take a while), you have your setup to run `pySDC` on the GPU.
1415

1516
Changes in the problem_classes
16-
------------
17+
------------------------------
1718
Now you have to change a little bit in the problem_classes. The first and easy step is to change the datatype.
1819
To use pySDC on the GPU with CuPy you must use the [cupy-datatype](../../implementations/datatype_classes/cupy_mesh.py).
1920
The next step is to import cupy in the problem_class. In the following you have to exchange the NumPy/SciPy functions with the CuPy functions.
2021
A [Comparison Table](https://docs.cupy.dev/en/latest/reference/comparison.html) is given from CuPy to do that.
21-
For Exmaple: The above steps can be traced using the files
22+
For example: The above steps can be traced using the files
2223
[HeatEquation_ND_FD_forced_periodic.py](../../implementations/problem_classes/HeatEquation_ND_FD_forced_periodic.py)
2324
and [HeatEquation_ND_FD_forced_periodic_gpu.py](../../implementations/problem_classes/HeatEquation_ND_FD_forced_periodic.py)
2425
Now you are ready to run `pySDC` on the GPU.
2526

2627
Run pySDC on the GPU
27-
------------
28-
You have to configure a Script to run it. You can see at the file [heat.py](heat.py) that the parameters are the
28+
--------------------
29+
You have to configure a script to run it. You can see at the file [heat.py](heat.py) that the parameters are the
2930
same for GPU and CPU. Only the import for the problem_class changed.
3031

31-
32-
3332
More examples
34-
----------
33+
-------------
3534
Further examples can found with Allen-Cahn:
3635
* problem: [AllenCahn_2D_FD.py](../../implementations/problem_classes/AllenCahn_2D_FD.py) and [AllenCahn_2D_FD_gpu.py](../../implementations/problem_classes/AllenCahn_2D_FD_gpu.py)
3736
* problem: [AllenCahn_2D_FFT.py](../../implementations/problem_classes/AllenCahn_2D_FFT.py) and [AllenCahn_2D_FFT_gpu.py](../../implementations/problem_classes/AllenCahn_2D_FFT_gpu.py)
3837
* Script to run pySDC: [ac-fft.py](ac-fft.py)
3938

4039

40+
Running large problems on GPU
41+
-----------------------------
42+
This project contains some infrastructure for running and plotting specific problems.
43+
The main file is `run_experiment` and can be configured using command line arguments.
44+
For instance, use
45+
46+
.. code-block:: bash
47+
48+
srun -n 4 python work_precision.py --config=GS_USkate --procs=1/1/4 --useGPU=True --mode=run
49+
mpirun -np 8 python work_precision.py --config=GS_USkate --procs=1/1/4 --useGPU=True --mode=plot
50+
python work_precision.py --config=GS_USkate --procs=1/1/4 --useGPU=True --mode=video
51+
52+
to first run the problem, then make plots and then make a video for Gray-Scott with the U-Skate configuration (see arXiv:1501.01990).
53+
54+
To do a parallel scaling test, you can go to JUWELS Booster and use, for instance,
55+
56+
.. code-block:: bash
57+
python analysis_scripts/parallel_scaling.py --mode=run --scaling=strong --space_time=True --XPU=GPU --problem=GS
58+
srun python analysis_scripts/parallel_scaling.py --mode=plot --scaling=strong --space_time=True --XPU=GPU --problem=GS
59+
60+
This will generate jobscripts and submit the jobs. Notice that you have to wait for the jobs to complete before you can plot them.
61+
62+
To learn more about the options for the scripts, run them with `--help`.

0 commit comments

Comments
 (0)