A Boundary Elements Method implementation for Stationary Elastodynamic Problems with GPU Acceleration
Code implemented for a journal paper
Run the script
./deploy.sh
This will download and compile OpenBLAS and MAGMA. No sudo is required.
Inside the src
directory, there is a script named bench.sh
that reproduces the tests. The script analyser.py
plot the time graphics.
This project have mainly three dependencies: OpenBLAS, CUDA and MAGMA. If you do not want to use GPU acceleration, then you only need OpenBLAS. Else all libraries are required.
Download OpenBLAS and untar it. Compile OpenBLAS with the following command:
INTERFACE64=1 USE_OPENMP=1 make -j <num_of_processors>
This will enable 64-bits indexing for very large matrices and OpenMP accelerated BLAS functions.
Having OpenBLAS compiled, download MAGMA and unzip it. Although MAGMA supports a large set of BLAS implementations, we only tested our program with OpenBLAS.
Navigate to the unzipped MAGMA folder, then copy make.inc-examples/make.inc.openblas
to make.inc
. After that, find a block of text containing:
CFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -fopenmp
FFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -Wno-unused-dummy-argument
F90FLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input
NVCCFLAGS = -O3 -DNDEBUG -DADD_ -Xcompiler "$(FPIC)"
LDFLAGS = $(FPIC) -fopenmp
Modify it to
CFLAGS = -O3 -DMAGMA_ILP64 $(FPIC) -DNDEBUG -DADD_ -Wall -fopenmp
FFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -Wno-unused-dummy-argument
F90FLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input
NVCCFLAGS = -O3 -DMAGMA_ILP64 -DNDEBUG -DADD_ -Xcompiler "$(FPIC)"
LDFLAGS = $(FPIC) -fopenmp
Also set the variable OPENBLASDIR
with the path to the extracted and compiled OpenBLAS; and set CUDADIR
to where you installed the CUDA library files. Adding -DMAGMA_ILP64
enables 64-bit indexing for very large matrices. Then compile it with
make dense
Currently we support both CPU-only and GPU-accelerated modes. The project only supports Linux AMD64 with gcc >= 4.8, nvcc >= 8.0 and gfortran >= 4.8.
For CPU-only, compile the OpenBLAS library as described above, update the variable OPENBLASDIR
inside Makefile
with the path to the compiled OpenBLAS folder, and compile the project with the command: FRPEC=double make
. You can also compile with FRPEC=float make
for single precision.
Compile both OpenBLAS and MAGMA as described above, update both variables OPENBLASDIR
and LIBMAGMADIR
inside Makefile
wiith the path to the compiled OpenBLAS and MAGMA folders, respectively. Compile the project with the command FRPEC=double make gpu
. You can also compile with FRPEC=float make gpu
for single precision.
Currently, We only support NVIDIA GPUs with Compute Capability > 3.0. Check your card specifications. Note that some low-end GPUs are based on older NVIDIA architecture (like the GeForce GT 630M, that is Fermi-based), so make sure you have the required hardware.
./main <INPUT_STATIC> <INPUT_DYNAMIC> <OUTPUT_STATIC> <OUTPUT_DYNAMIC>
If the parameters provided are incorrect, the program will default to the files used while testing.
Run the script
./tests.sh
The tests requires the GPU-accelerated mode.
The paper is available on ScienceDirect here.