Skip to content

Commit

Permalink
Cleanup some naming and other minor edits. (#266)
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 Jul 31, 2024
1 parent f102e75 commit 7f34263
Show file tree
Hide file tree
Showing 41 changed files with 418 additions and 434 deletions.
4 changes: 2 additions & 2 deletions include/quo-vadis.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ extern "C" {
#define QUO_VADIS_API_VERSION 0x00000001

/** Opaque quo-vadis scope. */
struct qv_scope_s;
typedef struct qv_scope_s qv_scope_t;
struct qv_scope;
typedef struct qv_scope qv_scope_t;

/**
* Return codes.
Expand Down
4 changes: 2 additions & 2 deletions src/quo-vadis-mpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ qvi_mpi_scope_get(
const int rc = qvi_new(&izgroup, comm);
if (qvi_unlikely(rc != QV_SUCCESS)) return rc;

return qv_scope_s::make_intrinsic(izgroup, iscope, scope);
return qv_scope::make_intrinsic(izgroup, iscope, scope);
}

int
Expand All @@ -87,7 +87,7 @@ qvi_mpi_scope_comm_dup(
qv_scope_t *scope,
MPI_Comm *comm
) {
return dynamic_cast<qvi_group_mpi_t *>(scope->group())->comm_dup(comm);
return dynamic_cast<qvi_group_mpi *>(scope->group())->comm_dup(comm);
}

int
Expand Down
4 changes: 2 additions & 2 deletions src/quo-vadis-omp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ qvi_omp_scope_get(
qv_scope_t **scope
) {
// Create the base process group.
qvi_group_omp_s *zgroup = nullptr;
qvi_group_omp *zgroup = nullptr;
const int rc = qvi_new(&zgroup);
if (qvi_unlikely(rc != QV_SUCCESS)) {
*scope = nullptr;
return rc;
}
return qv_scope_s::make_intrinsic(zgroup, iscope, scope);
return qv_scope::make_intrinsic(zgroup, iscope, scope);
}

int
Expand Down
4 changes: 2 additions & 2 deletions src/quo-vadis-process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ qvi_process_scope_get(
qv_scope_t **scope
) {
// Create the base process group.
qvi_group_process_s *zgroup = nullptr;
qvi_group_process *zgroup = nullptr;
const int rc = qvi_new(&zgroup);
if (qvi_unlikely(rc != QV_SUCCESS)) {
*scope = nullptr;
return rc;
}
return qv_scope_s::make_intrinsic(zgroup, iscope, scope);
return qv_scope::make_intrinsic(zgroup, iscope, scope);
}

int
Expand Down
4 changes: 2 additions & 2 deletions src/quo-vadis-pthread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ qv_pthread_create(
// pthread_create(), return a reasonable errno.
if (qvi_unlikely(rc != QV_SUCCESS)) return ENOMEM;

auto group = dynamic_cast<qvi_group_pthread_t *>(scope->group());
auto group = dynamic_cast<qvi_group_pthread *>(scope->group());
qvi_pthread_group_pthread_create_args_s *cargs = nullptr;
rc = qvi_new(&cargs, group->thgroup, qvi_pthread_routine, arg_ptr);
if (qvi_unlikely(rc != QV_SUCCESS)) {
Expand All @@ -129,7 +129,7 @@ qv_pthread_scopes_free(
return QV_ERR_INVLD_ARG;
}
try {
qv_scope_s::thdestroy(&scopes, nscopes);
qv_scope::thdestroy(&scopes, nscopes);
return QV_SUCCESS;
}
qvi_catch_and_return();
Expand Down
2 changes: 1 addition & 1 deletion src/quo-vadis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ qv_scope_free(
return QV_ERR_INVLD_ARG;
}
try {
qv_scope_s::destroy(&scope);
qv_scope::destroy(&scope);
return QV_SUCCESS;
}
qvi_catch_and_return();
Expand Down
82 changes: 41 additions & 41 deletions src/qvi-bbuff-rmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* c = hwloc_cpuset_t
* c = qvi_hwloc_bitmap_s
* d = qv_scope_create_hints_t
* h = qvi_hwpool_s *
* h = qvi_hwpool *
* i = int
* s = char *
* s = std::string
Expand Down Expand Up @@ -122,7 +122,7 @@ template<>
inline void
qvi_bbuff_rmi_pack_type_picture(
std::string &picture,
const qvi_hwpool_s *
const qvi_hwpool *
) {
picture += "h";
}
Expand All @@ -131,7 +131,7 @@ template<>
inline void
qvi_bbuff_rmi_pack_type_picture(
std::string &picture,
qvi_hwpool_s *
qvi_hwpool *
) {
picture += "h";
}
Expand All @@ -140,7 +140,7 @@ template<>
inline void
qvi_bbuff_rmi_pack_type_picture(
std::string &picture,
qvi_hwpool_s **
qvi_hwpool **
) {
picture += "h";
}
Expand Down Expand Up @@ -286,7 +286,7 @@ qvi_bbuff_rmi_get_picture
template<typename T>
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *,
qvi_bbuff *,
T
);

Expand All @@ -295,7 +295,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
size_t data
) {
return buff->append(&data, sizeof(data));
Expand All @@ -306,7 +306,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
int data
) {
return buff->append(&data, sizeof(data));
Expand All @@ -317,7 +317,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
qv_scope_create_hints_t data
) {
const int dai = (int)data;
Expand All @@ -329,7 +329,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
qv_hw_obj_type_t data
) {
const int dai = (int)data;
Expand All @@ -341,7 +341,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
qv_device_id_type_t data
) {
const int dai = (int)data;
Expand All @@ -353,7 +353,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
qv_scope_intrinsic_t data
) {
const int dai = (int)data;
Expand All @@ -366,7 +366,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
pid_t data
) {
const int dai = (int)data;
Expand All @@ -376,7 +376,7 @@ qvi_bbuff_rmi_pack_item(

inline int
qvi_bbuff_rmi_pack_item_impl(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
cstr_t data
) {
return buff->append(data, strlen(data) + 1);
Expand All @@ -387,7 +387,7 @@ qvi_bbuff_rmi_pack_item_impl(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
const std::string &data
) {
return qvi_bbuff_rmi_pack_item_impl(buff, data.c_str());
Expand All @@ -398,7 +398,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
cstr_t data
) {
return qvi_bbuff_rmi_pack_item_impl(buff, data);
Expand All @@ -409,7 +409,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
char *data
) {
return qvi_bbuff_rmi_pack_item_impl(buff, data);
Expand All @@ -420,7 +420,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *,
qvi_bbuff *,
qvi_bbuff_rmi_zero_msg_t
) {
return QV_SUCCESS;
Expand All @@ -431,7 +431,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
qvi_bbuff_rmi_bytes_in_t data
) {
// We store size then data so unpack has an easier time, but keep
Expand All @@ -447,7 +447,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item_impl(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
hwloc_const_cpuset_t data
) {
// Protect against null data.
Expand All @@ -472,7 +472,7 @@ qvi_bbuff_rmi_pack_item_impl(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
hwloc_cpuset_t data
) {
return qvi_bbuff_rmi_pack_item_impl(buff, data);
Expand All @@ -483,7 +483,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
const qvi_hwloc_bitmap_s &bitmap
) {
return qvi_bbuff_rmi_pack_item_impl(buff, bitmap.cdata());
Expand All @@ -494,7 +494,7 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
hwloc_const_cpuset_t data
) {
return qvi_bbuff_rmi_pack_item_impl(buff, data);
Expand All @@ -505,8 +505,8 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
const qvi_hwpool_cpu_s &data
qvi_bbuff *buff,
const qvi_hwpool_cpu &data
) {
return data.packinto(buff);
}
Expand All @@ -516,37 +516,37 @@ qvi_bbuff_rmi_pack_item(
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_hwpool_dev_s *data
qvi_bbuff *buff,
qvi_hwpool_dev *data
) {
return data->packinto(buff);
}

/**
* Packs qvi_hwpool_s *
* Packs qvi_hwpool *
*/
inline int
qvi_bbuff_rmi_pack_item_impl(
qvi_bbuff_t *buff,
const qvi_hwpool_s *data
qvi_bbuff *buff,
const qvi_hwpool *data
) {
return data->packinto(buff);
}

/**
* Packs qvi_hwpool_s *
* Packs qvi_hwpool *
*/
inline int
qvi_bbuff_rmi_pack_item(
qvi_bbuff_t *buff,
qvi_hwpool_s *data
qvi_bbuff *buff,
qvi_hwpool *data
) {
return qvi_bbuff_rmi_pack_item_impl(buff, data);
}

inline int
qvi_bbuff_rmi_pack(
qvi_bbuff_t *
qvi_bbuff *
) {
// Base case
return QV_SUCCESS;
Expand All @@ -555,7 +555,7 @@ qvi_bbuff_rmi_pack(
template<typename T, typename... Types>
inline int
qvi_bbuff_rmi_pack(
qvi_bbuff_t *buff,
qvi_bbuff *buff,
T&& arg,
Types &&...args
) {
Expand Down Expand Up @@ -817,35 +817,35 @@ qvi_bbuff_rmi_unpack_item(
*/
inline int
qvi_bbuff_rmi_unpack_item(
qvi_hwpool_cpu_s &cpu,
qvi_hwpool_cpu &cpu,
byte_t *buffpos,
size_t *bytes_written
) {
return qvi_hwpool_cpu_s::unpack(buffpos, bytes_written, cpu);
return qvi_hwpool_cpu::unpack(buffpos, bytes_written, cpu);
}

/**
* Unpacks qvi_hwpool_dev_s &
*/
inline int
qvi_bbuff_rmi_unpack_item(
qvi_hwpool_dev_s &dev,
qvi_hwpool_dev &dev,
byte_t *buffpos,
size_t *bytes_written
) {
return qvi_hwpool_dev_s::unpack(buffpos, bytes_written, dev);
return qvi_hwpool_dev::unpack(buffpos, bytes_written, dev);
}

/**
* Unpacks qvi_hwpool_s **
* Unpacks qvi_hwpool **
*/
inline int
qvi_bbuff_rmi_unpack_item(
qvi_hwpool_s **hwp,
qvi_hwpool **hwp,
byte_t *buffpos,
size_t *bytes_written
) {
return qvi_hwpool_s::unpack(buffpos, bytes_written, hwp);
return qvi_hwpool::unpack(buffpos, bytes_written, hwp);
}

/**
Expand Down
Loading

0 comments on commit 7f34263

Please sign in to comment.