Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formalization of an API #2357

Merged
merged 76 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
aa0b950
initial partial API
ramcdougal May 14, 2023
05c9126
clang-format changes
ramcdougal May 14, 2023
6e98ba0
nrnpy_set_pr_etal should be extern C
ramcdougal May 14, 2023
8d4e8b5
nrn_call_function leaves results on stack
ramcdougal May 14, 2023
6f5016f
segments, properties
ramcdougal May 14, 2023
bac48bc
including hocdec.h to try to avoid Datum errors on some systems
ramcdougal May 14, 2023
9f92799
sectionlist and allsec hoc_Item getters
ramcdougal May 15, 2023
8cb0757
ran clang-format
ramcdougal May 15, 2023
aff2229
symbol and object introspection
ramcdougal May 15, 2023
4ca7f3c
minor comment edits
ramcdougal May 15, 2023
a005703
symbol table getting and interating
ramcdougal May 15, 2023
93d6ec3
object ref, push
ramcdougal May 15, 2023
fa6a234
Renamed files to avoid having two nrnapi.h files.
ramcdougal May 15, 2023
f9eb4e3
possible fix for no nrnmpi_stubs case
ramcdougal May 15, 2023
f4fcc7d
this really ought to fix the nrnmpi_stubs missing case
ramcdougal May 15, 2023
e6afbb0
neuronapi.cpp no longer uses its .h, that is now a header for 3rd par…
ramcdougal May 15, 2023
20758c8
switched to enum for stack types
ramcdougal May 15, 2023
61560a1
clang-format update
ramcdougal May 16, 2023
1d7d4a3
fixed lost extern C, removed unnecessary externs
ramcdougal May 16, 2023
2e89ba1
test: hh_sim
ramcdougal May 16, 2023
d493476
test: vclamp.cpp
ramcdougal May 16, 2023
1dc2079
fix for vclamp name
ramcdougal May 16, 2023
28842da
needed typedefs for C to be happy
ramcdougal May 16, 2023
31f9a29
test: sections.c
ramcdougal May 16, 2023
bdaaff2
clang-format
ramcdougal May 16, 2023
0a689c8
replaced hoc_Item with new synonym nrn_Item
ramcdougal May 18, 2023
e422638
removed inconsistency in typedef even though it was probably harmless
ramcdougal May 18, 2023
bd606d2
netcon example shows no need for dlsym
ramcdougal May 18, 2023
5631706
support for .so files in addition to .dylib
ramcdougal May 18, 2023
87028b3
removed an excess const
ramcdougal May 18, 2023
0c85738
Add Robert's API tests to CTest (#2365)
olupton Jun 25, 2023
71ab005
Merge branch 'master' into api
ramcdougal Jun 25, 2023
0b8fd3b
fix to header file name of api
ramcdougal Jun 25, 2023
7b48a89
hh_sim and sections work with handles
ramcdougal Jun 25, 2023
6e929b6
rename stack_types_t per @olupton
ramcdougal Jun 25, 2023
5ea5168
format
ramcdougal Jun 25, 2023
8e758c6
netcon works, standardization of names
ramcdougal Jun 25, 2023
963bd75
name adjustments to end with verb
ramcdougal Jun 25, 2023
9638da3
name fixes
ramcdougal Jun 25, 2023
0173e02
replace param_handle with param
ramcdougal Jun 25, 2023
244b2fd
working vclamp
ramcdougal Jun 27, 2023
3a1b3e3
unified API property functions
ramcdougal Jun 27, 2023
2fd9e34
getters use const args
ramcdougal Jun 27, 2023
30214f8
forgot to commit sections
ramcdougal Jun 27, 2023
4de562d
vector_capacity now on const obj
ramcdougal Jun 27, 2023
ba8a0a0
Merge branch 'master' into api
ramcdougal Sep 24, 2023
219df3b
Several improvements
ferdonline Sep 27, 2023
77ad3cf
Merge branch 'master' into api
ferdonline Dec 13, 2023
8f9eff0
Make tests link against nrniv_lib, no dlopen
ferdonline Dec 13, 2023
f662ba1
Address sonar lint reservations
ferdonline Dec 14, 2023
a328651
Make comparisons be part of the test and account for fp innacuraciesa
ferdonline Dec 15, 2023
000178d
Tests to find ref files
ferdonline Dec 16, 2023
ab1b152
api: Make tests resilient to accumulated errors
ferdonline Dec 18, 2023
2c3421b
Merge branch 'master' into api
ferdonline Dec 20, 2023
4bc12b0
Use in-test ref result, depending on NRN_ENABLE_CORENEURON
ferdonline Dec 22, 2023
89cafa6
Merge branch 'master' into api
pramodk Jan 3, 2024
75b1f37
Use free for allocated c strings
ferdonline Jan 3, 2024
a5fbaab
Dont alloc Section Item to heap as its not used.
ferdonline Jan 3, 2024
1f6273c
Address intel compiler complain
ferdonline Jan 7, 2024
15f91ee
Free memb_func[].dparam_semantics
ferdonline Jan 16, 2024
c1f44bc
Switch dparam_semantics to unique_ptr (no raw!)
ferdonline Jan 18, 2024
b08dcd7
Memb_list to do its memory management
ferdonline Jan 21, 2024
3c31399
Memb_list to be aware of its potential "view" condition and not free
ferdonline Jan 22, 2024
4fc381a
Back pdata free
ferdonline Jan 22, 2024
de0ddf6
Merge branch 'master' into api
ferdonline Jan 22, 2024
6fcb352
nrn_init to better initialize mpi
ferdonline Jan 23, 2024
f6aaf6f
Addressed a number of warnings, inc avoidiing potential double free
ferdonline Jan 24, 2024
193003f
Addressed sonarcloud issues
ferdonline Jan 28, 2024
be7261e
Merge branch 'master' into api
ferdonline Jan 28, 2024
0aec16c
Merge branch 'master' into api
pramodk Mar 19, 2024
aed536f
fix the merge with master
pramodk Mar 19, 2024
030985e
Fix test/api/netcon.cpp after merge with master
pramodk Mar 19, 2024
74d66db
Merge branch 'master' into api
pramodk Mar 19, 2024
50d7e68
Merge branch 'master' into api
Apr 17, 2024
7e84d4b
Merge branch 'master' into api
nrnhines May 22, 2024
9e53b77
fix warning [-Wimplicit-exception-spec-mismatch]
nrnhines May 22, 2024
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
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,11 @@ endfunction()
set(NRN_RUN_FROM_BUILD_DIR_ENV "NEURONHOME=${PROJECT_BINARY_DIR}/share/nrn"
"NRNHOME=${PROJECT_BINARY_DIR}")
prepend_to_var(PATH "${PROJECT_BINARY_DIR}/bin")
prepend_to_var(LD_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")
if(APPLE)
prepend_to_var(DYLD_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")
else()
prepend_to_var(LD_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")
endif()
if(NRN_ENABLE_CORENEURON)
list(APPEND NRN_RUN_FROM_BUILD_DIR_ENV "CORENRNHOME=${PROJECT_BINARY_DIR}")
endif()
Expand Down
2 changes: 2 additions & 0 deletions cmake/NeuronFileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set(HEADER_FILES_TO_INSTALL
gnu/nrnran123.h
nrniv/backtrace_utils.h
nrniv/bbsavestate.h
nrniv/neuronapi.h
nrnmpi/nrnmpidec.h
nrnoc/cabvars.h
nrnoc/md1redef.h
Expand Down Expand Up @@ -221,6 +222,7 @@ set(NRNIV_FILE_LIST
netpar.cpp
nmodlrandom.cpp
nonlinz.cpp
neuronapi.cpp
nrncore_write.cpp
nrncore_write/callbacks/nrncore_callbacks.cpp
nrncore_write/data/cell_group.cpp
Expand Down
26 changes: 26 additions & 0 deletions src/ivoc/ivocmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ extern void hoc_nrnmpi_init();
#if NRNMPI_DYNAMICLOAD
extern void nrnmpi_stubs();
extern std::string nrnmpi_load();
void nrnmpi_load_or_exit();
#endif

// some things are defined in libraries earlier than they are used so...
Expand Down Expand Up @@ -805,3 +806,28 @@ int run_til_stdin() {
}
void hoc_notify_value() {}
#endif


/// A top-level initialization of MPI given argc and argv.
/// Sets stubs, load dyn lib, and initializes
std::tuple<int, const char**> nrn_mpi_setup(int argc, const char** argv) {
#if defined(AUTO_DLOPEN_NRNMECH) && AUTO_DLOPEN_NRNMECH == 0
extern int nrn_noauto_dlopen_nrnmech;
nrn_noauto_dlopen_nrnmech = 1;
#endif

#if NRNMPI
#if NRNMPI_DYNAMICLOAD
nrnmpi_stubs();
for (int i = 1; i < argc; ++i) {
if (strcmp("-mpi", argv[i]) == 0) {
nrnmpi_load_or_exit();
break;
}
}
#endif // NRNMPI_DYNAMICLOAD
auto argv_ptr = const_cast<char***>(&argv); // safe if individual strings not modified
nrnmpi_init(1, &argc, argv_ptr); // may change argc and argv
#endif // NRNMPI
return {argc, argv};
}
2 changes: 1 addition & 1 deletion src/neuron/cache/mechanism_range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace neuron::cache {
template <typename Callable>
void indices_to_cache(short type, Callable callable) {
auto const pdata_size = nrn_prop_dparam_size_[type];
auto* const dparam_semantics = memb_func[type].dparam_semantics;
auto* const dparam_semantics = memb_func[type].dparam_semantics.get();
for (int field = pdata_size - 1; field >= 0; --field) {
// Check if the field-th dparam of this mechanism type is an ion variable. See
// hoc_register_dparam_semantics.
Expand Down
Loading
Loading