Hello,

The CPUModel attribute should be only in Socket or machine/root objects.
At least, that's what I documented and what I seem to see in the code.
Did you actually see any other place?

So it may just mean that the CPUModel is not available on your machine?
Or maybe the code below is buggy somehow? Does lstopo -v on Windows show
a CPUModel attribute? It does in a 32bits binary running on my Win7
64bits, but doesn't seem to find anything when running the 64bits
binary. I don't remember well if there was a specific Windows 64bits
issue in the cpuid code in the x86 backend.

Brice



Le 28/01/2014 01:59, Robin Scher a écrit :
> Hi again.
>
> I'm trying to use hwloc 1.8 on Windows, Linux and Mac to get the CPU model 
> string (e.g., "Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz"). Since hwloc on 
> different platforms seem to stash this in different objects, I'm using code 
> like this:
>
> String name;
> hwloc_obj_type_t objs[] = { 
>     HWLOC_OBJ_MACHINE, 
>     HWLOC_OBJ_SOCKET, 
>     HWLOC_OBJ_CORE, 
>     HWLOC_OBJ_PU, };
> for( size_t index = 0; index < (sizeof( objs ) / sizeof( hwloc_obj_type_t )) 
> && name.Empty(); ++index )
> {
>     hwloc_obj_t obj = hwloc_get_obj_by_type( topology, objs[ index ], 0 );
>     if( !obj ) continue;
>     const char *str = hwloc_obj_get_info_by_name( obj, "CPUModel" );
>     if( str ) name = String( str ).Trim();
> }
>
> On Mac, it works (found string at HWLOC_OBJ_MACHINE), and on Linux it works 
> (found string at HWLOC_OBJ_SOCKET), but on Windows x64, none of these find 
> the string. They all return a NULL pointer.
>
> Am I missing something? I tried a few other of the object types, but didn't 
> find it with them either (I actually tried looping through all integer values 
> between 0 and HWLOC_OBJ_TYPE_MAX and it didn't appear in any of them).
>
> Thank you for any help you can provide.
> -robin
>
> Robin Scher
> ro...@uberware.net
> +1 (213) 448-0443
>
>
>
>
>
> _______________________________________________
> hwloc-users mailing list
> hwloc-us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users

Reply via email to