-
Notifications
You must be signed in to change notification settings - Fork 115
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
from neuron import coreneuron specifies CoreNEURON run properties #643
Conversation
coreneuron.nrncore_arg(tstop) returns str that can be used with pc.nrncore_run(str) based on coreneuron properties and current NEURON settings. User specifiable properties are enable, gpu, cell_permute, warp_balance, verbose, and prcellstate. Args derived from current NEURON settings are --mpi, --binqueue, --spkcompress, --multisend, --ms_subinterval, and --ms_phases.
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.
looks ok to me. but we can tune / update once psolve changes are in.
''' | ||
Check type and value in range for the user properties. | ||
''' | ||
assert(type(tstop) is float) |
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.
if user set int then it is also treated as float?
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.
what do you think about
tstop = float(tstop) # error if can't be a float
enable = bool(enable)
gpu = bool(gpu)
cell_permute = int(cell_permute)
I suppose the last two would never raise an error.
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 think this is fine. If we will need more elaborate option validation, we can extend it later.
The error handling definitely needs work if CoreNEURON does not work.
@nrnhines : is this ready for basic testing? If so, what are steps we need to do? e.g.
I wonder about |
It is ready for basic testing. Please examine the output of this test.
It is tempting to check and set in neuron.coreneuron.nrncore_arg(tstop) but after setting it requires a stdinit(). That may be too far. (although it would almost be safe to set in enable if that was a function.) |
Just thinking loud : stdinit / finitialize can check if coreneuron is enabled and then set it cache_efficient(1) as first thing? |
I experimented and see that if I have changed
So your idea would work unless they set enable after finitialize() |
I might be able to fix both the normal psolve segmentation violation and the nrncore_run complaint of Model internal structures out of date by factoring out the first part of nrn_finitialize() to do the internal structure update (no data value changes but pointers get updated as well) One consequece would be that |
Another possibility to avoid the |
If not, raises the error: NEURON model internal structures are out of date
Agree. We can make this mandatory and can re-evaluate other possibilities later. |
Need any more for now? Looks like we are supporting
And deferring subsequent |
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.
Some minor comments. Once these are answered/clarified, good to merge. (already approving)
coreneuron.nrncore_arg(tstop) returns str that can be used with
pc.nrncore_run(str) based on coreneuron properties and current
NEURON settings. User specifiable properties are enable, gpu,
cell_permute, warp_balance, verbose, and prcellstate. Args derived
from current NEURON settings are --mpi, --binqueue, --spkcompress,
--multisend, --ms_subinterval, and --ms_phases.
Closes #639