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

Don't include solver headers verbatim. #1344

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

matz-e
Copy link
Member

@matz-e matz-e commented Jul 15, 2024

This first version will create a solver directory to contain the same newton.hpp and crout.hpp as present in the NMODL sources.

By default, NMODL will create the solver headers in the output directory. There are two new arguments to the NMODL invocation:

  • --dump-solvers <solver_names> will dump the corresponding solver/*.hpp files into the specified output directory.
  • --no-dump-solvers will keep a regular NMODL from creating the solver headers.

CI_BRANCHES:NEURON_BRANCH=matz-e/better-solver-dumper

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@pramodk pramodk requested a review from 1uc July 16, 2024 11:14
@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Jul 16, 2024
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 10.52632% with 17 lines in your changes missing coverage. Please review.

Project coverage is 86.72%. Comparing base (b91c0ea) to head (9d4696a).

Files Patch % Lines
src/main.cpp 6.25% 15 Missing ⚠️
src/codegen/codegen_coreneuron_cpp_visitor.cpp 50.00% 1 Missing ⚠️
src/codegen/codegen_neuron_cpp_visitor.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1344      +/-   ##
==========================================
- Coverage   86.82%   86.72%   -0.10%     
==========================================
  Files         179      179              
  Lines       13684    13700      +16     
==========================================
+ Hits        11881    11882       +1     
- Misses       1803     1818      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Jul 17, 2024
@bbpbuildbot

This comment has been minimized.

Copy link
Collaborator

@1uc 1uc left a comment

Choose a reason for hiding this comment

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

Could we please avoid the word "dump". It reliably reminds be of brown and smelly stuff.

src/main.cpp Outdated
return true;
}

void dump_solvers(const std::string& directory,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a nicer word than dump. It just always triggers brown and smelly associations in me.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK :)

src/main.cpp Outdated
@@ -302,6 +349,18 @@ int main(int argc, const char* argv[]) {
}
};

if (skip_dump_solvers) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does NMODL need to assert the existence of the header files? I'd have expected two modes:

  1. Convert foo.mod to foo.cpp.
  2. Create shared header files that are a prerequites for compiling the translated MOD files.

Note that Step 1 is meaningful whether or not the headers are created. It's perfectly fine for translating MOD files and creating the shared headers to be concurrent operations. The dependency only exists when compiling the translated MOD file, at that point we need the .cpp and all shared headers.

The hope is that we can make do with a single flag, --{create,write}-{shared-headers,prerequisites}.

It also feels a little to specific. When calling nmodl from nrnivmodl I don't particularly want to know exactly which files need to be created. I semantically just want to enable nmodl to create whatever shared header files or other prerequisites it needs. We want it as a separate, manual step, because it makes it easier to avoid race conditions by setting up the correct dependency chains.

To enable adding/removing shared headers from NMODL we'd probably want to agree on a particular file to be generated last, which can act as a target, e.g. "nmodl.hpp". Its existence guarantees that all shared headers have been created.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll go with --write-shared-headers, seem pretty versatile.

If we rely on a singular "nmodl.hpp" being there, that still does not guard against the present headers being outdated / in need of an update. So within NEURON, I would unconditionally write the headers.

@bbpbuildbot

This comment has been minimized.

This first version will create a `solver` directory to contain the same
structure of `newton/newton.hpp` and `crout/crout.hpp` as present in the
NMODL sources.

*By default, NMODL will create the solver headers in the output
directory.*  There are two new arguments to the NMODL invocation:

* `--dump-solvers <directory>` will dump the `solver/*/*.hpp` files into
  the specified directory.
* `--no-dump-solvers` will keep a regular NMODL from creating the solver
  headers.
@bbpbuildbot
Copy link
Collaborator

Logfiles from GitLab pipeline #223168 (:white_check_mark:) have been uploaded here!

Status and direct links:

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.

3 participants