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

Move codebase to CPP #763

Merged
merged 39 commits into from
Feb 3, 2021
Merged

Move codebase to CPP #763

merged 39 commits into from
Feb 3, 2021

Conversation

alexsavulescu
Copy link
Member

More details in #708.

@alexsavulescu
Copy link
Member Author

For reasons that elude me at this point in time, 5 rxd tests are failing for the autotools jobs:

Passed:      ca_pump, multicompartment_mebrane_mismatch, multicompartment_reactions_with_v, nodes_update, cabuf, include_flux_cvode, cabuf_fixed_step, pure_diffusion_cvode, IraHH, react_region_specified, include_flux, verify_no_initialization_order_issue, reaction_test, multicompartment_reactions_del, reaction_param_test, multicompartment_reactions, pure_diffusion, reaction_null_dest, 3d/circadian_rhythm, 3d/pure_diffusion_3d_cvode, 3d/pure_diffusion_3d, 3d/include_flux3d_cvode, 3d/include_flux3d, 3d/multicompartment_reactions, wave1d/wave1d_125_1, wave1d/wave1d_25_5, wave1d/wave1d_taper_125_1, wave1d/wave1d_taper_25_5, wave1d/wave1d_tree_125_1, wave1d/wave1d_tree2_125_1, wave1d/wave1d_tree2_25_5, wave1d/wave1d_tree_25_5, ecs/ecs_example_cvode, ecs/ecs_example, ecs/ecs_multi_example_cvode, ecs/ecs_multi_example, ecs/ecs_before_sections, ecs/ecs_include_flux, ecs/ecs_include_flux_cvode, hybrid/bistable_hybrid_cvode, hybrid/bistable_hybrid_cvode_change_nthread, hybrid/bistable_hybrid, hybrid/bistable_hybrid_change_nthread, hybrid/pure_diffusion_hybrid_cvode, hybrid/pure_diffusion_hybrid
Failed:      hh_param, hh_cvode, hh_param_cvode, hh_morph, hh
Incomplete:  
---
Ran 50 tests:
Passed:     45
Failed:     5
Incomplete: 0

more here: https://travis-ci.com/github/neuronsimulator/nrn/jobs/414446958#L8937

@nrnhines
Copy link
Member

How does one run one of the autotools tests. For cmake, make test is successful.

@alexsavulescu
Copy link
Member Author

alexsavulescu commented Oct 28, 2020

How does one run one of the autotools tests.

For autotools I use (on mac) :

cd nrn
git checkout cpp
./build.sh
./configure --without-x --with-paranrn=dynamic --with-nrnpython=`which python` --with-readline=no --prefix=`pwd`/install
make
make install
export PYTHONPATH=`pwd`/install/lib/python:$PYTHONPATH
export PATH=`pwd`/install/x86_64/bin:$PATH
python share/lib/python/neuron/rxdtests/run_all.py

For cmake, make test is successful.

I don't think those tests are run with cmake; by running python share/lib/python/neuron/rxdtests/run_all.py for a cmake install, all tests pass.

@pramodk
Copy link
Member

pramodk commented Oct 28, 2020

@nrnhines : Just to be sync : @adamjhn just informed us following:

It looks like it's a difference in the currents coming from the hh mechanism. e.g. here is the difference in the ik for a simple model with no rxd on a CMake build - an autotools build

import numpy
from neuron import h
from matplotlib import pyplot
h.load_file('stdrun.hoc')
soma = h.Section('soma')
soma.insert('hh')
stim = h.IClamp(soma(0.5))
stim.delay = 50
stim.amp = 1
stim.dur = 50
tvec = h.Vector().record(h._ref_t)
kvec = h.Vector().record(soma(0.5)._ref_ik)
h.finitialize(-70)
h.continuerun(100)
numpy.save("/tmp/kvec.npy",kvec.as_numpy())
#kvec2 = numpy.load("/tmp/kvec.npy")
#pyplot.plot(tvec, kvec - kvec2)
#pyplot.xlabel("time (ms)")
#pyplot.ylabel("diff (mA/cm$^2$)")

