-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6e8c7a0
to
579a1bd
Compare
Codecov ReportAttention: Patch coverage is
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. |
This comment has been minimized.
This comment has been minimized.
d06a5d6
to
ee5421f
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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:
- Convert
foo.mod
tofoo.cpp
. - 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.
There was a problem hiding this comment.
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.
This comment has been minimized.
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.
d17fa19
to
9d4696a
Compare
Logfiles from GitLab pipeline #223168 (:white_check_mark:) have been uploaded here! Status and direct links: |
This first version will create a
solver
directory to contain the samenewton.hpp
andcrout.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 correspondingsolver/*.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