The serial codes are stored in src folder. The four .cpp files for different cases are named as:
time_dependent_v.cpp
time_dependent_w.cpp
time_dependent_gauss.cpp
time_dependent_gauss_w.cpp
Open any one of the .cpp files, there are a few parameters that can be adjusted.
#define NLEV
allows you to adjust the total layers being used.
output = fopen(...)
can be modified for different file names. If ran, the time consumption will be stored in the file.
p.Lmax
variable controls the size of the grid, 8 means 512*512 grid.
To run the code, just make
and run the corresponding executables.
The MPI code is in the mpi_new folder.
The parameters can also be changed like the serial code.
The .cpp files are named as:
time_dependent_v_mpi_mg.cpp
time_dependent_w_mpi_mg.cpp
To compile, first load the modules:
module load intel/2018
module load openmpi/3.0.0_intel-2018
Then make
.
The compiled executables are mpi_v
and mpi_w
.
To run, use:
mpirun -np 4 NAME
The OpenACC code is in the openACC folder.
The parameters can also be changed like the serial code.
The .cpp files are named as:
time_dependent_v_acc.cpp
time_dependent_w_acc.cpp
To compile, first load the module:
module load pgi/18.4
Then make -f makeACC
.
The compiled executable is named as test
.
To run, first ask for a gpu on scc.
Then simply run test
.