So, if simple hh results are different between autotools and CMake then I suspect we have missed something fundamental. We haven't checked details yet. (Note that this different happens only this pull request branch; master works correctly)

@pramodk
Copy link
Member

pramodk commented Oct 28, 2020

@nrnhines : I have fixed the issue in 26b4a77. (hh.mod modified by CMake was accidentally got committed)

@alexsavulescu
Copy link
Member Author

Thank you @adamjhn & @pramodk.
This PR is ready for review.

@pramodk
Copy link
Member

pramodk commented Oct 28, 2020

I will block some dedicated hours to go though all those 458 files 👀. All changes are straightforward but just to be sure we don't miss anything.

  • @alexsavulescu @jorblancoa : we should run full BBP simulation test suite with this branch.
  • We should also build this on Cray Piz-Daint system (just to be sure everything is consistent)

And then we should be ready to go 🚀

@alexsavulescu
Copy link
Member Author

alexsavulescu commented Oct 28, 2020

I'll also

  • re-run nrnivmodl on all ModelDB repos for linux and macos.

@pramodk
Copy link
Member

pramodk commented Feb 2, 2021

@alexsavulescu : Having bit curated commit message would be helpful for this mega merge? May be you can take a look at the log and copy message here?

@nrnhines @alexsavulescu : another question - should we merge all (or most of the) commits from current master to release/8.0 before this merge?

Copy link
Member

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still WIP

cmake/CompilerFlagsHelpers.cmake Outdated Show resolved Hide resolved
@alexsavulescu
Copy link
Member Author

@alexsavulescu : Having bit curated commit message would be helpful for this mega merge? May be you can take a look at the log and copy message here?

This sums it up:
move codebase to cpp (except nmodl + 3rd party old libs) - #708

@nrnhines @alexsavulescu : another question - should we merge all (or most of the) commits from current master to release/8.0 before this merge?

Sure, save ourselves some cherry-picking

Copy link
Member

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half way through...!

src/modlunit/list.cpp Show resolved Hide resolved
src/modlunit/units.cpp Show resolved Hide resolved
src/modlunit/units.cpp Show resolved Hide resolved
src/mswin/extra/splitnrn.cpp Outdated Show resolved Hide resolved
src/mswin/rdln/readline.cpp Outdated Show resolved Hide resolved
src/nmodl/lex.lpp Outdated Show resolved Hide resolved
src/nmodl/modl.cpp Outdated Show resolved Hide resolved
src/nmodl/noccout.cpp Outdated Show resolved Hide resolved
src/nrnoc/cabcode.cpp Show resolved Hide resolved
src/nrnoc/capac.cpp Show resolved Hide resolved
src/nrnoc/fadvance.cpp Show resolved Hide resolved
src/nrnoc/fadvance.cpp Show resolved Hide resolved
src/nrnoc/init.cpp Outdated Show resolved Hide resolved
src/nrnoc/init.cpp Outdated Show resolved Hide resolved
src/nrnoc/treeset.cpp Outdated Show resolved Hide resolved
src/nrnpython/rxdmath.cpp Show resolved Hide resolved
src/oc/fileio.cpp Show resolved Hide resolved
src/oc/ftime.cpp Show resolved Hide resolved
Copy link
Member

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments/questions otherwise LGTM

src/readline/readline.c Outdated Show resolved Hide resolved
src/sparse13/spmatrix.h Outdated Show resolved Hide resolved
src/nrnoc/code.cpp Show resolved Hide resolved
@alexsavulescu
Copy link
Member Author

@pramodk so I'm happy if you're happy. CI providers have been erratic these past days (GHA doubling jobs, failed actions for no reason, Azure reporting failed jobs but they weren't...) but everything is a-OK.

Copy link
Member

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pramodk so I'm happy if you're happy.

😃 ✅ 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate models failing nrntest run after CPP update
6 participants