Skip to content

Commit

Permalink
Incorporate minor cleanups. (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov>
  • Loading branch information
samuelkgutierrez committed Mar 11, 2024
1 parent 6fe588b commit d42eb27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
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

0 comments on commit d42eb27

Please sign in to comment.