ls1mardyn / ls1-mardyn

ls1-MarDyn is a massively parallel Molecular Dynamics (MD) code for large systems. Its main target is the simulation of thermodynamics and nanofluidics. ls1-MarDyn is designed with a focus on performance and easy extensibility.
http://www.ls1-mardyn.de
Other
28 stars 15 forks source link

Creeping complexity in `CMakeLists` due to folder structure #343

Open amartyads opened 3 weeks ago

amartyads commented 3 weeks ago

Currently, in src/CMakeLists.txt we have the following code:

# if mpi is not enabled, remove the unneeded source files
if(NOT ENABLE_MPI)
    # duplicate the list
    set(MY_SRC_BACK ${MY_SRC})
    # exclude everything from parallel
    list(FILTER MY_SRC EXCLUDE REGEX "/parallel/")

    # but include DomainDecompBase* and LoadCalc*
    list(FILTER MY_SRC_BACK INCLUDE REGEX "/parallel/")
    list(FILTER MY_SRC_BACK INCLUDE REGEX "DomainDecompBase|LoadCalc|Zonal|ForceHelper")
    list(APPEND MY_SRC ${MY_SRC_BACK})

This exclude/include with regex is not intuitive, error-prone and will get worse as more features are added. This can (and should) be mitigated with a better folder structure.