CoreNeuron
CoreNeuron copied to clipboard
Is extra empty thread still necessary?
io/nrn_setup.cpp has the longstanding comment and code line
// temporary bug work around. If any process has multiple threads, no
// process can have a single thread. So, for now, if one thread, make two.
// Fortunately, empty threads work fine.
// Allocate NrnThread* nrn_threads of size ngroup (minimum 2)
// Note that rank with 0 dataset/cellgroup works fine
nrn_threads_create(userParams.ngroup <= 1 ? 2 : userParams.ngroup);
Is that still an issue? Is so, is the best solution is to have an empty thread on processes needing only one thread?
It does make it a bit more difficult to decide if it is necessary to use a nrn_multithread_job when a direct call to the function will do. (though I suppose userParams.ngroup is an alternative to nrn_nthread in those circumstances.)