Skip to content

Commit

Permalink
Rework qvi_scope_split_agg_s. (#255)
Browse files Browse the repository at this point in the history
Rework qvi_scope_split_agg_s in preparation for hardware mapping
improvements.

Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov>
  • Loading branch information
samuelkgutierrez authored Jul 26, 2024
1 parent b6c35ec commit a81cab7
Show file tree
Hide file tree
Showing 9 changed files with 480 additions and 547 deletions.
4 changes: 2 additions & 2 deletions src/qvi-bbuff-rmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,11 @@ qvi_bbuff_rmi_unpack_item(
}

/**
* Unpacks qvi_hwpool_dev_s *
* Unpacks qvi_hwpool_dev_s &
*/
inline int
qvi_bbuff_rmi_unpack_item(
qvi_hwpool_dev_s *dev,
qvi_hwpool_dev_s &dev,
byte_t *buffpos,
size_t *bytes_written
) {
Expand Down
4 changes: 2 additions & 2 deletions src/qvi-group-mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ struct qvi_group_mpi_s : public qvi_group_s {
}

virtual int
rank(void)
rank(void) const
{
return qvi_mpi_group_rank(m_mpi_group);
}

virtual int
size(void)
size(void) const
{
return qvi_mpi_group_size(m_mpi_group);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qvi-group-omp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ struct qvi_group_omp_s : public qvi_group_s {
}

virtual int
rank(void)
rank(void) const
{
return qvi_omp_group_id(m_ompgroup);
}

virtual int
size(void)
size(void) const
{
return qvi_omp_group_size(m_ompgroup);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qvi-group-process.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ struct qvi_group_process_s : public qvi_group_s {
}

virtual int
rank(void)
rank(void) const
{
return qvi_process_group_id(m_proc_group);
}

virtual int
size(void)
size(void) const
{
return qvi_process_group_size(m_proc_group);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qvi-group-pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ struct qvi_group_pthread_s : public qvi_group_s {
}

virtual int
rank(void)
rank(void) const
{
return thgroup->rank();
}

virtual int
size(void)
size(void) const
{
return thgroup->size();
}
Expand Down
4 changes: 2 additions & 2 deletions src/qvi-group.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ struct qvi_group_s : qvi_refc_s {
hwloc(void);
/** Returns the number of members in this group. */
virtual int
size(void) = 0;
size(void) const = 0;
/** Returns the caller's group rank. */
virtual int
rank(void) = 0;
rank(void) const = 0;
/** Performs node-local group barrier. */
virtual int
barrier(void) = 0;
Expand Down
18 changes: 8 additions & 10 deletions src/qvi-hwpool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,47 +260,47 @@ int
qvi_hwpool_dev_s::unpack(
byte_t *buffpos,
size_t *bytes_written,
qvi_hwpool_dev_s *dev
qvi_hwpool_dev_s &dev
) {
size_t bw = 0, total_bw = 0;

int rc = qvi_bbuff_rmi_unpack_item(
&dev->m_hints, buffpos, &bw
&dev.m_hints, buffpos, &bw
);
if (qvi_unlikely(rc != QV_SUCCESS)) goto out;
total_bw += bw;
buffpos += bw;

rc = qvi_bbuff_rmi_unpack_item(
dev->m_affinity, buffpos, &bw
dev.m_affinity, buffpos, &bw
);
if (qvi_unlikely(rc != QV_SUCCESS)) goto out;
total_bw += bw;
buffpos += bw;

rc = qvi_bbuff_rmi_unpack_item(
&dev->m_type, buffpos, &bw
&dev.m_type, buffpos, &bw
);
if (qvi_unlikely(rc != QV_SUCCESS)) goto out;
total_bw += bw;
buffpos += bw;

rc = qvi_bbuff_rmi_unpack_item(
&dev->m_id, buffpos, &bw
&dev.m_id, buffpos, &bw
);
if (qvi_unlikely(rc != QV_SUCCESS)) goto out;
total_bw += bw;
buffpos += bw;

rc = qvi_bbuff_rmi_unpack_item(
dev->m_pci_bus_id, buffpos, &bw
dev.m_pci_bus_id, buffpos, &bw
);
if (qvi_unlikely(rc != QV_SUCCESS)) goto out;
total_bw += bw;
buffpos += bw;

rc = qvi_bbuff_rmi_unpack_item(
dev->m_uuid, buffpos, &bw
dev.m_uuid, buffpos, &bw
);
if (qvi_unlikely(rc != QV_SUCCESS)) goto out;
total_bw += bw;
Expand Down Expand Up @@ -453,9 +453,7 @@ qvi_hwpool_s::unpack(
// Unpack and add the devices.
for (size_t i = 0; i < ndev; ++i) {
qvi_hwpool_dev_s dev;
rc = qvi_bbuff_rmi_unpack_item(
&dev, buffpos, &bw
);
rc = qvi_bbuff_rmi_unpack_item(dev, buffpos, &bw);
if (qvi_unlikely(rc != QV_SUCCESS)) break;
total_bw += bw;
buffpos += bw;
Expand Down
2 changes: 1 addition & 1 deletion src/qvi-hwpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct qvi_hwpool_dev_s : qvi_hwpool_res_s {
unpack(
byte_t *buffpos,
size_t *bytes_written,
qvi_hwpool_dev_s *dev
qvi_hwpool_dev_s &dev
);
};

Expand Down
Loading

0 comments on commit a81cab7

Please sign in to comment.