Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 2 additions & 45 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,50 +109,7 @@ if(${ENABLE_LTO})
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")

SET(HEADERS config.h node.h expression_parser.h mesh.h electrostatSolver.h
spinAccumulationSolver.h time_integration.h settings.h tetra.h
facette.h linear_algebra.h log-stats.h tags.h chronometer.h element.h)

SET(SOURCES settings.cpp time_integration.cpp solver.cpp electrostatSolver.cpp
spinAccumulationSolver.cpp read.cpp save.cpp linear_algebra.cpp recentering.cpp tetra.cpp
energy.cpp facette.cpp expression_parser.cpp chronometer.cpp
tags.cpp mesh.cpp)

configure_file(config.h.in ./config.h)

add_custom_command(
OUTPUT default-settings.o
COMMAND ld -r -b binary -z noexecstack default-settings.yml -o default-settings.o
DEPENDS default-settings.yml)

#===========================================================================
# Compiler options
#===========================================================================
# -ffast-math -msse4.2 -mfpmath=sse (on X86 -mfpmath=sse set by default) or -mavx
# -fsanitize=address leak null undefined # both compiler and linker
#===========================================================================

include_directories (${CMAKE_SOURCE_DIR} ${GMSH_INC})

ADD_EXECUTABLE(feellgood main.cpp ${HEADERS} ${SOURCES} default-settings.o)
target_compile_options( feellgood PUBLIC -Wall -Wextra -O3 -march=native ${MKL_CFLAGS} )
target_compile_definitions(feellgood PUBLIC
-DNDEBUG -DTBB_SUPPRESS_DEPRECATED_MESSAGES ${EIGEN_MKL_CFLAGS} )

if (MKL_FOUND)
#option --no-as-needed for mkl, see
# https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html
target_link_options(feellgood PUBLIC "-Wl,--no-as-needed" )
# not sure we really need it since --no-as-needed is default value, though there might be
# a --as-needed before
TARGET_LINK_LIBRARIES(feellgood yaml-cpp duktape ann OpenMP::OpenMP_CXX ${TBB_LINK}
Eigen3::Eigen ${MKL_TARGET} ${GMSH_LIB})
else()
TARGET_LINK_LIBRARIES(feellgood yaml-cpp duktape ann OpenMP::OpenMP_CXX ${TBB_LINK}
Eigen3::Eigen ${GMSH_LIB})
endif()
add_subdirectory(src)

#===========================================================================
# Find where to install the Python modules.
Expand Down Expand Up @@ -226,7 +183,7 @@ else()
endif()

if(${ENABLE_UTESTS})
configure_file(./unit-tests/ut_config.h.in ./unit-tests/ut_config.h)
configure_file(unit-tests/ut_config.h.in unit-tests/ut_config.h)
include(CTest)
add_subdirectory(unit-tests)
endif()
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = . algebra
INPUT = . src src/algebra

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
4 changes: 2 additions & 2 deletions ci-tests/full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ def distance_R3(v1, v2):
}

# Expected outcome. It depends on whether feeLLGood was compiled in ONE_GAUSS_POINT mode.
val = subprocess.check_output(["../feellgood","--version"])
val = subprocess.check_output(["../src/feellgood","--version"])
if b'ONE_GAUSS_POINT=ON' in val:
expected = { "m": [0.307432, 0.476202, -0.823843], "E_tot": -4.446980e-19 }
else:
expected = { "m": [0.307542, 0.475877, -0.823989], "E_tot": -4.445605e-19 }

# Run the simulation.
sys.stdout.flush()
val = subprocess.run(["../feellgood", "--seed", "2", "-"], input=json.dumps(settings), text=True)
val = subprocess.run(["../src/feellgood", "--seed", "2", "-"], input=json.dumps(settings), text=True)

#(devNote) to avoid -fsanitize=leak ASLR bug, we turn off address randomizer
#val = subprocess.run(["setarch", "--addr-no-randomize", "../feellgood", "--seed", "2", "-"],
Expand Down
44 changes: 44 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
SET(HEADERS config.h node.h expression_parser.h mesh.h electrostatSolver.h
spinAccumulationSolver.h time_integration.h settings.h tetra.h
facette.h linear_algebra.h log-stats.h tags.h chronometer.h element.h)

SET(SOURCES settings.cpp time_integration.cpp solver.cpp electrostatSolver.cpp
spinAccumulationSolver.cpp read.cpp save.cpp linear_algebra.cpp recentering.cpp tetra.cpp
energy.cpp facette.cpp expression_parser.cpp chronometer.cpp
tags.cpp mesh.cpp)

configure_file(config.h.in ./config.h)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")

add_custom_command(
OUTPUT default-settings.o
COMMAND ld -r -b binary -z noexecstack default-settings.yml -o default-settings.o
DEPENDS default-settings.yml)

#===========================================================================
# Compiler options
#===========================================================================
# -ffast-math -msse4.2 -mfpmath=sse (on X86 -mfpmath=sse set by default) or -mavx
# -fsanitize=address leak null undefined # both compiler and linker
#===========================================================================

