Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • CodeursIntensifs/grayscott/GrayScottSyclSetup
1 result
Show changes
Commits on Source (2)
......@@ -2,3 +2,4 @@ build
*.o[0-9]*
*.e[0-9]*
CMakeLists.txt
*.sif
......@@ -3,7 +3,7 @@
# Gray-Scott with SYCL
## SYCL Setup
## SYCL Setup : DO IT BEFOREHAND !
With SYCL, you benefit from easier coding of portable parallel code... and typically suffer from harder setup. This document try to help.
......@@ -15,28 +15,26 @@ Be aware that the basic Intel oneAPI installation will only see the Intel hardwa
Also, most of our instructions and utility scripts assume you are running a bash shell.
The following alternative platforms are proposed:
The following alternative strategies are proposed in priority:
- [Code Reckons](SetupInstructions/code-reckons.md)
- [Intel DevCloud](SetupInstructions/intel-devcloud.md)
- [Intel oneAPI Base Toolkit Docker images](SetupInstructions/intel-docker.md)
- [Intel oneAPI Base Toolkit bare-metal installation](SetupInstructions/bare-metal.md)
- *UNDER WORK* Annecy MUST center:
- [Introduction au centre de calcul MUST](https://cta-lapp.pages.in2p3.fr/COURS/INTRODUCTION_MUST/)
- [MUST center documentation](https://doc.must-datacentre.fr/)
- [Docker images of Intel oneAPI Base Toolkit](SetupInstructions/intel-docker.md)
- [Bare-metal installation of Intel oneAPI Base Toolkit ](SetupInstructions/bare-metal.md)
Those alternatives nicely provide an integrated Visual Studio Code Server, but they have been less tested, due to a lack of time:
- [With apptainer](SetupInstructions/apptainer.md)
- [Annecy MUST center](SetupInstructions/must.md)
## Gray-Scott in a nutshell
We let you investigate on your own the details of the chemical background for the Gray-Scott reaction.
For what concerns this tutorial, just retain that we must iterativaly modify two images, one which is the grid
of the U values, and the other which is the grid of the V values.
For what concerns this tutorial, just retain that we must iterativaly modify two images, one which is the grid of the U values, and the other which is the grid of the V values.
For each iteration, each pixel will evolve depending on the values of U and V
in their neighbourhood, what is often called a "stencil algorithm".
For each iteration, each pixel will evolve depending on the values of U and V in their neighbourhood, what is often called a "stencil algorithm".
For the needs of this tutorial, we will consider the 8 immediate neighbours,
and those parameters will be fixed (pseudo-code):
For the needs of this tutorial, we will consider the 8 immediate neighbours, and those parameters will be fixed (pseudo-code):
```
DIFFUSION_RATE_U = 0.1
DIFFUSION_RATE_V = 0.05
......@@ -45,7 +43,9 @@ FEED_RATE = 0.03
DT = 1.0
```
Given the pixel row `r`, and the pixel column `c`, one iteration may be written (pseudo-code):
So to start the chemical reaction, we drop some V in a central area of the grid. The arbitrary drop size is 4x6, which results in 0 values in the U grid, and 1 values in the V grid.
Then we compute step by step the evolution of U and V. Given the pixel row `r`, and the pixel column `c`, one iteration may be written (pseudo-code):
```
for ( dr : -1, 0, 1 )
......
# Work with VSCode and Apptainer
Those images have been prepared by Pierre Aubert. They integrate a Visual Studio Code Server that let you edit the code with your local internet browser:
- [for CPU only](docker://gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_micromamba_code_server) (2.89 GiB).
- [+ CUDA](docker://gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_cuda_micromama_code_server) (5.29 GiB).
Here are some dedicated instructions:
- [work on your local computer](https://gray-scott-lecture-demo-cta-lapp-cours-ab680a08433fbc37f8ada3ea.pages.in2p3.fr/1-73.html).
- [work on a remote server](https://gray-scott-lecture-demo-cta-lapp-cours-ab680a08433fbc37f8ada3ea.pages.in2p3.fr/2-178.html).
BEWARE:
- Due to lack of time, those configurations have been less tested than the others.
- Those images includes a copy of this repository which is obsolete, and whatsoever do not include the pedagogical material which comes from other repositories. Ignore the copy in the image and make fresh new clones.
## Run on your local computer
If you prefer to work on your own laptop, check this:
```sh
apptainer pull docker://gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_cuda_micromama_code_server
apptainer run --writable-tmpfs gray_scott_sycl_ubuntu_cuda_micromama_code_server_latest.sif micromamba run code-server
```
This should run a Visual Studio Code server, which you can open in your browser. The output of the last command above gives you the url and where to find the password.
## Run on a remote server
Just like above, but you must first connect ssh and option swhich will forward the port of the Visual Studio Code Server to your local computer. For example:
```sh
ssh -L 127.0.0.1:8080:127.0.0.1:8080 my-server-name
```
## Check SYCL
Once you have a Visual Studio Code Server running, a terminal, and a fresh clone of this repository, you can check the installation with commands similar to:
```sh
# move to the top directory
cd GrayScottSyclSetup/CheckOneApi
# check CPU nodes
sycl-ls
./intel.bash # give the list of available devices
./intel.bash 1 # check the results of device 1
# Check GPU nodes
nvidia-smi
./cuda.bash # give the list of available devices
./cuda.bash 4 # give the list of available devices
exit
```
\ No newline at end of file
# [Online Code Reckons compiler](https://codereckons.com/tools)
If you have an account on Code Reckons, you can simply copy/paste your code in the [online compiler](https://codereckons.com/tools). Just make sure to **select the ICPX compiler**.
The first 50 registered users to Gray-Scott School will gain a free access to the CodeReckons web site.
If you have such an account, you can simply copy/paste your code in the [online compiler](https://codereckons.com/tools). Just make sure to **select the ICPX compiler**.
Tip: so to see the output of your program, in your C++ source window, ask for "Add new... Execution Only".
......
# Running on Intel DevCloud
# Use of Intel DevCloud
Provided you have asked for an account ahead of time, on the [Intel Tiber Developer Cloud for oneAPI](https://devcloud.intel.com/oneapi/home/), and made the Intel recommended local ssh installation, that is how you may run the tests with `qsub`:
......
# Running Intel oneAPI with docker
# Use of Intel oneAPI docker image
If you want to run within a container, a set of predefined images are usable:
- the [default oneAPI image](intel/oneapi-basekit) (4.26 GiB) which see your Intel CPU and iGPU.
- a ["smaller" oneAPI image](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/jfalcou:2024.1) (2.29 GiB) which only see your Intel CPU.
- a ["bigger" oneAPI image](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/dchamont:2024.1) (5.29 GiB) which add the NVidia codeplay plugin, and therefore also see your NVidia card, if you have one.
- [default oneAPI image](intel/oneapi-basekit) (4.26 GiB): see your Intel CPU and iGPU.
- [small one](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/jfalcou:2024.1) (2.29 GiB): only see your Intel CPU.
- [big image](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/dchamont:2024.1) (5.29 GiB): with CUDA and the NVidia codeplay plugin.
IMPORTANT: our images only includes the external software needed for the SYCL pratices, and not the pedagogical material from this repository and its brothers. You must `git clone` them yourself, either before starting the container, them you need to mount the directory in the container, or after starting the container, them you clone directly in the container, provded it has access to the internet.
We recommend you to start your container with the following command, which sets some useful options for Intel GPU (`--device=/dev/dri`) and|or NVidia card (`--gpus all`), and mount the current directory as `/work` in the container:
```sh
cd GrayScottSyclSetup/
IMG=gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/dchamont:2024.1
docker pull ${IMG}
docker run --gpus all --device=/dev/dri --network host -it --rm -v ${PWD}:/work -w /work ${IMG}
```
First check that the installation is OK with `sycl-ls`, and `nvidia-smi` if you have a CUDA card.
Then you can go through the test program for CPU and|or CUDA:
First check that the installation is OK with `sycl-ls`, and `nvidia-smi` if you have a CUDA card. Then you can go through the test program for CPU and|or CUDA:
```sh
# move to the top directory
......
# Work on Annecy MUST center
General information:
- [Introduction au centre de calcul MUST](https://cta-lapp.pages.in2p3.fr/COURS/INTRODUCTION_MUST/)
- [MUST center documentation](https://doc.must-datacentre.fr/)
BEWARE:
- Due to lack of time, those configurations have been less tested than the others.
- The images below includes a copy of this repository which is obsolete, and also do not include the pedagogical material which comes from other repositories. Ignore the copy in the images and make fresh new clones of the required git repositories.
## Run SYCL with the MUST HTCondor job scheduler
Two light images have been prepared for the HTCondor job scheduler of the MUST center:
- [for CPU only](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_light) (2.43 GiB).
- [+ CUDA](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_cuda_light) (5.07 GiB).
Dedicated instructions are [here](https://gray-scott-lecture-demo-cta-lapp-cours-ab680a08433fbc37f8ada3ea.pages.in2p3.fr/3-313.html).
## Run SYCL on the MUST [Jupyter Kubernetes Cloud](https://jupyter.must-dc.cloud/)
Two images have been prepared for the JupyterHub of the MUST center (but not fully tested):
- [for CPU only)](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_micromamba_vscode) (2.99 GiB).
- [+ CUDA](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/gray_scott_sycl_ubuntu_cuda_micromama_vscode) (5.39 GiB).
Dedicated instructions are [here](https://gray-scott-lecture-demo-cta-lapp-cours-ab680a08433fbc37f8ada3ea.pages.in2p3.fr/4-478.html).
## Check SYCL
Once you have a Visual Studio Code Server running, a terminal, and a fresh clone of this repository, you can check the installation with commands similar to:
```sh
# move to the top directory
cd GrayScottSyclSetup/CheckOneApi
# check CPU nodes
sycl-ls
./intel.bash # give the list of available devices
./intel.bash 1 # check the results of device 1
# Check GPU nodes
nvidia-smi
./cuda.bash # give the list of available devices
./cuda.bash 4 # give the list of available devices
exit
```