|
25 | 25 | * Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
|
26 | 26 | * Copyright (c) 2021 Nanook Consulting. All rights reserved.
|
27 | 27 | * Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
|
28 |
| - * Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV) |
| 28 | + * Copyright (c) 2022-2023 Computer Architecture and VLSI Systems (CARV) |
29 | 29 | * Laboratory, ICS Forth. All rights reserved.
|
30 | 30 | * $COPYRIGHT$
|
31 | 31 | *
|
@@ -240,9 +240,16 @@ int opal_register_util_params(void)
|
240 | 240 |
|
241 | 241 | /* Var-dump color */
|
242 | 242 |
|
243 |
| - string = opal_argv_join_range(opal_var_dump_color_keys, 0, OPAL_VAR_DUMP_COLOR_KEY_COUNT, ','); |
244 |
| - if (NULL == string) { |
245 |
| - return OPAL_ERR_OUT_OF_RESOURCE; |
| 243 | + string = NULL; |
| 244 | + |
| 245 | + for (int i = 0; i < OPAL_VAR_DUMP_COLOR_KEY_COUNT; i++) { |
| 246 | + ret = opal_asprintf(&tmp, "%s%s%s", (i > 0 ? string : ""), |
| 247 | + (i > 0 ? "," : ""), opal_var_dump_color_keys[i]); |
| 248 | + free(string); |
| 249 | + string = tmp; |
| 250 | + if (0 > ret) { |
| 251 | + return OPAL_ERR_OUT_OF_RESOURCE; |
| 252 | + } |
246 | 253 | }
|
247 | 254 |
|
248 | 255 | ret = opal_asprintf(&tmp, "The colors to use when dumping MCA vars with color "
|
@@ -474,10 +481,17 @@ static int parse_color_string(char *color_string, char **key_names,
|
474 | 481 | }
|
475 | 482 |
|
476 | 483 | if (!key_found) {
|
477 |
| - char *valid_keys = opal_argv_join_range(key_names, 0, key_count, ','); |
478 |
| - if (NULL == valid_keys) { |
479 |
| - return_code = OPAL_ERR_OUT_OF_RESOURCE; |
480 |
| - goto end; |
| 484 | + char *tmp, *valid_keys = NULL; |
| 485 | + |
| 486 | + for (int i = 0; i < key_count; i++) { |
| 487 | + ret = opal_asprintf(&tmp, "%s%s%s", (i > 0 ? valid_keys : ""), |
| 488 | + (i > 0 ? "," : ""), key_names[i]); |
| 489 | + free(valid_keys); |
| 490 | + valid_keys = tmp; |
| 491 | + if (0 > ret) { |
| 492 | + return_code = OPAL_ERR_OUT_OF_RESOURCE; |
| 493 | + goto end; |
| 494 | + } |
481 | 495 | }
|
482 | 496 |
|
483 | 497 | opal_show_help("help-opal-runtime.txt", "mpi-params:var_dump_color:unknown-key",
|
|
0 commit comments