@@ -5052,24 +5052,6 @@ hwloc_linux_free_cpuinfo(struct hwloc_linux_cpuinfo_proc * Lprocs, unsigned nump
50525052 ****** Main Topology Discovery ******
50535053 *************************************/
50545054
5055- static void
5056- hwloc__linux_get_mic_sn (struct hwloc_topology * topology , struct hwloc_linux_backend_data_s * data )
5057- {
5058- char line [64 ], * tmp , * end ;
5059- if (hwloc_read_path_by_length ("/proc/elog" , line , sizeof (line ), data -> root_fd ) < 0 )
5060- return ;
5061- if (strncmp (line , "Card " , 5 ))
5062- return ;
5063- tmp = line + 5 ;
5064- end = strchr (tmp , ':' );
5065- if (!end )
5066- return ;
5067- * end = '\0' ;
5068-
5069- if (tmp [0 ])
5070- hwloc_obj_add_info (hwloc_get_root_obj (topology ), "MICSerialNumber" , tmp );
5071- }
5072-
50735055static void
50745056hwloc_gather_system_info (struct hwloc_topology * topology ,
50755057 struct hwloc_linux_backend_data_s * data )
@@ -5450,8 +5432,6 @@ hwloc_linuxfs_look_cpu(struct hwloc_backend *backend, struct hwloc_disc_status *
54505432 free (cpuset_name );
54515433 }
54525434
5453- hwloc__linux_get_mic_sn (topology , data );
5454-
54555435 /* data->utsname was filled with real uname or \0, we can safely pass it */
54565436 hwloc_add_uname_info (topology , & data -> utsname );
54575437
@@ -6136,95 +6116,6 @@ hwloc_linuxfs_lookup_infiniband_class(struct hwloc_backend *backend, unsigned os
61366116 return 0 ;
61376117}
61386118
6139- static void
6140- hwloc_linuxfs_mic_class_fillinfos (int root_fd ,
6141- struct hwloc_obj * obj , const char * osdevpath )
6142- {
6143- char path [296 ]; /* osdevpath <= 256 */
6144- char family [64 ];
6145- char sku [64 ];
6146- char sn [64 ];
6147- char string [21 ];
6148-
6149- obj -> subtype = strdup ("MIC" );
6150-
6151- snprintf (path , sizeof (path ), "%s/family" , osdevpath );
6152- if (!hwloc_read_path_by_length (path , family , sizeof (family ), root_fd )) {
6153- char * eol = strchr (family , '\n' );
6154- if (eol )
6155- * eol = 0 ;
6156- hwloc_obj_add_info (obj , "MICFamily" , family );
6157- }
6158-
6159- snprintf (path , sizeof (path ), "%s/sku" , osdevpath );
6160- if (!hwloc_read_path_by_length (path , sku , sizeof (sku ), root_fd )) {
6161- char * eol = strchr (sku , '\n' );
6162- if (eol )
6163- * eol = 0 ;
6164- hwloc_obj_add_info (obj , "MICSKU" , sku );
6165- }
6166-
6167- snprintf (path , sizeof (path ), "%s/serialnumber" , osdevpath );
6168- if (!hwloc_read_path_by_length (path , sn , sizeof (sn ), root_fd )) {
6169- char * eol ;
6170- eol = strchr (sn , '\n' );
6171- if (eol )
6172- * eol = 0 ;
6173- hwloc_obj_add_info (obj , "MICSerialNumber" , sn );
6174- }
6175-
6176- snprintf (path , sizeof (path ), "%s/active_cores" , osdevpath );
6177- if (!hwloc_read_path_by_length (path , string , sizeof (string ), root_fd )) {
6178- unsigned long count = strtoul (string , NULL , 16 );
6179- snprintf (string , sizeof (string ), "%lu" , count );
6180- hwloc_obj_add_info (obj , "MICActiveCores" , string );
6181- }
6182-
6183- snprintf (path , sizeof (path ), "%s/memsize" , osdevpath );
6184- if (!hwloc_read_path_by_length (path , string , sizeof (string ), root_fd )) {
6185- unsigned long count = strtoul (string , NULL , 16 );
6186- snprintf (string , sizeof (string ), "%lu" , count );
6187- hwloc_obj_add_info (obj , "MICMemorySize" , string );
6188- }
6189- }
6190-
6191- static int
6192- hwloc_linuxfs_lookup_mic_class (struct hwloc_backend * backend , unsigned osdev_flags )
6193- {
6194- struct hwloc_linux_backend_data_s * data = backend -> private_data ;
6195- int root_fd = data -> root_fd ;
6196- unsigned idx ;
6197- DIR * dir ;
6198- struct dirent * dirent ;
6199-
6200- dir = hwloc_opendir ("/sys/class/mic" , root_fd );
6201- if (!dir )
6202- return 0 ;
6203-
6204- while ((dirent = readdir (dir )) != NULL ) {
6205- char path [256 ];
6206- hwloc_obj_t obj , parent ;
6207-
6208- if (!strcmp (dirent -> d_name , "." ) || !strcmp (dirent -> d_name , ".." ))
6209- continue ;
6210- if (sscanf (dirent -> d_name , "mic%u" , & idx ) != 1 )
6211- continue ;
6212-
6213- snprintf (path , sizeof (path ), "/sys/class/mic/mic%u" , idx );
6214- parent = hwloc_linuxfs_find_osdev_parent (backend , root_fd , path , osdev_flags );
6215- if (!parent )
6216- continue ;
6217-
6218- obj = hwloc_linux_add_os_device (backend , parent , HWLOC_OBJ_OSDEV_COPROC , dirent -> d_name );
6219-
6220- hwloc_linuxfs_mic_class_fillinfos (root_fd , obj , path );
6221- }
6222-
6223- closedir (dir );
6224-
6225- return 0 ;
6226- }
6227-
62286119static int
62296120hwloc_linuxfs_lookup_drm_class (struct hwloc_backend * backend , unsigned osdev_flags )
62306121{
@@ -6784,7 +6675,6 @@ hwloc_look_linuxfs(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
67846675 hwloc_linuxfs_lookup_dax_class (backend , osdev_flags );
67856676 hwloc_linuxfs_lookup_net_class (backend , osdev_flags );
67866677 hwloc_linuxfs_lookup_infiniband_class (backend , osdev_flags );
6787- hwloc_linuxfs_lookup_mic_class (backend , osdev_flags );
67886678 if (ofilter != HWLOC_TYPE_FILTER_KEEP_IMPORTANT ) {
67896679 hwloc_linuxfs_lookup_drm_class (backend , osdev_flags );
67906680 hwloc_linuxfs_lookup_dma_class (backend , osdev_flags );
0 commit comments