-/* Copyright (c) 2013-2019. The SimGrid Team.
+/* Copyright (c) 2013-2023. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "../coll_tuned_topo.hpp"
#include "../colls_private.hpp"
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count,
MPI_Datatype datatype, MPI_Op op,
ptrdiff_t true_extent, real_segment_size;
true_extent=datatype->get_extent();
- /* handle non existant recv buffer (i.e. its NULL) and
+ /* handle non existent recv buffer (i.e. its NULL) and
protect the recv buffer on non-root nodes */
accumbuf = static_cast<unsigned char*>(recvbuf);
if (nullptr == accumbuf || root != rank) {
}
/* If this is a non-commutative operation we must copy
- sendbuf to the accumbuf, in order to simplfy the loops */
+ sendbuf to the accumbuf, in order to simplify the loops */
if ((op != MPI_OP_NULL && not op->is_commutative())) {
Datatype::copy(sendtmpbuf, original_count, datatype, accumbuf, original_count, datatype);
}
*/
else {
- /* If the number of segments is less than a maximum number of oustanding
+ /* If the number of segments is less than a maximum number of outstanding
requests or there is no limit on the maximum number of outstanding
requests, we send data to the parent using blocking send */
if ((0 == max_outstanding_reqs) ||
else {
int creq = 0;
- MPI_Request* sreq = new (std::nothrow) MPI_Request[max_outstanding_reqs];
- if (NULL == sreq) { line = __LINE__; ret = -1; goto error_hndl; }
+ auto* sreq = new (std::nothrow) MPI_Request[max_outstanding_reqs];
+ if (nullptr == sreq) {
+ line = __LINE__;
+ ret = -1;
+ goto error_hndl;
+ }
/* post first group of requests */
for (segindex = 0; segindex < max_outstanding_reqs; segindex++) {
*/
-int Coll_reduce_ompi_chain::reduce(const void *sendbuf, void *recvbuf, int count,
- MPI_Datatype datatype,
- MPI_Op op, int root,
- MPI_Comm comm
- )
+int reduce__ompi_chain(const void *sendbuf, void *recvbuf, int count,
+ MPI_Datatype datatype,
+ MPI_Op op, int root,
+ MPI_Comm comm
+ )
{
uint32_t segsize=64*1024;
int segcount = count;
}
-int Coll_reduce_ompi_pipeline::reduce(const void *sendbuf, void *recvbuf,
- int count, MPI_Datatype datatype,
- MPI_Op op, int root,
- MPI_Comm comm )
+int reduce__ompi_pipeline(const void *sendbuf, void *recvbuf,
+ int count, MPI_Datatype datatype,
+ MPI_Op op, int root,
+ MPI_Comm comm )
{
uint32_t segsize;
segcount, 0);
}
-int Coll_reduce_ompi_binary::reduce(const void *sendbuf, void *recvbuf,
- int count, MPI_Datatype datatype,
- MPI_Op op, int root,
- MPI_Comm comm)
+int reduce__ompi_binary(const void *sendbuf, void *recvbuf,
+ int count, MPI_Datatype datatype,
+ MPI_Op op, int root,
+ MPI_Comm comm)
{
uint32_t segsize;
int segcount = count;
segcount, 0);
}
-int Coll_reduce_ompi_binomial::reduce(const void *sendbuf, void *recvbuf,
- int count, MPI_Datatype datatype,
- MPI_Op op, int root,
- MPI_Comm comm)
+int reduce__ompi_binomial(const void *sendbuf, void *recvbuf,
+ int count, MPI_Datatype datatype,
+ MPI_Op op, int root,
+ MPI_Comm comm)
{
uint32_t segsize=0;
* reduce_intra_in_order_binary
*
* Function: Logarithmic reduce operation for non-commutative operations.
- * Acecpts: same as MPI_Reduce()
+ * Accepts: same as MPI_Reduce()
* Returns: MPI_SUCCESS or error code
*/
-int Coll_reduce_ompi_in_order_binary::reduce(const void *sendbuf, void *recvbuf,
- int count,
- MPI_Datatype datatype,
- MPI_Op op, int root,
- MPI_Comm comm)
+int reduce__ompi_in_order_binary(const void *sendbuf, void *recvbuf,
+ int count,
+ MPI_Datatype datatype,
+ MPI_Op op, int root,
+ MPI_Comm comm)
{
uint32_t segsize=0;
int ret;
if ((root == rank) && (MPI_IN_PLACE == sendbuf)) {
tmp_sendbuf = smpi_get_tmp_sendbuffer(text + (count - 1) * ext);
- if (NULL == tmp_sendbuf) {
+ if (nullptr == tmp_sendbuf) {
return MPI_ERR_INTERN;
}
Datatype::copy(recvbuf, count, datatype, tmp_sendbuf, count, datatype);
use_this_sendbuf = tmp_sendbuf;
} else if (io_root == rank) {
tmp_recvbuf = smpi_get_tmp_recvbuffer(text + (count - 1) * ext);
- if (NULL == tmp_recvbuf) {
+ if (nullptr == tmp_recvbuf) {
return MPI_ERR_INTERN;
}
use_this_recvbuf = tmp_recvbuf;
* Returns: - MPI_SUCCESS or error code
*/
-int
-Coll_reduce_ompi_basic_linear::reduce(const void *sbuf, void *rbuf, int count,
- MPI_Datatype dtype,
- MPI_Op op,
- int root,
- MPI_Comm comm)
+int reduce__ompi_basic_linear(const void *sbuf, void *rbuf, int count,
+ MPI_Datatype dtype,
+ MPI_Op op,
+ int root,
+ MPI_Comm comm)
{
int i, rank, size;
ptrdiff_t true_extent, lb, extent;
/* copied function (with appropriate renaming) ends here */
-
-}
-}
+} // namespace simgrid::smpi