@@ -38,12 +38,14 @@ static const char FUNC_NAME[] = "OMPI_Affinity";
38
38
static const char ompi_nobind_str [] = "Open MPI did not bind this process" ;
39
39
static const char not_bound_str [] = "Not bound (i.e., bound to all processors)" ;
40
40
41
+ #if OPAL_HAVE_HWLOC
41
42
static int get_rsrc_ompi_bound (char str [OMPI_AFFINITY_STRING_MAX ]);
42
43
static int get_rsrc_current_binding (char str [OMPI_AFFINITY_STRING_MAX ]);
43
44
static int get_rsrc_exists (char str [OMPI_AFFINITY_STRING_MAX ]);
44
45
static int get_layout_ompi_bound (char str [OMPI_AFFINITY_STRING_MAX ]);
45
46
static int get_layout_current_binding (char str [OMPI_AFFINITY_STRING_MAX ]);
46
47
static int get_layout_exists (char str [OMPI_AFFINITY_STRING_MAX ]);
48
+ #endif /* OPAL_HAVE_HWLOC */
47
49
48
50
/*---------------------------------------------------------------------------*/
49
51
@@ -52,19 +54,25 @@ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type,
52
54
char current_binding [OMPI_AFFINITY_STRING_MAX ],
53
55
char exists [OMPI_AFFINITY_STRING_MAX ])
54
56
{
57
+ #if OPAL_HAVE_HWLOC
55
58
int ret ;
59
+ #endif /* OPAL_HAVE_HWLOC */
56
60
57
61
memset (ompi_bound , 0 , OMPI_AFFINITY_STRING_MAX );
58
62
memset (current_binding , 0 , OMPI_AFFINITY_STRING_MAX );
59
63
60
64
/* If we have no hwloc support, return nothing */
61
- if (NULL == opal_hwloc_topology ) {
65
+ #if OPAL_HAVE_HWLOC
66
+ if (NULL == opal_hwloc_topology )
67
+ #endif /* OPAL_HAVE_HWLOC */
68
+ {
62
69
strncpy (ompi_bound , "Not supported" , OMPI_AFFINITY_STRING_MAX );
63
70
strncpy (current_binding , "Not supported" , OMPI_AFFINITY_STRING_MAX );
64
71
strncpy (exists , "Not supported" , OMPI_AFFINITY_STRING_MAX );
65
72
return MPI_SUCCESS ;
66
73
}
67
74
75
+ #if OPAL_HAVE_HWLOC
68
76
/* Otherwise, return useful information */
69
77
switch (fmt_type ) {
70
78
case OMPI_AFFINITY_RSRC_STRING_FMT :
@@ -86,8 +94,10 @@ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type,
86
94
}
87
95
88
96
return MPI_SUCCESS ;
97
+ #endif /* OPAL_HAVE_HWLOC */
89
98
}
90
99
100
+ #if OPAL_HAVE_HWLOC
91
101
/*---------------------------------------------------------------------------*/
92
102
93
103
/*
@@ -275,7 +285,7 @@ static int get_rsrc_exists(char str[OMPI_AFFINITY_STRING_MAX])
275
285
}
276
286
}
277
287
}
278
- }
288
+ }
279
289
280
290
return OMPI_SUCCESS ;
281
291
}
@@ -418,3 +428,4 @@ static int get_layout_exists(char str[OMPI_AFFINITY_STRING_MAX])
418
428
419
429
return OMPI_SUCCESS ;
420
430
}
431
+ #endif /* OPAL_HAVE_HWLOC */
0 commit comments