Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ option(CORENRN_ENABLE_SHARED "Enable shared library build" ON)
option(CORENRN_ENABLE_LEGACY_UNITS "Enable legacy FARADAY, R, etc" OFF)
option(CORENRN_ENABLE_PRCELLSTATE "Enable NRN_PRCELLSTATE debug feature" OFF)

set(CORENRN_EXTERNAL_BENCHMARK_DATA
""
CACHE PATH "Path to input data files and mechanisms for benchmarks")
set(CORENRN_NMODL_DIR
""
CACHE PATH "Path to nmodl source-to-source compiler installation")
Expand Down
30 changes: 29 additions & 1 deletion coreneuron/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,33 @@ set_target_properties(
# =============================================================================
# create special-core with halfgap.mod for tests
# =============================================================================
set(all_output_binaries)
if(NOT ${CORENRN_EXTERNAL_BENCHMARK_DATA} STREQUAL "")
# Hack for the december 2021 hackathon, build an extra special-core with channel-benchmark
# mechanisms.
set(modfile_directory
"${CORENRN_EXTERNAL_BENCHMARK_DATA}/channel-benchmark/benchmark/channels/lib/modlib")
file(GLOB modfiles "${modfile_directory}/*.mod")
set(output_binaries "${CMAKE_BINARY_DIR}/benchmark/${CMAKE_SYSTEM_PROCESSOR}/special-core"
"${CMAKE_BINARY_DIR}/benchmark/${CMAKE_SYSTEM_PROCESSOR}/libcorenrnmech.a")
add_custom_command(
OUTPUT ${output_binaries}
DEPENDS scopmath coreneuron ${NMODL_TARGET_TO_DEPEND} ${modfiles} ${CORENEURON_BUILTIN_MODFILES}
COMMAND ${CMAKE_BINARY_DIR}/bin/nrnivmodl-core -b STATIC -m ${CORENRN_MOD2CPP_BINARY} -p 1
"${modfile_directory}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/benchmark
COMMENT "Running nrnivmodl-core for channel-benchmark mechanisms")
list(APPEND all_output_binaries ${output_binaries})
string(
CONCAT
benchmark_command
"'${CMAKE_BINARY_DIR}/benchmark/${CMAKE_SYSTEM_PROCESSOR}/special-core'"
" --datpath '${CORENRN_EXTERNAL_BENCHMARK_DATA}/channel-benchmark-all-440-cells-2-ranks'"
" --tstop 1 &&"
"diff out.dat '${CORENRN_EXTERNAL_BENCHMARK_DATA}/channel-benchmark-all-440-cells-2-ranks.gpu.spikes'"
)
add_test(NAME benchmark COMMAND sh -c "${benchmark_command}")
endif()
set(modfile_directory "${CORENEURON_PROJECT_SOURCE_DIR}/tests/integration/ring_gap/mod")
file(GLOB modfiles "${modfile_directory}/*.mod")
set(output_binaries "${CMAKE_BINARY_DIR}/bin/${CMAKE_SYSTEM_PROCESSOR}/special-core"
Expand All @@ -304,7 +331,8 @@ add_custom_command(
"${modfile_directory}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
COMMENT "Running nrnivmodl-core with halfgap.mod")
add_custom_target(nrniv-core ALL DEPENDS ${output_binaries})
list(APPEND all_output_binaries ${output_binaries})
add_custom_target(nrniv-core ALL DEPENDS ${all_output_binaries})

include_directories(${CORENEURON_PROJECT_SOURCE_DIR})

Expand Down