Skip to content
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

NSLOTS in ANTS #18

Closed
satra opened this issue May 10, 2013 · 9 comments
Closed

NSLOTS in ANTS #18

satra opened this issue May 10, 2013 · 9 comments

Comments

@satra
Copy link
Collaborator

satra commented May 10, 2013

i'm trying to ask antsRegistration to use 4 threads/procs via the NSLOTS parameter, which is respected in ITK, but it doesn't seem to want to use more than 2 processes. have any of you come across this before?

@ntustison
Copy link
Member

Maybe you should say "please."

@ntustison
Copy link
Member

:-)

Do you use the global variable to specify the number of threads?

@ntustison
Copy link
Member

The environmental variable is

ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS

@hjmjohnson
Copy link
Collaborator

NSLOTS is also respected.

/* The ITK_NUMBER_OF_THREADS_ENV_LIST contains is an

  • environmental variable that holds a ':' separated

  • list of environmental variables that whould be

  • queried in order for setting the m_GlobalMaximumNumberOfThreads.
    *

  • This is intended to be a mechanism suitable to easy

  • runtime modification to ease using the proper number

  • of threads for load balancing batch processing

  • systems where the number of threads

  • authorized for use may be less than the number

  • of physical processors on the computer.
    *

  • This list contains the Sun|Oracle Grid Engine

  • environmental variable "NSLOTS" by default
    */

    //NOTE: We always put "ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS" at the end unconditionally.
    itkNumberOfThreadsEvnListString += ":ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS";

So by default NSLOTS is respected first if it exists in the calling environment, and ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS is checked second.

I use the NSLOTS to control number of threads all the time. I am pretty sure that it works.

@satra
Copy link
Collaborator Author

satra commented May 10, 2013

i said "pretty please" - didn't budge.

hans changed ITK to also respect NSLOTS

itkNumberOfThreadsEvnListString = "NSLOTS:ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS";

and i don't see either ITK_GLOBAL_DE... or NSLOTS in the source tree for ANTS, so i would have thought it would trigger it.

but now in one environment i see both being set to different values, but i thought it would prefer NSLOTS over the other one, but that doesn't seem to be the case.

@satra
Copy link
Collaborator Author

satra commented May 10, 2013

perhaps i've forgotten my forks and threads. would setting NSLOTS=4 show 4 antsRegistration processes with ps?

@hjmjohnson
Copy link
Collaborator

Satra, ANTS has no parts that are multi threaded outside of ITK, so the only part that would benefit from multiple cores is the underlying ITK. ..... WAIT!!!! .... Are you talking ANTS or antsRegistration? I don't know if ANTS is multithreaded at all. antsRegistration is the ITKv4 re-write of ANTS, and it is the only thing that I use.

@ntustison
Copy link
Member

ANTS is not multithreaded except for the called ITK filters. antsRegistration, on the other hand, is multithreaded with the metrics and optimizers.

@satra
Copy link
Collaborator Author

satra commented May 10, 2013

i am running antsRegistration - the process that's running was setup up with NSLOTS=4 (hans, via num_threads=4) and i'm only seeing 2 processes.

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

No branches or pull requests

4 participants