CoreNeuron icon indicating copy to clipboard operation
CoreNeuron copied to clipboard

Is extra empty thread still necessary?

Open nrnhines opened this issue 3 years ago • 0 comments

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.)

nrnhines avatar Nov 25 '21 15:11 nrnhines