Ralph noticed the following when working on integrating hwloc deeply into OMPI, 
and suggests the attached patch.  Does it look good to you guys?

-----

Something isn't right with hwloc_obj_attr_snprintf() when the object is a 
cache. I get this when printing the topology of my Mac:

        Detected Resources:     Type: Machine Number of child objects: 1
                Name=NULL
                total=3145728KB
                Backend=Darwin
                OSName=Darwin
                OSRelease=10.8.0
                OSVersion="Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 
PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386"
                Architecture=i386
                Cpuset:  0x00000003
                Online:  0x00000003
                Allowed: 0x00000003
                Type: NUMANode Number of child objects: 1
                        Name=NULL
                        local=3145728KB
                        total=3145728KB
                        Cpuset:  0x00000003
                        Online:  0x00000003
                        Allowed: 0x00000003
                        Type: Socket Number of child objects: 1
                                Name=NULL
                                
                                Cpuset:  0x00000003
                                Online:  0x00000003
                                Allowed: 0x00000003
                                Type: L2Cache Number of child objects: 2
                                        Name=NULL
                                        4096KB
                                        line=64
                                        Cpuset:  0x00000003
                                        Online:  0x00000003
                                        Allowed: 0x00000003
                                        Type: L1Cache Number of child objects: 1
                                                Name=NULL
                                                32KB
                                                line=64
                                                Cpuset:  0x00000001
                                                Online:  0x00000001
                                                Allowed: 0x00000001
                                                Type: Core Number of child 
objects: 1
                                                        Name=NULL
                                                        
                                                        Cpuset:  0x00000001
                                                        Online:  0x00000001
                                                        Allowed: 0x00000001
                                                        Type: PU Number of 
child objects: 0
                                                                Name=NULL
                                                                
                                                                Cpuset:  
0x00000001
                                                                Online:  
0x00000001
                                                                Allowed: 
0x00000001
                                        Type: L1Cache Number of child objects: 1
                                                Name=NULL
                                                32KB
                                                line=64
                                                Cpuset:  0x00000002
                                                Online:  0x00000002
                                                Allowed: 0x00000002
                                                Type: Core Number of child 
objects: 1
                                                        Name=NULL
                                                        
                                                        Cpuset:  0x00000002
                                                        Online:  0x00000002
                                                        Allowed: 0x00000002
                                                        Type: PU Number of 
child objects: 0
                                                                Name=NULL
                                                                
                                                                Cpuset:  
0x00000002
                                                                Online:  
0x00000002
                                                                Allowed: 
0x00000002

Note that I get an empty line (it is non-NULL and has length > 0) when there 
are no attrs at all, but attrs is non-NULL (see the output for the cores). The 
output for the caches shows "32KB", but no title explaining what that value 
means. Likewise, I get a "line=64" output, which makes no sense.

The attached patch clarifies the output.

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

Attachment: printattr.diff
Description: Binary data

Reply via email to