Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] multiple simultaneous topology inits?
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-02-28 16:04:44


On Feb 28, 2011, at 3:52 PM, Guy Streeter wrote:

> I was considering the design of an administration tool in python, and my original idea was to have each module that needs the topology object create its own. This means that different parts of the same program (but possibly in different threads) would call init and load on their own topology structure, and use that structure in their hwloc routines calls.

If you're only doing this a few times, it's probably fine.

That being said, someone cited on this list a long time ago that running the hwloc detection on very large machines (e.g., SGI machines with 1000+ cores) takes on the order of seconds (because it traverses /sys, etc.). So if you want your tool to be used on machines like that, then it might be better to do the discovery once and share that data among your threads.

My own bias is that if all the data is going to be read-only, discover once and share the data among threads. Depending on your layers of abstraction, this may or may not be easy to do.

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/