Skip to content

Commit

Permalink
Merge pull request #273 from ls1mardyn/code-refactor-mamico
Browse files Browse the repository at this point in the history
Code refactor mamico
  • Loading branch information
FG-TUM authored Sep 8, 2023
2 parents af5365a + 68f616a commit d53652e
Show file tree
Hide file tree
Showing 15 changed files with 510 additions and 171 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ include(ALL)
# ----- third: include autopas
include(autopas)

# ----- include mamico
include(mamico)

# ----- resilience plugin dependencies are set here
include(compression)

Expand Down
18 changes: 18 additions & 0 deletions cmake/modules/mamico.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
option(MAMICO_COUPLING "Couple with MaMiCo" OFF)
if (MAMICO_COUPLING)
message(STATUS "MaMiCo coupling enabled. ls1 mardyn will compile as library. No executable will be created.")
set(MAMICO_COMPILE_DEFINITIONS MAMICO_COUPLING MDDim3)
option(MAMICO_ENABLE_FPIC "Enable -fPIC flag for MaMiCo python bindings" OFF)
set(MAMICO_SRC_DIR CACHE PATH "Root directory of the MaMiCo codebase")
if(NOT MAMICO_SRC_DIR)
message(FATAL_ERROR "MaMiCo source directory not specified.")
endif()
if(ENABLE_MPI)
set(MAMICO_MPI_DEFINITIONS MDCoupledParallel TarchParallel)
endif()
if(MAMICO_ENABLE_FPIC)
set(MAMICO_COMPILE_OPTIONS "${MAMICO_COMPILE_OPTIONS} -fPIC")
endif()
else()
message(STATUS "MaMiCo coupling disabled.")
endif()
1 change: 1 addition & 0 deletions doc/Plugins_Summary.dox
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ SP / TemperatureProfile | temperature profile output | Outputs the average tempe
SP / VirialProfile | virial pressure profile output | Outputs the virial/partial pressures in a spatial 1D output in y-direction or 2D output (Virial2DProfile). Requires/auto enables DensityProfile.
LoadbalanceWriter | print, mpi, load balance, timers | Writes load balance information. Averages, min, max and a load balance is written. For more detailed output use the TimerWriter.
LoadImbalanceThroughSleepPlugin | mpi, overlapping | Artificially introduces a load imbalance at different plugin steps. Primarily used for testing.
MamicoCoupling | coupling, compile as library | Allows the coupling code MaMiCo to couple with ls1. Requires ls1 to be compiled as library. This is automatically done when passing MAMICO_COUPLING=ON to cmake. This plugin always switches the ls1 thermostat off.
MaxCheck | limit, maximum values, overlaps, explosion | Limit velocity and force of individual particles to maximum values to avoid overlaps and consequently exploding systems.
MaxWriter | sampling, maximum values, force, velocity | Sampling maximum force and velocities values occuring in the system.
MettDeamon | particle-insertion, reservoir, replenish, stationary, evaporation | Replenish a liquid film by a particle reservoir, to attain stationary conditons in an e.g. evaporation simulation.
Expand Down
4 changes: 3 additions & 1 deletion examples/Mamico-couette/ls1configNoCP.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<mardyn version="20100525">
<loglevel>INFO</loglevel>
<refunits type="SI">
<length unit="nm">0.34</length>
<mass unit="u">39.948</mass>
Expand Down Expand Up @@ -62,7 +63,8 @@
</ensemble>
<algorithm>
<parallelisation type="DomainDecomposition"/>
<datastructure type="AutoPas">
<datastructure type="LinkedCells">
<cellsInCutoffRadius>1</cellsInCutoffRadius>
</datastructure>
<cutoffs type="CenterOfMass">
<radiusLJ unit="reduced">2.2</radiusLJ>
Expand Down
15 changes: 13 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,20 @@ else()
endif ()

# add the executable
ADD_EXECUTABLE(MarDyn
if (MAMICO_COUPLING)
ADD_LIBRARY(MarDyn STATIC
${MY_SRC}
parallel/ForceHelper.h)
)
TARGET_INCLUDE_DIRECTORIES(MarDyn SYSTEM PRIVATE "${MAMICO_SRC_DIR}")
TARGET_COMPILE_DEFINITIONS(MarDyn PUBLIC
${MAMICO_COMPILE_DEFINITIONS} ${MAMICO_MPI_DEFINITIONS}
)
TARGET_COMPILE_OPTIONS(MarDyn PUBLIC ${MAMICO_COMPILE_OPTIONS})
else()
ADD_EXECUTABLE(MarDyn
${MY_SRC}
)
endif()

# dependencies for lz4
if (ENABLE_LZ4)
Expand Down
Loading

0 comments on commit d53652e

Please sign in to comment.