File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -110,12 +110,15 @@ resource_speed::resource_speed(uct_component_h component,
110
110
std::vector<uct_test_base::md_resource> uct_test_base::enum_md_resources () {
111
111
112
112
static std::vector<uct_test::md_resource> all_md_resources;
113
+ static bool populated = false ;
113
114
114
- if (all_md_resources. empty () ) {
115
+ if (!populated ) {
115
116
uct_component_h *uct_components;
116
117
unsigned num_components;
117
118
ucs_status_t status;
118
119
120
+ const char *str = getenv (" GTEST_MAX_COMP_RESOURCES" );
121
+
119
122
status = uct_query_components (&uct_components, &num_components);
120
123
ASSERT_UCS_OK (status);
121
124
@@ -147,12 +150,19 @@ std::vector<uct_test_base::md_resource> uct_test_base::enum_md_resources() {
147
150
&component_attr_resouces);
148
151
ASSERT_UCS_OK (status);
149
152
153
+ int md_resource_count = md_rsc.cmpt_attr .md_resource_count ;
154
+ if (str != NULL ) {
155
+ md_resource_count = ucs_min (md_resource_count, atoi (str));
156
+ }
157
+
150
158
for (unsigned md_index = 0 ;
151
- md_index < md_rsc. cmpt_attr . md_resource_count ; ++md_index) {
159
+ md_index < md_resource_count; ++md_index) {
152
160
md_rsc.rsc_desc = md_resources[md_index];
153
161
all_md_resources.push_back (md_rsc);
154
162
}
155
163
}
164
+
165
+ populated = true ;
156
166
}
157
167
158
168
return all_md_resources;
You can’t perform that action at this time.
0 commit comments