Skip to content

giulianobelinassi/BEM-MECECCS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Boundary Elements Method implementation for Stationary Elastodynamic Problems with GPU Acceleration

Code implemented for a journal paper

Quick Install:

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.

Dependencies

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.

1. OpenBLAS

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.

2. MAGMA

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

Compiling the project

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.

1. CPU-Only

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.

2. GPU-accelerated

Compile both OpenBLAS and MAGMA as described above, update both variables OPENBLASDIR and LIBMAGMADIR inside Makefilewiith 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.

Executing the project.

./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.

Automated tests.

Run the script

./tests.sh

The tests requires the GPU-accelerated mode.

White paper

The paper is available on ScienceDirect here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published