If you want to compile and run the codes from this repository within the OGUN supercomputer, follow these steps:
- Allocate a node and use the ssh key to access its resources:
salloc -p gpu -N 1 -A <group-name>
ssh cgpu1
- Load the necessary modules to run and compile the codes:
module load intel/oneapi/compiler/2023.0.0 intel/oneapi/dpct/2023.0.0 cmake cuda cwp
If you want to compile and run the codes from this repository within normal UBUNTU linux distribution, follow these steps:
- First, start DPC++ environment:
source /opt/intel/oneapi/setvars.sh
- Install the necessary packages to run and compile the codes:
sudo apt-get install libxt-dev xorg libx11-dev
The source of the simples codes in CUDA and DPC++ are inside,respectively, the folders cuda_refenrence_stencil_computation, dpct_migrated_stencil_computation and dpct_migrated_stencil_computation_with_buffers.
To these simple codes there is no need to compile a library.
There is a Makefile inside the folder that can used to compile. To use the make command you need to be inside the folder that contains Makefile. An executble file is created inside the current folder.
cd cuda_reference_stencil_computation
make clean
make
There is a Makefile inside the folder that can used to compile. To use the make command you need to be inside the folder that contains Makefile. An executble file is created inside the current folder. Compile the code with the commands:
cd dpct_migrated_stencil_computation
make clean
make
Is the same way to run CUDA and DPC++ codes. The images generated by the code will be inside the current directory.
./stencil_code ./input.dat
The folders of RTM codes in CUDA and DPC++ has four subdirectories: library (lib), velocity models (models), output and source (src).
To compile and run the RTM code needs fist compile a library that has some auxilary functions. There is a build.sh file in lib/src that can executed to compile these fuctions, to execute build.sh type the command inside repository root folder:
cd cuda_reference_RTM/lib/src/
make clean
make
If the compilation has finished without errors and produced an libsource.a in lib folder.
There is a build.sh file in src that can executed or you can use make in the same path. To use build.sh file or the make command you need to be inside the folder that contains Makefile. An executble file is created inside the current folder.
cd ../..
make clean
make
To compile and run the RTM code needs fist compile a library that has some auxilary functions. There is a build.sh file in lib/src that can executed to compile these fuctions, to execute build.sh type the command inside repository root folder:
cd dpct_migrated_RTM/lib/src
make clean
make
If the compilation has finished without errors and produced an libsource.a in lib folder.
There is a build.sh file in src that can executed or you can use make in the same path. To use build.sh file or the make command you need to be inside the folder that contains Makefile. An executble file is created inside the current folder.
cd ../..
make clean
make
Is the same way to run CUDA and DPC++ codes. The images generated by the code will be inside the output directory.
./rtm_code ./models/<choose a model>/input.dat
You may notice that some flags are missing in the compilation command in DPC ++ , only one flag match was found: --fmad = false. This flag was inserted in the main function of the source code in DPC++: __MM_SET_DENORMALS_ZERO_MODE(MM_DENORMALS_ZERO_ON);
To compile and run the RTM code needs fist compile. To compile go to src folder, and run make allclean, so run make. You need to be inside the folder that contains the file. If the compilation has finished without errors will are produced two executable files on build folder mod_main and rtm_main in build folder. TO do that, execute this commands:
cd dpct_gpu_rtm_domain_division/lib/cwp/
sh install.sh
Then type "y" and "enter".
cd ../../src
make clean
make
cd ..
Before run rtm_main, you need to run modeling step:
cd build/<choose_a_model>
../mod_main par=input.dat
After you can run normally the migration step:
../rtm_main par=input.dat