On 21/04/2012 23:36, Vlad wrote:

Will try this within a day or two. At the moment I am simply using a retry loop on ENOSYS and usually no more than one retry is needed.

Ok thanks.

You are probably correct. I was thinking of this code from https://svn.open-mpi.org/trac/hwloc/browser/trunk/src/topology-linux.c:

445 while ((dirent = readdir(taskdir)) != NULL) {

"taskdir" here is /proc/<pid>/task, correct? In which case the threads will be doing readdir() on the same DIR stream...

taskdir is a different DIR* for each thread here: each thread does its own get_last_cpu_location() which calls its own instance of opendir(). Even if the directory behind these DIR* descriptors are the same, it should be fine, there's no concurrency on the same DIR* descriptor in readdir.

Brice







Thanks
Brice

<fix_tids.patch>_______________________________________________
hwloc-users mailing list
hwloc-us...@open-mpi.org <mailto:hwloc-us...@open-mpi.org>
http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users
If the patch doesn't help, can you send your code to help debug things?



_______________________________________________
hwloc-users mailing list
hwloc-us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users

Reply via email to