include_directories (${CMAKE_SOURCE_DIR} ${GMSH_INC})

ADD_EXECUTABLE(feellgood main.cpp ${HEADERS} ${SOURCES} default-settings.o)
target_compile_options( feellgood PUBLIC -Wall -Wextra -O3 -march=native ${MKL_CFLAGS} )
target_compile_definitions(feellgood PUBLIC
-DNDEBUG -DTBB_SUPPRESS_DEPRECATED_MESSAGES ${EIGEN_MKL_CFLAGS} )

if (MKL_FOUND)
#option --no-as-needed for mkl, see
# https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html
target_link_options(feellgood PUBLIC "-Wl,--no-as-needed" )
# not sure we really need it since --no-as-needed is default value, though there might be
# a --as-needed before
TARGET_LINK_LIBRARIES(feellgood yaml-cpp duktape ann OpenMP::OpenMP_CXX ${TBB_LINK}
Eigen3::Eigen ${MKL_TARGET} ${GMSH_LIB})
else()
TARGET_LINK_LIBRARIES(feellgood yaml-cpp duktape ann OpenMP::OpenMP_CXX ${TBB_LINK}
Eigen3::Eigen ${GMSH_LIB})
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion algebra/sparseMat.h → src/algebra/sparseMat.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ reconstructing the matrix from scratch.
#include <execution>
#include <mutex>

#include "config.h"
#include "../config.h"
#include "algebraCore.h"

namespace algebra
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions unit-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(NOT GMSH_INC)
message(FATAL_ERROR "Could not find gmsh.h")
endif()

include_directories (${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${GMSH_INC})
include_directories (${CMAKE_SOURCE_DIR}/src ${Boost_INCLUDE_DIRS} ${GMSH_INC})

set( BOOST_TEST_LOG_LEVEL "all" )

Expand All @@ -32,39 +32,39 @@ add_executable (test_ut_algebra ut_algebra.cpp)

add_executable (test_ut_OMP_solver ut_OMP_solver.cpp)

add_executable(test_ut_dukTapeParser ../expression_parser.cpp ut_dukTapeParser.cpp)
add_executable(test_ut_dukTapeParser ../src/expression_parser.cpp ut_dukTapeParser.cpp)

add_executable (test_ut_node ut_node.cpp)

add_executable (test_ut_index ut_index.cpp)

SET(SOURCES ../facette.cpp ../tetra.cpp ut_element.cpp)
SET(SOURCES ../src/facette.cpp ../src/tetra.cpp ut_element.cpp)
add_executable (test_ut_element ${SOURCES})

SET(SOURCES ../facette.cpp ut_facette.cpp)
SET(SOURCES ../src/facette.cpp ut_facette.cpp)
add_executable (test_ut_facette ${SOURCES})

SET(SOURCES ../facette.cpp ut_fac_charges.cpp)
SET(SOURCES ../src/facette.cpp ut_fac_charges.cpp)
add_executable (test_ut_fac_charges ${SOURCES})

SET(SOURCES ../tetra.cpp ut_tetra.cpp)
SET(SOURCES ../src/tetra.cpp ut_tetra.cpp)
add_executable (test_ut_tetra ${SOURCES})

SET(SOURCES ../tetra.cpp ut_tet_lumping.cpp)
SET(SOURCES ../src/tetra.cpp ut_tet_lumping.cpp)
add_executable (test_ut_tet_lumping ${SOURCES})

SET(SOURCES ../tetra.cpp ut_tet_charges.cpp)
SET(SOURCES ../src/tetra.cpp ut_tet_charges.cpp)
add_executable (test_ut_tet_charges ${SOURCES})

SET(SOURCES ../tetra.cpp ut_energy.cpp ../facette.cpp)
SET(SOURCES ../src/tetra.cpp ut_energy.cpp ../src/facette.cpp)
add_executable (test_ut_energy ${SOURCES})

SET(SOURCES ../tetra.cpp ut_anisotropy.cpp)
SET(SOURCES ../src/tetra.cpp ut_anisotropy.cpp)
add_executable (test_ut_anisotropy ${SOURCES})

add_executable (test_ut_tiny ut_tiny.cpp)

set(SOURCES ../tetra.cpp ut_time_int.cpp)
set(SOURCES ../src/tetra.cpp ut_time_int.cpp)
add_executable (test_ut_time_int ${SOURCES})

add_executable (test_ut_log-stats ut_log-stats.cpp)
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/sparse_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <vector>

#include "../algebra/sparseMat.h"
#include "algebra/sparseMat.h"

using algebra::SparseMatrix;
using algebra::MatrixShape;
Expand Down
6 changes: 3 additions & 3 deletions unit-tests/ut_algebra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#include "ut_config.h" // for tolerance UT_TOL macro
#include "sparse_matrix.h"
#include "../algebra/algebra.h"
#include "../algebra/cg.h"
#include "../algebra/bicg.h"
#include "algebra/algebra.h"
#include "algebra/cg.h"
#include "algebra/bicg.h"

using namespace algebra;

Expand Down
Loading