Installation
- Clone repository
- create build folder
cd library
mkdir build
cd build
- Run CMake
cmake -DCMAKE_BUILD_TYPE=Release -DMAIN_FILE="./main.cpp" ..
For options see the Options section below.
- make the programm Use
make -j8
to use 8 threads.
- Run program
- Run parallel
mpirun -np numberofnodes ./sgrun
Options
-DCMAKE_BUILD_TYPE={Release,Debug}
-DMAIN_FILE="./main2.cpp"
with target main file in reference to the library
directory -DMPI_ON={true,false}
for compiling with mpi -DOMP_ON={true,false}
for compiling with omp
Note that using MPI and/or OMP requires setting up a valid environment. See Usage Examples.
Example calls
cmake -DMPI_ON=false -DOMP_ON=false -DCUDA_ON=false -DCMAKE_BUILD_TYPE=Release -DMAIN_FILE="./main.cpp" .. && make -j4 && ./sgrun
Change main_file
Using CMake argument
Call cmake with -DMAIN_FILE="./main2.cpp"
:
cmake -DMPI_ON=false -DOMP_ON=false -DCMAKE_BUILD_TYPE=Debug -DMAIN_FILE="./main2.cpp" ..
Or by overwriting default in CMakeList.txt
In
../LoAdSG/library/CmakeLists.txt
replace main_file.cpp with desired main file:
add_executable(${PROJECT_NAME} main_file.cpp)