A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add finalizing state for smpi actor:
[simgrid.git]
/
src
/
smpi
/
colls
/
barrier
/
barrier-mvapich2-pair.cpp
diff --git
a/src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
b/src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
index edf35d0a7e09ac7a5274c578d47032f7fbfb3ef0..8def355ebea5f1a829836d1d70ce56baf0c76239 100644
(file)
--- a/
src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
+++ b/
src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2013-20
17
. The SimGrid Team.
+/* Copyright (c) 2013-20
22
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-19,7
+19,7
@@
*
* Additional copyrights may follow
*/
*
* Additional copyrights may follow
*/
-
+
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
@@
-39,16
+39,18
@@
*
*/
*
*/
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
+#include "smpi_actor.hpp"
namespace simgrid{
namespace smpi{
namespace simgrid{
namespace smpi{
-int
Coll_barrier_mvapich2_pair::barrie
r(MPI_Comm comm)
+int
barrier__mvapich2_pai
r(MPI_Comm comm)
{
int size, rank;
int d, dst, src;
int mpi_errno = MPI_SUCCESS;
{
int size, rank;
int d, dst, src;
int mpi_errno = MPI_SUCCESS;
+ int tag = smpi_process()->finalizing() ? COLL_TAG_BARRIER-1: COLL_TAG_BARRIER;
size = comm->size();
/* Trivial barriers return immediately */
size = comm->size();
/* Trivial barriers return immediately */
@@
-60,7
+62,7
@@
int Coll_barrier_mvapich2_pair::barrier(MPI_Comm comm)
/* N2_prev = greatest power of two < size of Comm */
for( N2_prev = 1; N2_prev <= size; N2_prev <<= 1 );
N2_prev >>= 1;
/* N2_prev = greatest power of two < size of Comm */
for( N2_prev = 1; N2_prev <= size; N2_prev <<= 1 );
N2_prev >>= 1;
-
+
int surfeit = size - N2_prev;
/* Perform a combine-like operation */
int surfeit = size - N2_prev;
/* Perform a combine-like operation */
@@
-68,30
+70,26
@@
int Coll_barrier_mvapich2_pair::barrier(MPI_Comm comm)
if (rank < surfeit) {
/* get the fanin letter from the upper "half" process: */
dst = N2_prev + rank;
if (rank < surfeit) {
/* get the fanin letter from the upper "half" process: */
dst = N2_prev + rank;
- Request::recv(NULL, 0, MPI_BYTE, dst, COLL_TAG_BARRIER,
- comm, MPI_STATUS_IGNORE);
+ Request::recv(nullptr, 0, MPI_BYTE, dst, tag, comm, MPI_STATUS_IGNORE);
}
/* combine on embedded N2_prev power-of-two processes */
for (d = 1; d < N2_prev; d <<= 1) {
dst = (rank ^ d);
}
/* combine on embedded N2_prev power-of-two processes */
for (d = 1; d < N2_prev; d <<= 1) {
dst = (rank ^ d);
- Request::sendrecv(NULL, 0, MPI_BYTE, dst, COLL_TAG_BARRIER, NULL,
- 0, MPI_BYTE, dst, COLL_TAG_BARRIER, comm,
- MPI_STATUS_IGNORE);
+ Request::sendrecv(nullptr, 0, MPI_BYTE, dst, tag, nullptr, 0, MPI_BYTE, dst, tag,
+ comm, MPI_STATUS_IGNORE);
}
/* fanout data to nodes above N2_prev... */
if (rank < surfeit) {
dst = N2_prev + rank;
}
/* fanout data to nodes above N2_prev... */
if (rank < surfeit) {
dst = N2_prev + rank;
- Request::send(NULL, 0, MPI_BYTE, dst, COLL_TAG_BARRIER,
- comm);
+ Request::send(nullptr, 0, MPI_BYTE, dst, tag, comm);
}
} else {
/* fanin data to power of 2 subset */
src = rank - N2_prev;
}
} else {
/* fanin data to power of 2 subset */
src = rank - N2_prev;
- Request::sendrecv(NULL, 0, MPI_BYTE, src, COLL_TAG_BARRIER,
- NULL, 0, MPI_BYTE, src, COLL_TAG_BARRIER,
- comm, MPI_STATUS_IGNORE);
+ Request::sendrecv(nullptr, 0, MPI_BYTE, src, tag, nullptr, 0, MPI_BYTE, src, tag,
+ comm, MPI_STATUS_IGNORE);
}
return mpi_errno;
}
return mpi_errno;