Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate minor cleanups. #81

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/quo-vadis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ qv_bind_string(
return QV_ERR_INVLD_ARG;
}

*str = nullptr;

hwloc_cpuset_t cpuset = nullptr;
int rc = qvi_rmi_task_get_cpubind(
ctx->rmi,
Expand Down
21 changes: 10 additions & 11 deletions src/qvi-scope.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2020-2023 Triad National Security, LLC
* Copyright (c) 2020-2024 Triad National Security, LLC
* All rights reserved.
*
* Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC
Expand Down Expand Up @@ -410,9 +410,7 @@ qvi_global_split_get_cpuset(
hwloc_cpuset_t *result
) {
// This shouldn't happen.
if (gsplit.hwpools.size() == 0) {
abort();
}
assert(gsplit.hwpools.size() != 0);

int rc = qvi_hwloc_bitmap_calloc(result);
if (rc != QV_SUCCESS) return rc;
Expand Down Expand Up @@ -460,7 +458,8 @@ scope_init(
qvi_group_t *group,
qvi_hwpool_t *hwpool
) {
if (!rmi || !hwpool || !scope) abort();
assert(rmi && hwpool && scope);

scope->rmi = rmi;
scope->group = group;
scope->hwpool = hwpool;
Expand All @@ -471,15 +470,15 @@ hwloc_const_cpuset_t
qvi_scope_cpuset_get(
qv_scope_t *scope
) {
if (!scope) abort();
assert(scope);
return qvi_hwpool_cpuset_get(scope->hwpool);
}

const qvi_hwpool_t *
qvi_scope_hwpool_get(
qv_scope_t *scope
) {
if (!scope) abort();
assert(scope);
return scope->hwpool;
}

Expand All @@ -488,7 +487,7 @@ qvi_scope_taskid(
qv_scope_t *scope,
int *taskid
) {
if (!scope) abort();
assert(scope);
*taskid = scope->group->id();
return QV_SUCCESS;
}
Expand All @@ -498,7 +497,7 @@ qvi_scope_ntasks(
qv_scope_t *scope,
int *ntasks
) {
if (!scope) abort();
assert(scope);
*ntasks = scope->group->size();
return QV_SUCCESS;
}
Expand All @@ -507,7 +506,7 @@ int
qvi_scope_barrier(
qv_scope_t *scope
) {
if (!scope) abort();
assert(scope);
return scope->group->barrier();
}

Expand Down Expand Up @@ -551,7 +550,7 @@ qvi_group_t *
qvi_scope_group_get(
qv_scope_t *scope
) {
if (!scope) abort();
assert(scope);
return scope->group;
}

Expand Down
Loading