From 608249bf98800fc5d400d42e55c75d3571cdeb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20K=2E=20Guti=C3=A9rrez?= Date: Wed, 19 Feb 2025 16:00:29 -0700 Subject: [PATCH] Allow users to specify bind string listing types. (#309) This commit allows users to specify logical, physical (OS), or both bind string listing types. This also does away with exposing a hex bind string format at the user interface. Signed-off-by: Samuel K. Gutierrez Co-authored-by: Guillaume Mercier --- include/quo-vadis.h | 21 ++-- src/fortran/quo-vadisf.f90 | 12 +- src/quo-vadis.cc | 4 +- src/qvi-bbuff-rmi.h | 2 +- src/qvi-hwloc.cc | 222 ++++++++++++++++----------------- src/qvi-hwloc.h | 19 +-- src/qvi-scope.cc | 10 +- src/qvi-scope.h | 2 +- tests/common-test-utils.h | 18 +-- tests/internal/test-hwloc.c | 2 +- tests/internal/test-rmi.cc | 2 +- tests/test-mpi-fortapi.f90 | 10 +- tests/test-mpi-phases.c | 12 +- tests/test-mpi-scope-create.c | 8 +- tests/test-mpi-threads.c | 6 +- tests/test-omp.c | 2 +- tests/test-process-fortapi.f90 | 10 +- tests/test-progress-thread.c | 8 +- 18 files changed, 176 insertions(+), 194 deletions(-) diff --git a/include/quo-vadis.h b/include/quo-vadis.h index e1acd24..c588df4 100644 --- a/include/quo-vadis.h +++ b/include/quo-vadis.h @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2020-2024 Triad National Security, LLC + * Copyright (c) 2020-2025 Triad National Security, LLC * All rights reserved. * * Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC @@ -100,12 +100,19 @@ typedef enum { } qv_hw_obj_type_t; /** - * Binding string representation formats. + * Binding string representation format flags. */ -typedef enum { - QV_BIND_STRING_AS_BITMAP = 0, - QV_BIND_STRING_AS_LIST -} qv_bind_string_format_t; +typedef int qv_bind_string_flags_t; + +/** + * Output the logical binding. + */ +const qv_bind_string_flags_t QV_BIND_STRING_LOGICAL = 0x00000001; + +/** + * Output the physical (OS) binding. + */ +const qv_bind_string_flags_t QV_BIND_STRING_PHYSICAL = 0x00000002; /** * Automatic grouping options for qv_scope_split(). The following values can be @@ -277,7 +284,7 @@ qv_scope_bind_pop( int qv_scope_bind_string( qv_scope_t *scope, - qv_bind_string_format_t format, + qv_bind_string_flags_t flags, char **str ); diff --git a/src/fortran/quo-vadisf.f90 b/src/fortran/quo-vadisf.f90 index 3df0849..509d615 100644 --- a/src/fortran/quo-vadisf.f90 +++ b/src/fortran/quo-vadisf.f90 @@ -1,5 +1,5 @@ ! -! Copyright (c) 2013-2024 Triad National Security, LLC +! Copyright (c) 2013-2025 Triad National Security, LLC ! All rights reserved. ! ! This file is part of the quo-vadis project. See the LICENSE file at the @@ -96,13 +96,13 @@ module quo_vadisf parameter (QV_HW_OBJ_LAST = 11) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Binding string representaiton formats. + ! Binding string representation format flags. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - integer(c_int) QV_BIND_STRING_AS_BITMAP - integer(c_int) QV_BIND_STRING_AS_LIST + integer(c_int), parameter :: QV_BIND_STRING_LOGICAL = & + int(Z'00000001', kind=c_int) - parameter (QV_BIND_STRING_AS_BITMAP = 0) - parameter (QV_BIND_STRING_AS_LIST = 1) + integer(c_int), parameter :: QV_BIND_STRING_PHYSICAL = & + int(Z'00000002', kind=c_int) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Automatic grouping options for qv_scope_split(). diff --git a/src/quo-vadis.cc b/src/quo-vadis.cc index a10433a..7af15be 100644 --- a/src/quo-vadis.cc +++ b/src/quo-vadis.cc @@ -62,14 +62,14 @@ qv_scope_bind_pop( int qv_scope_bind_string( qv_scope_t *scope, - qv_bind_string_format_t format, + qv_bind_string_flags_t flags, char **str ) { if (qvi_unlikely(!scope || !str)) { return QV_ERR_INVLD_ARG; } try { - return scope->bind_string(format, str); + return scope->bind_string(flags, str); } qvi_catch_and_return(); } diff --git a/src/qvi-bbuff-rmi.h b/src/qvi-bbuff-rmi.h index 673b93b..3b6c723 100644 --- a/src/qvi-bbuff-rmi.h +++ b/src/qvi-bbuff-rmi.h @@ -459,7 +459,7 @@ qvi_bbuff_rmi_pack_item_impl( } // Non-null data. char *datas = nullptr; - int rc = qvi_hwloc_bitmap_asprintf(NULL, data, &datas); + int rc = qvi_hwloc_bitmap_asprintf(data, &datas); if (qvi_unlikely(rc != QV_SUCCESS)) return rc; // We are sending the string representation of the cpuset. rc = buff->append(datas, strlen(datas) + 1); diff --git a/src/qvi-hwloc.cc b/src/qvi-hwloc.cc index 66209fe..3b98eea 100644 --- a/src/qvi-hwloc.cc +++ b/src/qvi-hwloc.cc @@ -1,6 +1,6 @@ /* -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2020-2024 Triad National Security, LLC + * Copyright (c) 2020-2025 Triad National Security, LLC * All rights reserved. * * Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC @@ -178,22 +178,109 @@ qvi_hwloc_obj_type_is_host_resource( } } +static int +get_logical_bind_string( + qvi_hwloc_t *hwloc, + hwloc_const_bitmap_t bitmap, + std::string &result +) { + result.clear(); + + const int num_pus = hwloc_get_nbobjs_inside_cpuset_by_type( + hwloc->topo, bitmap, HWLOC_OBJ_PU + ); + + hwloc_obj_t obj_pu = nullptr; + qvi_hwloc_bitmap logical_bitmap; + for (int idx = 0; idx < num_pus; idx++) { + obj_pu = hwloc_get_next_obj_inside_cpuset_by_type( + hwloc->topo, bitmap, HWLOC_OBJ_PU, obj_pu + ); + (void)hwloc_bitmap_set(logical_bitmap.data(), obj_pu->logical_index); + } + + char *logicals = nullptr; + const int rc = qvi_hwloc_bitmap_list_asprintf( + logical_bitmap.cdata(), &logicals + ); + if (qvi_unlikely(rc != QV_SUCCESS)) { + return rc; + } + + result.append("L"); + result.append(logicals); + free(logicals); + + return QV_SUCCESS; +} + +static int +get_physical_bind_string( + qvi_hwloc_t *, + hwloc_const_bitmap_t bitmap, + std::string &result +) { + result.clear(); + + char *physicals = nullptr; + const int rc = qvi_hwloc_bitmap_list_asprintf(bitmap, &physicals); + if (qvi_unlikely(rc != QV_SUCCESS)) { + return rc; + } + + result.append("P"); + result.append(physicals); + free(physicals); + + return QV_SUCCESS; +} + int -qvi_hwloc_bitmap_string( - hwloc_topology_t topo, +qvi_hwloc_bind_string( + qvi_hwloc_t *hwloc, hwloc_const_bitmap_t bitmap, - qv_bind_string_format_t format, + qv_bind_string_flags_t flags, char **result ) { - switch (format) { - case QV_BIND_STRING_AS_BITMAP: - return qvi_hwloc_bitmap_asprintf(topo, bitmap, result); - case QV_BIND_STRING_AS_LIST: - return qvi_hwloc_bitmap_list_asprintf(topo, bitmap, result); - default: - *result = nullptr; - return QV_ERR_INVLD_ARG; + *result = nullptr; + + int rc = QV_SUCCESS; + const std::string sep = " ; "; + std::string lresult; + std::string presult; + std::string iresult; + + if (flags & QV_BIND_STRING_LOGICAL) { + rc = get_logical_bind_string( + hwloc, bitmap, lresult + ); + if (qvi_unlikely(rc != QV_SUCCESS)) return rc; + + iresult.append(lresult); + } + if (flags & QV_BIND_STRING_PHYSICAL) { + rc = get_physical_bind_string( + hwloc, bitmap, presult + ); + if (qvi_unlikely(rc != QV_SUCCESS)) return rc; + + if (!iresult.empty()) { + iresult.append(sep); + } + iresult.append(presult); + } + // Sanity check. This means that no valid flag paths were taken. This + // likely means that an invalid flag was provided to the function. + if (qvi_unlikely(iresult.empty())) { + return QV_ERR_INVLD_ARG; + } + // + const int np = asprintf(result, "%s", iresult.c_str()); + if (qvi_unlikely(np == -1)) { + *result = nullptr; + return QV_ERR_OOR; } + return QV_SUCCESS; } int @@ -285,7 +372,7 @@ get_pci_busid( static constexpr int PCI_BUS_ID_BUFF_SIZE = 32; char busid_buffer[PCI_BUS_ID_BUFF_SIZE] = {'\0'}; - const int nw = snprintf( + const int np = snprintf( busid_buffer, PCI_BUS_ID_BUFF_SIZE, "%04x:%02x:%02x.%01x", pcidev->attr->pcidev.domain, @@ -293,7 +380,7 @@ get_pci_busid( pcidev->attr->pcidev.dev, pcidev->attr->pcidev.func ); - if (qvi_unlikely(nw >= PCI_BUS_ID_BUFF_SIZE)) { + if (qvi_unlikely(np >= PCI_BUS_ID_BUFF_SIZE)) { qvi_abort(); } busid = std::string(busid_buffer); @@ -681,7 +768,7 @@ topo_fname( ) { const int pid = getpid(); srand(time(nullptr)); - const int nw = asprintf( + const int np = asprintf( name, "%s/%s-%s-%d-%d.xml", base, @@ -690,7 +777,7 @@ topo_fname( pid, rand() % 256 ); - if (nw == -1) { + if (qvi_unlikely(np == -1)) { *name = nullptr; return QV_ERR_OOR; } @@ -807,32 +894,8 @@ qvi_hwloc_get_nobjs_by_type( return rc; } -int -qvi_hwloc_emit_cpubind( - qvi_hwloc_t *hwl, - pid_t task_id -) { - hwloc_cpuset_t cpuset = nullptr; - int rc = qvi_hwloc_task_get_cpubind(hwl, task_id, &cpuset); - if (rc != QV_SUCCESS) return rc; - - char *cpusets = nullptr; - rc = qvi_hwloc_bitmap_asprintf(hwl->topo, cpuset, &cpusets); - if (rc != QV_SUCCESS) goto out; - - qvi_log_info( - "[pid={} tid={}] cpubind (physical) = {}", - getpid(), task_id, cpusets - ); -out: - qvi_hwloc_bitmap_delete(&cpuset); - if (cpusets) free(cpusets); - return rc; -} - int qvi_hwloc_bitmap_asprintf( - hwloc_topology_t topo, hwloc_const_cpuset_t cpuset, char **result ) { @@ -842,44 +905,12 @@ qvi_hwloc_bitmap_asprintf( qvi_log_error("hwloc_bitmap_asprintf() failed"); return QV_ERR_OOR; } - - if (topo) { - hwloc_bitmap_t cpuset_logical = hwloc_bitmap_alloc(); - hwloc_obj_t obj_pu = nullptr; - - int num_pus = hwloc_get_nbobjs_inside_cpuset_by_type(topo, cpuset, HWLOC_OBJ_PU); - for(int idx = 0; idx < num_pus ; idx++){ - obj_pu = hwloc_get_next_obj_inside_cpuset_by_type(topo, cpuset, HWLOC_OBJ_PU, obj_pu); - (void)hwloc_bitmap_set(cpuset_logical,obj_pu->logical_index); - } - - char *iresult_logical = nullptr; - (void)hwloc_bitmap_list_asprintf(&iresult_logical, cpuset_logical); - if (qvi_unlikely(!iresult_logical)) { - qvi_log_error("hwloc_bitmap_list_asprintf() failed"); - return QV_ERR_OOR; - } - (void)hwloc_bitmap_free(cpuset_logical); - - char head[] = " | (logical) = "; - char *final_result = (char*)calloc(strlen(iresult)+ - strlen(head)+ - strlen(iresult_logical)+1,sizeof(char)); - memcpy(final_result,iresult,strlen(iresult)); - strcat(final_result,head); - strcat(final_result,iresult_logical); - free(iresult_logical); - free(iresult); - iresult = final_result; - } - *result = iresult; return QV_SUCCESS; } int qvi_hwloc_bitmap_list_asprintf( - hwloc_topology_t topo, hwloc_const_cpuset_t cpuset, char **result ) { @@ -889,37 +920,6 @@ qvi_hwloc_bitmap_list_asprintf( qvi_log_error("hwloc_bitmap_list_asprintf() failed"); return QV_ERR_OOR; } - - if (topo) { - hwloc_bitmap_t cpuset_logical = hwloc_bitmap_alloc(); - hwloc_obj_t obj_pu = nullptr; - - int num_pus = hwloc_get_nbobjs_inside_cpuset_by_type(topo, cpuset, HWLOC_OBJ_PU); - for(int idx = 0; idx < num_pus ; idx++){ - obj_pu = hwloc_get_next_obj_inside_cpuset_by_type(topo, cpuset, HWLOC_OBJ_PU, obj_pu); - (void)hwloc_bitmap_set(cpuset_logical,obj_pu->logical_index); - } - - char *iresult_logical = nullptr; - (void)hwloc_bitmap_list_asprintf(&iresult_logical, cpuset_logical); - if (qvi_unlikely(!iresult_logical)) { - qvi_log_error("hwloc_bitmap_list_asprintf() failed"); - return QV_ERR_OOR; - } - (void)hwloc_bitmap_free(cpuset_logical); - - char head[] = " | (logical) = "; - char *final_result = (char*)calloc(strlen(iresult)+ - strlen(head)+ - strlen(iresult_logical)+1,sizeof(char)); - memcpy(final_result,iresult,strlen(iresult)); - strcat(final_result,head); - strcat(final_result,iresult_logical); - free(iresult_logical); - free(iresult); - iresult = final_result; - } - *result = iresult; return QV_SUCCESS; } @@ -934,7 +934,7 @@ qvi_hwloc_cpuset_debug( #endif assert(cpuset); char *cpusets = nullptr; - int rc = qvi_hwloc_bitmap_asprintf(nullptr, cpuset, &cpusets); + int rc = qvi_hwloc_bitmap_asprintf(cpuset, &cpusets); if (rc != QV_SUCCESS) { qvi_abort(); } @@ -1022,7 +1022,7 @@ qvi_hwloc_task_get_cpubind_as_string( int rc = qvi_hwloc_task_get_cpubind(hwl, task_id, &cpuset); if (rc != QV_SUCCESS) return rc; - rc = qvi_hwloc_bitmap_asprintf(hwl->topo, cpuset, cpusets); + rc = qvi_hwloc_bitmap_asprintf(cpuset, cpusets); qvi_hwloc_bitmap_delete(&cpuset); return rc; } @@ -1250,7 +1250,7 @@ qvi_hwloc_devices_emit( } for (auto &dev : *devlist) { char *cpusets = nullptr; - int rc = qvi_hwloc_bitmap_asprintf(hwl->topo, dev->affinity.cdata(), &cpusets); + int rc = qvi_hwloc_bitmap_asprintf(dev->affinity.cdata(), &cpusets); if (rc != QV_SUCCESS) return rc; qvi_log_info(" Device Name: {}", dev->name); @@ -1328,7 +1328,7 @@ qvi_hwloc_get_device_id_in_cpuset( qv_device_id_type_t dev_id_type, char **dev_id ) { - int rc = QV_SUCCESS, nw = 0; + int rc = QV_SUCCESS, np = 0; qvi_hwloc_dev_list_t devs; rc = get_devices_in_cpuset(hwl, dev_obj, cpuset, devs); @@ -1338,19 +1338,19 @@ qvi_hwloc_get_device_id_in_cpuset( switch (dev_id_type) { case (QV_DEVICE_ID_UUID): - nw = asprintf(dev_id, "%s", devs.at(i)->uuid.c_str()); + np = asprintf(dev_id, "%s", devs.at(i)->uuid.c_str()); break; case (QV_DEVICE_ID_PCI_BUS_ID): - nw = asprintf(dev_id, "%s", devs.at(i)->pci_bus_id.c_str()); + np = asprintf(dev_id, "%s", devs.at(i)->pci_bus_id.c_str()); break; case (QV_DEVICE_ID_ORDINAL): - nw = asprintf(dev_id, "%d", devs.at(i)->id); + np = asprintf(dev_id, "%d", devs.at(i)->id); break; default: rc = QV_ERR_INVLD_ARG; goto out; } - if (nw == -1) rc = QV_ERR_OOR; + if (np == -1) rc = QV_ERR_OOR; out: if (rc != QV_SUCCESS) { *dev_id = nullptr; diff --git a/src/qvi-hwloc.h b/src/qvi-hwloc.h index 971a38f..811d1b5 100644 --- a/src/qvi-hwloc.h +++ b/src/qvi-hwloc.h @@ -1,6 +1,6 @@ /* -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2020-2024 Triad National Security, LLC + * Copyright (c) 2020-2025 Triad National Security, LLC * All rights reserved. * * Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC @@ -173,21 +173,11 @@ qvi_hwloc_get_nobjs_by_type( int *out_nobjs ); -/** - * - */ -int -qvi_hwloc_emit_cpubind( - qvi_hwloc_t *hwl, - pid_t task_id -); - /** * Caller is responsible for freeing returned resources. */ int qvi_hwloc_bitmap_asprintf( - hwloc_topology_t topo, hwloc_const_cpuset_t cpuset, char **result ); @@ -197,7 +187,6 @@ qvi_hwloc_bitmap_asprintf( */ int qvi_hwloc_bitmap_list_asprintf( - hwloc_topology_t topo, hwloc_const_cpuset_t cpuset, char **result ); @@ -538,10 +527,10 @@ qvi_hwloc_get_devices_in_bitmap( ); int -qvi_hwloc_bitmap_string( - hwloc_topology_t topo, +qvi_hwloc_bind_string( + qvi_hwloc_t *hwloc, hwloc_const_bitmap_t bitmap, - qv_bind_string_format_t format, + qv_bind_string_flags_t flags, char **result ); diff --git a/src/qvi-scope.cc b/src/qvi-scope.cc index 736beaa..72889be 100644 --- a/src/qvi-scope.cc +++ b/src/qvi-scope.cc @@ -206,16 +206,18 @@ qv_scope::bind_pop(void) int qv_scope::bind_string( - qv_bind_string_format_t format, + qv_bind_string_flags_t flags, char **result ) { + *result = nullptr; + hwloc_cpuset_t bitmap = nullptr; int rc = m_group->task()->bind_top(&bitmap); if (qvi_unlikely(rc != QV_SUCCESS)) return rc; - hwloc_topology_t topo = qvi_hwloc_get_topo_obj(m_group->hwloc()); - - rc = qvi_hwloc_bitmap_string(topo, bitmap, format, result); + rc = qvi_hwloc_bind_string( + m_group->hwloc(), bitmap, flags, result + ); qvi_hwloc_bitmap_delete(&bitmap); return rc; } diff --git a/src/qvi-scope.h b/src/qvi-scope.h index 1d62d52..5ecb216 100644 --- a/src/qvi-scope.h +++ b/src/qvi-scope.h @@ -106,7 +106,7 @@ struct qv_scope { int bind_string( - qv_bind_string_format_t format, + qv_bind_string_flags_t flags, char **result ); diff --git a/tests/common-test-utils.h b/tests/common-test-utils.h index deedf90..ebcdc49 100644 --- a/tests/common-test-utils.h +++ b/tests/common-test-utils.h @@ -57,12 +57,12 @@ ctu_emit_task_bind( char const *ers = NULL; // Get new, current binding. char *binds = NULL; - int rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &binds); + int rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - printf("[%d] cpubind (physical) = %s\n", pid, binds); + printf("[%d] cpubind=%s\n", pid, binds); free(binds); } @@ -121,7 +121,7 @@ ctu_bind_push( } // Get current binding. char *bind0s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind0s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind0s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -137,7 +137,7 @@ ctu_bind_push( // Get new, current binding. char *bind1s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind1s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind1s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -167,7 +167,7 @@ ctu_bind_pop( } // Get current binding. char *bind0s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind0s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind0s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -182,7 +182,7 @@ ctu_bind_pop( } // Get new, current binding. char *bind1s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind1s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind1s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -213,7 +213,7 @@ ctu_change_bind( } // Get current binding. char *bind0s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind0s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind0s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -229,7 +229,7 @@ ctu_change_bind( // Get new, current binding. char *bind1s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind1s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind1s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -243,7 +243,7 @@ ctu_change_bind( } char *bind2s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind2s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind2s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); diff --git a/tests/internal/test-hwloc.c b/tests/internal/test-hwloc.c index 9c73745..ef00244 100644 --- a/tests/internal/test-hwloc.c +++ b/tests/internal/test-hwloc.c @@ -208,7 +208,7 @@ main(void) ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - rc = qvi_hwloc_bitmap_asprintf(NULL, bitmap, &binds); + rc = qvi_hwloc_bitmap_asprintf(bitmap, &binds); if (rc != QV_SUCCESS) { ers = "qvi_hwloc_bitmap_asprintf() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); diff --git a/tests/internal/test-rmi.cc b/tests/internal/test-rmi.cc index 893bdb0..4e6a160 100644 --- a/tests/internal/test-rmi.cc +++ b/tests/internal/test-rmi.cc @@ -112,7 +112,7 @@ client( } char *res; - qvi_hwloc_bitmap_asprintf(NULL, bitmap, &res); + qvi_hwloc_bitmap_asprintf(bitmap, &res); printf("# [%d] cpubind = %s\n", who, res); hwloc_bitmap_free(bitmap); free(res); diff --git a/tests/test-mpi-fortapi.f90 b/tests/test-mpi-fortapi.f90 index fd41ea0..b79f89c 100644 --- a/tests/test-mpi-fortapi.f90 +++ b/tests/test-mpi-fortapi.f90 @@ -1,11 +1,3 @@ -! -! Copyright (c) 2013-2024 Triad National Security, LLC -! All rights reserved. -! -! This file is part of the quo-vadis project. See the LICENSE file at the -! top-level directory of this distribution. -! - ! Does nothing useful. Just used to exercise the Fortran interface. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -101,7 +93,7 @@ program mpi_fortapi error stop end if - call qv_scope_bind_string(sub_scope, QV_BIND_STRING_AS_LIST, bstr, info) + call qv_scope_bind_string(sub_scope, QV_BIND_STRING_LOGICAL, bstr, info) if (info .ne. QV_SUCCESS) then error stop end if diff --git a/tests/test-mpi-phases.c b/tests/test-mpi-phases.c index 7cfe5cf..62dacca 100644 --- a/tests/test-mpi-phases.c +++ b/tests/test-mpi-phases.c @@ -95,7 +95,7 @@ main( printf("\n===Phase 1: Regular split===\n"); char *binds; - rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -143,7 +143,7 @@ main( } /* Where did I end up? */ - rc = qv_scope_bind_string(sub_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(sub_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -186,7 +186,7 @@ main( ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -277,7 +277,7 @@ main( } /* Where did I end up? */ - rc = qv_scope_bind_string(numa_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(numa_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -316,7 +316,7 @@ main( ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -399,7 +399,7 @@ main( } /* Where did I end up? */ - rc = qv_scope_bind_string(gpu_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(gpu_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); diff --git a/tests/test-mpi-scope-create.c b/tests/test-mpi-scope-create.c index b094250..45746cf 100644 --- a/tests/test-mpi-scope-create.c +++ b/tests/test-mpi-scope-create.c @@ -55,7 +55,7 @@ test_create_scope( } /* Where did I end up? */ - rc = qv_scope_bind_string(core_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(core_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -70,7 +70,7 @@ test_create_scope( ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -153,7 +153,7 @@ main( } char *binds; - rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(base_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -207,7 +207,7 @@ main( } /* Where did I end up? */ - rc = qv_scope_bind_string(sub_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(sub_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); diff --git a/tests/test-mpi-threads.c b/tests/test-mpi-threads.c index db5dcdd..9e2f1be 100644 --- a/tests/test-mpi-threads.c +++ b/tests/test-mpi-threads.c @@ -87,7 +87,7 @@ change_bind( } char *bind1s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind1s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind1s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -102,7 +102,7 @@ change_bind( } char *bind2s; - rc = qv_scope_bind_string(scope, QV_BIND_STRING_AS_LIST, &bind2s); + rc = qv_scope_bind_string(scope, QV_BIND_STRING_LOGICAL, &bind2s); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -259,7 +259,7 @@ main(void) printf("[%d][%d] Number of PUS in omp_self_scope is %d\n", wrank, tid, n_pus); char *binds; - rc = qv_bind_string(omp_ctx, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_bind_string(omp_ctx, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); diff --git a/tests/test-omp.c b/tests/test-omp.c index 021f4f3..cd43615 100644 --- a/tests/test-omp.c +++ b/tests/test-omp.c @@ -22,7 +22,7 @@ emit_iter_info( char const *ers = NULL; char *binds; const int rc = qv_scope_bind_string( - sinfo->scope, QV_BIND_STRING_AS_LIST, &binds + sinfo->scope, QV_BIND_STRING_LOGICAL, &binds ); if (rc != QV_SUCCESS) { ers = "qv_bind_string() failed"; diff --git a/tests/test-process-fortapi.f90 b/tests/test-process-fortapi.f90 index 331407e..73357e3 100644 --- a/tests/test-process-fortapi.f90 +++ b/tests/test-process-fortapi.f90 @@ -1,11 +1,3 @@ -! -! Copyright (c) 2013-2024 Triad National Security, LLC -! All rights reserved. -! -! This file is part of the quo-vadis project. See the LICENSE file at the -! top-level directory of this distribution. -! - ! Does nothing useful. Just used to exercise the Fortran interface. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -47,7 +39,7 @@ program process_fortapi end if print *, 'ncores', n_cores - call qv_scope_bind_string(scope_user, QV_BIND_STRING_AS_LIST, bstr, info) + call qv_scope_bind_string(scope_user, QV_BIND_STRING_LOGICAL, bstr, info) if (info .ne. QV_SUCCESS) then error stop end if diff --git a/tests/test-progress-thread.c b/tests/test-progress-thread.c index e0d731a..20d1fa5 100644 --- a/tests/test-progress-thread.c +++ b/tests/test-progress-thread.c @@ -37,7 +37,7 @@ void *thread_work(void *arg) char *binds; char const *ers = NULL; - int rc = qv_bind_string(ctx, QV_BIND_STRING_AS_LIST, &binds); + int rc = qv_bind_string(ctx, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) /* Where did I end up? */ char *binds; - rc = qv_scope_bind_string(task_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(task_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) ers = "qv_bind_push() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - rc = qv_scope_bind_string(wk_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(wk_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); @@ -177,7 +177,7 @@ int main(int argc, char *argv[]) ers = "qv_bind_push() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - rc = qv_scope_bind_string(ut_scope, QV_BIND_STRING_AS_LIST, &binds); + rc = qv_scope_bind_string(ut_scope, QV_BIND_STRING_LOGICAL, &binds); if (rc != QV_SUCCESS) { ers = "qv_bind_get_list_as_string() failed"; ctu_panic("%s (rc=%s)", ers, qv_strerr(rc));