-/* Copyright (c) 2013-2017. The SimGrid Team.
+/* Copyright (c) 2013-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/*
* Simple double ring version of barrier
*
- * synchronous gurantee made by last ring of sends are synchronous
+ * synchronous guarantee made by last ring of sends are synchronous
*
*/
-namespace simgrid{
-namespace smpi{
-int Coll_barrier_ompi_doublering::barrier(MPI_Comm comm)
+namespace simgrid {
+namespace smpi {
+int barrier__ompi_doublering(MPI_Comm comm)
{
int rank, size;
int left, right;
* To make synchronous, uses sync sends and sync sendrecvs
*/
-int Coll_barrier_ompi_recursivedoubling::barrier(MPI_Comm comm)
+int barrier__ompi_recursivedoubling(MPI_Comm comm)
{
int rank, size, adjsize;
int mask, remote;
* To make synchronous, uses sync sends and sync sendrecvs
*/
-int Coll_barrier_ompi_bruck::barrier(MPI_Comm comm)
+int barrier__ompi_bruck(MPI_Comm comm)
{
int rank, size;
int distance, to, from;
* To make synchronous, uses sync sends and sync sendrecvs
*/
/* special case for two processes */
-int Coll_barrier_ompi_two_procs::barrier(MPI_Comm comm)
+int barrier__ompi_two_procs(MPI_Comm comm)
{
int remote;
/* copied function (with appropriate renaming) starts here */
-int Coll_barrier_ompi_basic_linear::barrier(MPI_Comm comm)
+int barrier__ompi_basic_linear(MPI_Comm comm)
{
int i;
int size = comm->size();
else {
MPI_Request* requests;
- requests = (MPI_Request*)malloc( size * sizeof(MPI_Request) );
+ requests = new MPI_Request[size];
for (i = 1; i < size; ++i) {
- requests[i] = Request::irecv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE,
- COLL_TAG_BARRIER, comm
- );
+ requests[i] = Request::irecv(NULL, 0, MPI_BYTE, i, COLL_TAG_BARRIER, comm);
}
Request::waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
);
}
Request::waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
- free( requests );
+ delete[] requests;
}
/* All done */
* Another recursive doubling type algorithm, but in this case
* we go up the tree and back down the tree.
*/
-int Coll_barrier_ompi_tree::barrier(MPI_Comm comm)
+int barrier__ompi_tree(MPI_Comm comm)
{
int rank, size, depth;
int jump, partner;