Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] RFC: make hwloc be a 1st-class citizen
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-09-12 09:07:26


On Sep 12, 2011, at 8:51 AM, Jeff Squyres wrote:

> *** Remember that although the opal_hwloc_topology global variable will always be available, ##IT MAY BE NULL## on platforms where hwloc was compiled out / not supported. Therefore, you MUST protect access to hwloc API calls with #if OPAL_HAVE_HWLOC! See the original RFC text below.

Oops! Ralph just reminded me that this was slightly inaccurate.

If hwloc is not present, then the global variable opal_hwloc_topology won't be present at all (because its corresponding hwloc type won't be available). Hence, the example in the original RFC isn't quite right:

>> if (NULL != opal_hwloc_topology) {
>> #if OPAL_HAVE_HWLOC
>> // ...use hwloc API, etc.
>> #endif
>> }

This really should be:

#if OPAL_HAVE_HWLOC
  if (NULL != opal_hwloc_topology) {
      // ...use hwloc API, etc.
  }
#endif

Sorry for the confusion!

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