orcm/mca/sensor/pwr/sensor_pwr.c
/* go thru our topology and check the sockets
 * to see if they contain a match - at this time,
 * we don't support hetero sockets, so any mismatch
 * will disqualify us
 */
go thru our topology and check the sockets
to see if they contain a match - at this time,
we don't support hetero sockets, so any mismatch
will disqualify us
go thru our topology and check the sockets to see if they contain a match - at this time we don ' t support hetero sockets so any mismatch will disqualify us
static int check_cpu_type(void)
{
    hwloc_obj_t obj;
    unsigned k;
    if (NULL == (obj = hwloc_get_obj_by_type(opal_hwloc_topology, HWLOC_OBJ_SOCKET, 0))) {
        orte_show_help("help-orcm-sensor-pwr.txt", "no-sockets", true);
        return ORTE_ERROR;
    }
    while (NULL != obj) {
        for (k=0; k < obj->infos_count; k++) {
            if (0 == strcmp(obj->infos[k].name, "CPUModelNumber") &&
                NULL != obj->infos[k].value) {
                mca_sensor_pwr_component.model = strtoul(obj->infos[k].value, NULL, 10);
                switch (mca_sensor_pwr_component.model) {
		case CPU_SANDYBRIDGE:
                    opal_output_verbose(2, orcm_sensor_base_framework.framework_output,
                                        "sensor:pwr Found Sandybridge CPU");
                    return ORCM_SUCCESS;
		case CPU_SANDYBRIDGE_EP:
                    opal_output_verbose(2, orcm_sensor_base_framework.framework_output,
                                        "sensor:pwr Found Sandybridge-EP CPU");
                    return ORCM_SUCCESS;
		case CPU_IVYBRIDGE:
                    opal_output_verbose(2, orcm_sensor_base_framework.framework_output,
                                        "sensor:pwr Found Ivybridge CPU");
                    return ORCM_SUCCESS;
		case CPU_IVYBRIDGE_EP:
                    opal_output_verbose(2, orcm_sensor_base_framework.framework_output,
                                        "sensor:pwr Found Ivybridge-EP CPU");
                    return ORCM_SUCCESS;
		case CPU_HASWELL:
                    opal_output_verbose(2, orcm_sensor_base_framework.framework_output,
                                        "sensor:pwr Found Haswell CPU");
                    return ORCM_SUCCESS;
		default:
                    orte_show_help("help-orcm-sensor-pwr.txt", "unsupporcmd-model",
                                   true, mca_sensor_pwr_component.model);
                    return ORTE_ERROR;
                }
            }
        }
        obj = obj->next_sibling;
    }
    return ORTE_ERROR;
}
static int check_cpu_type ( void ) { hwloc_obj_t obj ; unsigned k ; if ( NULL == ( obj = hwloc_get_obj_by_type ( opal_hwloc_topology , HWLOC_OBJ_SOCKET , 0 ) ) ) { orte_show_help ( " " , " " , true ) ; return ORTE_ERROR ; } while ( NULL != obj ) { for ( k = 0 ; k < obj -> infos_count ; k ++ ) { if ( 0 == strcmp ( obj -> infos [ k ] . name , " " ) && NULL != obj -> infos [ k ] . value ) { mca_sensor_pwr_component . model = strtoul ( obj -> infos [ k ] . value , NULL , 10 ) ; switch ( mca_sensor_pwr_component . model ) { case CPU_SANDYBRIDGE : opal_output_verbose ( 2 , orcm_sensor_base_framework . framework_output , " " ) ; return ORCM_SUCCESS ; case CPU_SANDYBRIDGE_EP : opal_output_verbose ( 2 , orcm_sensor_base_framework . framework_output , " " ) ; return ORCM_SUCCESS ; case CPU_IVYBRIDGE : opal_output_verbose ( 2 , orcm_sensor_base_framework . framework_output , " " ) ; return ORCM_SUCCESS ; case CPU_IVYBRIDGE_EP : opal_output_verbose ( 2 , orcm_sensor_base_framework . framework_output , " " ) ; return ORCM_SUCCESS ; case CPU_HASWELL : opal_output_verbose ( 2 , orcm_sensor_base_framework . framework_output , " " ) ; return ORCM_SUCCESS ; default : orte_show_help ( " " , " " , true , mca_sensor_pwr_component . model ) ; return ORTE_ERROR ; } } } obj = obj -> next_sibling ; } return ORTE_ERROR ; }
go thru our topology and check the sockets
 to see if they contain a match - at this time,
 we don't support hetero sockets, so any mismatch
 will disqualify us
go thru our topology and check the sockets to see if they contain a match - at this time we don ' t support hetero sockets so any mismatch will disqualify us
/* there are no sockets identified in this machine */