[hwloc-devel] Create success (hwloc r1.0a1r1823)

2010-03-11 Thread MPI Team
Creating nightly hwloc snapshot SVN tarball was a success. Snapshot: hwloc 1.0a1r1823 Start time: Thu Mar 11 21:01:05 EST 2010 End time: Thu Mar 11 21:03:04 EST 2010 Your friendly daemon, Cyrador

[hwloc-devel] thread safety

2010-03-11 Thread Jeff Squyres
On Mar 11, 2010, at 3:57 PM, Samuel Thibault wrote: > > What *is* hwloc's policy about thread safety, anyway? > > It would be odd to not be threadsafe, considering the target > applications :) and I believe hwloc is already. Hmm. I'm not so sure. Consider: 1. thread A calls hwloc_topology_ini

[hwloc-devel] [PATCH 2/2] Provide hwloc_cpuset_next() and use it in hwloc_cpuset_foreach

2010-03-11 Thread Bert Wesarg
The hwloc_cpuset_next() will calculate the next cpu behind a given one. Use hwloc_cpuset_first() and hwloc_cpuset_next() in hwloc_cpuset_foreach() to sparsely iterate over a cpuset. Regards, Bert --- doc/Makefile.am|1 + include/hwloc/cpuset.h |9

[hwloc-devel] [PATCH 1/2] semi-colon safe hwloc_cpuset_foreach_{begin, end}()

2010-03-11 Thread Bert Wesarg
It was not clear whether hwloc_cpuset_foreach_end() needs a terminating ';' or not. And hwloc itself had both cases. This converts hwloc_cpuset_foreach_{begin,end}() to use the do-while-(0) idiom to enforce a terminating semi-colon. Note: it is still possible to break and continue this loop. Reg

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mountslines

2010-03-11 Thread Samuel Thibault
Jeff Squyres, le Thu 11 Mar 2010 15:23:35 -0800, a écrit : > On Mar 11, 2010, at 3:14 PM, Bert Wesarg wrote: > > I do not know the policy from this library regarding thread safety, so > > I decided to be on the safe side here. > > What *is* hwloc's policy about thread safety, anyway? It would be

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mounts lines

2010-03-11 Thread Bert Wesarg
On Fri, Mar 12, 2010 at 00:18, Bert Wesarg wrote: > On Fri, Mar 12, 2010 at 00:14, Bert Wesarg wrote: >> On Fri, Mar 12, 2010 at 00:03, Brice Goglin wrote: >>> >>> Did you actually test this ? The way I am reading the manpage is that >>> you need to open with setmntent and close with endmntent.

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mountslines

2010-03-11 Thread Jeff Squyres
On Mar 11, 2010, at 3:14 PM, Bert Wesarg wrote: > I do not know the policy from this library regarding thread safety, so > I decided to be on the safe side here. What *is* hwloc's policy about thread safety, anyway? -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http:

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mounts lines

2010-03-11 Thread Bert Wesarg
On Fri, Mar 12, 2010 at 00:14, Bert Wesarg wrote: > On Fri, Mar 12, 2010 at 00:03, Brice Goglin wrote: >> >> Did you actually test this ? The way I am reading the manpage is that >> you need to open with setmntent and close with endmntent. > > I have read the man page, but only about getmntent, a

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mounts lines

2010-03-11 Thread Bert Wesarg
On Fri, Mar 12, 2010 at 00:03, Brice Goglin wrote: > > Did you actually test this ? The way I am reading the manpage is that > you need to open with setmntent and close with endmntent. I have read the man page, but only about getmntent, and than read the source code for getmntent from glibc. So y

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mounts lines

2010-03-11 Thread Samuel Thibault
Brice Goglin, le Fri 12 Mar 2010 00:03:37 +0100, a écrit : > Also, isn't getmntent (without _r) enough here? I guess it will have troubles if it is called concurrently in different threads: the value returned by getmntent is typically not dynamically allocated. Samuel

Re: [hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mounts lines

2010-03-11 Thread Brice Goglin
Bert Wesarg wrote: > This does multiple things at once: > > I) it uses getmntent_r(3) to parse lines from /proc/mounts > > II) while doing this, it uses the correct un-escape rules for this > file format. > > The current code converts "\ " to " ", while linux uses a "\040" to > " "

[hwloc-devel] [PATCH] Use getmntent_r(3) to parse /proc/mounts lines

2010-03-11 Thread Bert Wesarg
This does multiple things at once: I) it uses getmntent_r(3) to parse lines from /proc/mounts II) while doing this, it uses the correct un-escape rules for this file format. The current code converts "\ " to " ", while linux uses a "\040" to " " escaping rule. III) it accurate

Re: [hwloc-devel] [PATCH] Use the #links as an estimate for the #tids in a tasks directory

2010-03-11 Thread Brice Goglin
Applied thanks! Brice Bert Wesarg wrote: > When reading all tids from a process in > topology-linux.c::hwloc_linux_get_proc_tids(), it used a > exponential realloc algorithm to increase the storage size for the tids. > > Now it uses the number of links (.st_nlinks) from a stat() call to the >