@@ -743,12 +743,6 @@ main (int argc, char *argv[])
743
743
if (!loutput .cpubind_set || !loutput .membind_set )
744
744
goto out ;
745
745
746
- err = hwloc_topology_init (& topology );
747
- if (err )
748
- goto out ;
749
- hwloc_topology_set_all_types_filter (topology , HWLOC_TYPE_FILTER_KEEP_ALL );
750
- hwloc_topology_set_io_types_filter (topology , HWLOC_TYPE_FILTER_KEEP_IMPORTANT );
751
-
752
746
while (argc >= 1 )
753
747
{
754
748
opt = 0 ;
@@ -977,7 +971,7 @@ main (int argc, char *argv[])
977
971
goto out_usagefailure ;
978
972
flags = hwloc_utils_parse_topology_flags (argv [1 ]);
979
973
if (flags == (unsigned long )-1 )
980
- goto out_with_topology ;
974
+ goto out ;
981
975
opt = 1 ;
982
976
}
983
977
else if (!strcmp (argv [0 ], "--restrict" )) {
@@ -996,23 +990,23 @@ main (int argc, char *argv[])
996
990
goto out_usagefailure ;
997
991
restrict_flags = hwloc_utils_parse_restrict_flags (argv [1 ]);
998
992
if (restrict_flags == (unsigned long )-1 )
999
- goto out_with_topology ;
993
+ goto out ;
1000
994
opt = 1 ;
1001
995
}
1002
996
else if (!strcmp (argv [0 ], "--export-xml-flags" )) {
1003
997
if (argc < 2 )
1004
998
goto out_usagefailure ;
1005
999
loutput .export_xml_flags = hwloc_utils_parse_export_xml_flags (argv [1 ]);
1006
1000
if (loutput .export_xml_flags == (unsigned long )-1 )
1007
- goto out_with_topology ;
1001
+ goto out ;
1008
1002
opt = 1 ;
1009
1003
}
1010
1004
else if (!strcmp (argv [0 ], "--export-synthetic-flags" )) {
1011
1005
if (argc < 2 )
1012
1006
goto out_usagefailure ;
1013
1007
loutput .export_synthetic_flags = hwloc_utils_parse_export_synthetic_flags (argv [1 ]);
1014
1008
if (loutput .export_synthetic_flags == (unsigned long )-1 )
1015
- goto out_with_topology ;
1009
+ goto out ;
1016
1010
opt = 1 ;
1017
1011
}
1018
1012
else if (!strcmp (argv [0 ], "--horiz" ))
@@ -1325,6 +1319,12 @@ main (int argc, char *argv[])
1325
1319
* Configure the topology
1326
1320
*/
1327
1321
1322
+ err = hwloc_topology_init (& topology );
1323
+ if (err )
1324
+ goto out ;
1325
+ hwloc_topology_set_all_types_filter (topology , HWLOC_TYPE_FILTER_KEEP_ALL );
1326
+ hwloc_topology_set_io_types_filter (topology , HWLOC_TYPE_FILTER_KEEP_IMPORTANT );
1327
+
1328
1328
err = hwloc_topology_set_flags (topology , flags );
1329
1329
if (err < 0 ) {
1330
1330
fprintf (stderr , "Failed to set flags %lx (%s).\n" , flags , strerror (errno ));
@@ -1505,6 +1505,8 @@ main (int argc, char *argv[])
1505
1505
1506
1506
out_usagefailure :
1507
1507
usage (callname , stderr );
1508
+ goto out ;
1509
+
1508
1510
out_with_topology :
1509
1511
lstopo_destroy_userdata (hwloc_get_root_obj (topology ));
1510
1512
hwloc_topology_destroy (topology );
0 commit comments