Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [hwloc-devel] What does this C99 notation mean?
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-02-14 08:20:55


On Feb 14, 2011, at 8:14 AM, Jeff Squyres wrote:

>>> static void
>>> hwloc_setup_groups_from_distances(struct hwloc_topology *topology,
>>> unsigned nbobjs,
>>> struct hwloc_obj **objs,
>>> float *_distances)
>>> {
>>> float (*distances)[nbobjs][nbobjs] = (float (*)[nbobjs][nbobjs])_distances;
>
> Does it silently make a (temporary) 2nd array of pointers for the 2nd dimension indexing, or does the compiler translate all distances[i][j] to _distances[i*nbojbs + j] ?

Let me re-phrase that, because the way I phrased it, I could guess that that detail might be implementation-dependent.

What I meant was: _distances is clearly a 1D array. Does the above C99 notation say "treat this 1D array like a 2D array of size [x][y]"? And then how it actually happens underneath is implementation dependent (e.g., whether it makes a silent/temporary array or pointers, or converts indexing)?

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