Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Is extra empty thread still necessary? #696

Open
nrnhines opened this issue Nov 25, 2021 · 0 comments
Open

Is extra empty thread still necessary? #696

nrnhines opened this issue Nov 25, 2021 · 0 comments

Comments

@nrnhines
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant