diff --git a/CMakeLists.txt b/CMakeLists.txt index 963313c7f7a5821bdec123e658a07aa6233b28a9..12dcd69019fc3901d1aaff74af9957ad05817145 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,14 +45,14 @@ file(MAKE_DIRECTORY ${GEN_INTERFACE_DIR}) #================================================================================ set(RUNTIME_COMMON_FILES runtime/pairs.cpp - runtime/copper_fcc_lattice.cpp - runtime/create_body.cpp - runtime/dem_sc_grid.cpp - runtime/read_from_file.cpp - runtime/stats.cpp - runtime/thermo.cpp - runtime/timing.cpp - runtime/vtk.cpp + runtime/utility/copper_fcc_lattice.cpp + runtime/utility/create_body.cpp + runtime/utility/dem_sc_grid.cpp + runtime/utility/read_from_file.cpp + runtime/utility/stats.cpp + runtime/utility/thermo.cpp + runtime/utility/timing.cpp + runtime/utility/vtk.cpp runtime/domain/regular_6d_stencil.cpp) #================================================================================ @@ -106,9 +106,9 @@ if(USE_WALBERLA) # TODO: Generate the host/device functions for computing weights if(COMPILE_CUDA) - list(APPEND RUNTIME_WALBERLA_FILES runtime/boundary_weights.cu) + list(APPEND RUNTIME_WALBERLA_FILES runtime/domain/boundary_weights.cu) else() - list(APPEND RUNTIME_WALBERLA_FILES runtime/boundary_weights.cpp) + list(APPEND RUNTIME_WALBERLA_FILES runtime/domain/boundary_weights.cpp) endif() target_sources(${PAIRS_TARGET} PRIVATE ${RUNTIME_WALBERLA_FILES}) diff --git a/README.md b/README.md index 92db3b5b5c1cab339f890dc54a874427232580b5..4d62ccb2b2b5e6d15b93875ac311a3ebc0597994 100644 --- a/README.md +++ b/README.md @@ -109,18 +109,17 @@ In the following, we assume we have created and navigated to a build directory: **Basic CMake flags:** * Pass your input script to CMake using `-DINPUT_SCRIPT=path/to/script.py` * Enable CUDA with `-DCOMPILE_CUDA=ON` -* Enable support for BlockForest domain partitioning and dynamic load balancing by providing the path to waLBerla source directory `-DWALBERLA_DIR=path/to/walberla` (TODO: waLBerla as a submodule) +* Enable waLBerla support with `-DUSE_WALBERLA=ON` for using BlockForest domain partitioning and dynamic load balancing ### 1. Stand-Alone P4IRS Application --------------------- To build a C++ application using P4IRS, provide the list of your source files to CMake using the `-DUSER_SOURCE_FILES` flag (semicolon-seperated). -**Example**: Build the application [sd_1.cpp](examples/modular/sd_1.cpp) using [spring_dashpot.py](examples/modular/spring_dashpot.py) as the input script. -Note: In this example we assume waLBerla has been already cloned next to the P4IRS directory. +**Example**: Build the application [sd_1.cpp](examples/modular/sd_1.cpp) using [spring_dashpot.py](examples/modular/spring_dashpot.py) as the input script. ``` -cmake -DINPUT_SCRIPT=../examples/modular/spring_dashpot.py -DUSER_SOURCE_FILES=../examples/modular/sd_1.cpp -DWALBERLA_DIR=../../walberla .. +cmake -DINPUT_SCRIPT=../examples/modular/spring_dashpot.py -DUSER_SOURCE_FILES=../examples/modular/sd_1.cpp -DUSE_WALBERLA=ON .. ``` Now call `make` and an **executable** is built. diff --git a/runtime/domain/block_forest.cpp b/runtime/domain/block_forest.cpp index 77c082b709787e96ea3fb4da923f06ef060f4ddc..1ad9922658bd11ca9f90731b68198810bcb674c6 100644 --- a/runtime/domain/block_forest.cpp +++ b/runtime/domain/block_forest.cpp @@ -13,7 +13,7 @@ #include <blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h> #include <blockforest/loadbalancing/weight_assignment/WeightAssignmentFunctor.h> //--- -#include "../boundary_weights.hpp" +#include "boundary_weights.hpp" #include "../pairs_common.hpp" #include "../devices/device.hpp" #include "regular_6d_stencil.hpp" diff --git a/runtime/boundary_weights.cpp b/runtime/domain/boundary_weights.cpp similarity index 100% rename from runtime/boundary_weights.cpp rename to runtime/domain/boundary_weights.cpp diff --git a/runtime/boundary_weights.cu b/runtime/domain/boundary_weights.cu similarity index 100% rename from runtime/boundary_weights.cu rename to runtime/domain/boundary_weights.cu diff --git a/runtime/boundary_weights.hpp b/runtime/domain/boundary_weights.hpp similarity index 86% rename from runtime/boundary_weights.hpp rename to runtime/domain/boundary_weights.hpp index e84348a0c8438255ca0090b765b56fd95f7deb10..3b7fd22e4132b243531e07ed885bc1883b229820 100644 --- a/runtime/boundary_weights.hpp +++ b/runtime/domain/boundary_weights.hpp @@ -6,8 +6,8 @@ #include <fstream> #include <sstream> //--- -#include "pairs.hpp" -#include "pairs_common.hpp" +#include "../pairs.hpp" +#include "../pairs_common.hpp" namespace pairs { diff --git a/runtime/copper_fcc_lattice.cpp b/runtime/utility/copper_fcc_lattice.cpp similarity index 100% rename from runtime/copper_fcc_lattice.cpp rename to runtime/utility/copper_fcc_lattice.cpp diff --git a/runtime/copper_fcc_lattice.hpp b/runtime/utility/copper_fcc_lattice.hpp similarity index 100% rename from runtime/copper_fcc_lattice.hpp rename to runtime/utility/copper_fcc_lattice.hpp diff --git a/runtime/create_body.cpp b/runtime/utility/create_body.cpp similarity index 100% rename from runtime/create_body.cpp rename to runtime/utility/create_body.cpp diff --git a/runtime/create_body.hpp b/runtime/utility/create_body.hpp similarity index 100% rename from runtime/create_body.hpp rename to runtime/utility/create_body.hpp diff --git a/runtime/dem_sc_grid.cpp b/runtime/utility/dem_sc_grid.cpp similarity index 100% rename from runtime/dem_sc_grid.cpp rename to runtime/utility/dem_sc_grid.cpp diff --git a/runtime/dem_sc_grid.hpp b/runtime/utility/dem_sc_grid.hpp similarity index 100% rename from runtime/dem_sc_grid.hpp rename to runtime/utility/dem_sc_grid.hpp diff --git a/runtime/read_from_file.cpp b/runtime/utility/read_from_file.cpp similarity index 100% rename from runtime/read_from_file.cpp rename to runtime/utility/read_from_file.cpp diff --git a/runtime/read_from_file.hpp b/runtime/utility/read_from_file.hpp similarity index 100% rename from runtime/read_from_file.hpp rename to runtime/utility/read_from_file.hpp diff --git a/runtime/stats.cpp b/runtime/utility/stats.cpp similarity index 100% rename from runtime/stats.cpp rename to runtime/utility/stats.cpp diff --git a/runtime/stats.hpp b/runtime/utility/stats.hpp similarity index 100% rename from runtime/stats.hpp rename to runtime/utility/stats.hpp diff --git a/runtime/thermo.cpp b/runtime/utility/thermo.cpp similarity index 100% rename from runtime/thermo.cpp rename to runtime/utility/thermo.cpp diff --git a/runtime/thermo.hpp b/runtime/utility/thermo.hpp similarity index 100% rename from runtime/thermo.hpp rename to runtime/utility/thermo.hpp diff --git a/runtime/timing.cpp b/runtime/utility/timing.cpp similarity index 100% rename from runtime/timing.cpp rename to runtime/utility/timing.cpp diff --git a/runtime/timing.hpp b/runtime/utility/timing.hpp similarity index 100% rename from runtime/timing.hpp rename to runtime/utility/timing.hpp diff --git a/runtime/vtk.cpp b/runtime/utility/vtk.cpp similarity index 100% rename from runtime/vtk.cpp rename to runtime/utility/vtk.cpp diff --git a/runtime/vtk.hpp b/runtime/utility/vtk.hpp similarity index 100% rename from runtime/vtk.hpp rename to runtime/utility/vtk.hpp diff --git a/src/pairs/code_gen/cgen.py b/src/pairs/code_gen/cgen.py index 13f4f8f9482e4a324e872bf623cd644c85c207ab..9a07c9444bb1a16d1c7628b3a3d6decd898d11af 100644 --- a/src/pairs/code_gen/cgen.py +++ b/src/pairs/code_gen/cgen.py @@ -154,15 +154,15 @@ class CGen: self.print("#include <stdlib.h>") self.print("//---") self.print("#include \"likwid-marker.h\"") - self.print("#include \"copper_fcc_lattice.hpp\"") - self.print("#include \"create_body.hpp\"") - self.print("#include \"dem_sc_grid.hpp\"") self.print("#include \"pairs.hpp\"") - self.print("#include \"read_from_file.hpp\"") - self.print("#include \"stats.hpp\"") - self.print("#include \"timing.hpp\"") - self.print("#include \"thermo.hpp\"") - self.print("#include \"vtk.hpp\"") + self.print("#include \"utility/copper_fcc_lattice.hpp\"") + self.print("#include \"utility/create_body.hpp\"") + self.print("#include \"utility/dem_sc_grid.hpp\"") + self.print("#include \"utility/read_from_file.hpp\"") + self.print("#include \"utility/stats.hpp\"") + self.print("#include \"utility/timing.hpp\"") + self.print("#include \"utility/thermo.hpp\"") + self.print("#include \"utility/vtk.hpp\"") self.print("") self.print("using namespace pairs;") self.print("")