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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## latest

- Bugfix: mem-leak while reading microstructure and added wider CMake support [#140](https://github.com/DataAnalyticsEngineering/FANS/pull/140)
- Added MPI communicator abstraction [#139](https://github.com/DataAnalyticsEngineering/FANS/pull/139)

## v0.6.2
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ target_compile_definitions(FANS_FANS PUBLIC ${FFTW3_DEFINITIONS})
target_link_libraries(FANS_FANS PUBLIC Eigen3::Eigen)
target_link_libraries(FANS_FANS PUBLIC nlohmann_json::nlohmann_json)

target_include_directories(FANS_main PRIVATE ${HDF5_INCLUDE_DIRS})
target_include_directories(FANS_main PRIVATE ${HDF5_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIRS})
target_link_libraries(FANS_main PRIVATE FANS::FANS)

# ##############################################################################
Expand Down
14 changes: 9 additions & 5 deletions cmake/modules/FindFFTW3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ macro(find_specific_libraries KIND PARALLEL)
# adding target properties to the different cases
## MPI
if(PARALLEL STREQUAL "MPI")
if(MPI_C_LIBRARIES)
set_target_properties(fftw3::${kind}::mpi PROPERTIES
IMPORTED_LOCATION "${FFTW3_${KIND}_${PARALLEL}_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR_PARALLEL}"
IMPORTED_LINK_INTERFACE_LIBRARIES ${MPI_C_LIBRARIES})
set_target_properties(fftw3::${kind}::mpi PROPERTIES
IMPORTED_LOCATION "${FFTW3_${KIND}_${PARALLEL}_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR_PARALLEL}"
)

if(MPI_C_LIBRARIES AND NOT MPI_C_LIBRARIES STREQUAL "")
set_property(TARGET fftw3::${kind}::mpi PROPERTY
INTERFACE_LINK_LIBRARIES "${MPI_C_LIBRARIES}"
)
endif()
endif()
## OpenMP
Expand Down
2 changes: 1 addition & 1 deletion pyfans/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pybind11_add_module(PyFANS micro.hpp micro.cpp)
target_include_directories(PyFANS PRIVATE ${HDF5_INCLUDE_DIRS})
target_include_directories(PyFANS PRIVATE ${HDF5_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIRS})
target_link_libraries(PyFANS PRIVATE FANS::FANS)

add_custom_command(
Expand Down
3 changes: 2 additions & 1 deletion src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ void Reader ::ReadMS(int hm)
FANS_free(tmp);
} else {
/* XYZ case: the slab is already in correct order */
ms = tmp; // steal the buffer; no copy
FANS_free(ms); // dealloc mem
ms = tmp; // steal the buffer; no copy
}

/*--------------------------------------------------------------------
Expand Down