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
Fix most of spelling mistakes in src/
[simgrid.git]
/
src
/
smpi
/
colls
/
reduce
/
reduce-rab.cpp
diff --git
a/src/smpi/colls/reduce/reduce-rab.cpp
b/src/smpi/colls/reduce/reduce-rab.cpp
index
5b2f4b2
..
c1e5cf7
100644
(file)
--- a/
src/smpi/colls/reduce/reduce-rab.cpp
+++ b/
src/smpi/colls/reduce/reduce-rab.cpp
@@
-46,7
+46,7
@@
/* Fast reduce and allreduce algorithm for longer buffers and predefined
operations.
/* Fast reduce and allreduce algorithm for longer buffers and predefined
operations.
- This algorithm is explaned with the example of 13 nodes.
+ This algorithm is expla
i
ned with the example of 13 nodes.
The nodes are numbered 0, 1, 2, ... 12.
The sendbuf content is a, b, c, ... m.
The buffer array is notated with ABCDEFGH, this means that
The nodes are numbered 0, 1, 2, ... 12.
The sendbuf content is a, b, c, ... m.
The buffer array is notated with ABCDEFGH, this means that
@@
-65,7
+65,7
@@
Exa.: size=13 ==> n=3, r=5 (i.e. size == 13 == 2**n+r == 2**3 + 5)
Exa.: size=13 ==> n=3, r=5 (i.e. size == 13 == 2**n+r == 2**3 + 5)
- The algorit
m needs for the execution of one C
olls::reduce
+ The algorit
hm needs for the execution of one c
olls::reduce
- for r==0
exec_time = n*(L1+L2) + buf_lng * (1-1/2**n) * (T1 + T2 + O/d)
- for r==0
exec_time = n*(L1+L2) + buf_lng * (1-1/2**n) * (T1 + T2 + O/d)
@@
-207,7
+207,7
@@
Step 5.n)
7: { [(a+b)+(c+d)] + [(e+f)+(g+h)] } + { [(i+j)+k] + [l+m] } for H
7: { [(a+b)+(c+d)] + [(e+f)+(g+h)] } + { [(i+j)+k] + [l+m] } for H
-For
C
olls::allreduce:
+For
c
olls::allreduce:
------------------
Step 6.1)
------------------
Step 6.1)
@@
-249,7
+249,7
@@
Step 7)
on all nodes 0..12
on all nodes 0..12
-For
C
olls::reduce:
+For
c
olls::reduce:
---------------
Step 6.0)
---------------
Step 6.0)
@@
-376,10
+376,10
@@
Benchmark results on CRAY T3E
2) This line shows the limit for the count argument.
If count < limit then the vendor protocol is used,
otherwise the new protocol is used (see variable Ldb).
2) This line shows the limit for the count argument.
If count < limit then the vendor protocol is used,
otherwise the new protocol is used (see variable Ldb).
- 3) These lines show the bandwidth (=
bu
fer length / execution time)
+ 3) These lines show the bandwidth (=
buf
fer length / execution time)
for both protocols.
for both protocols.
- 4) This line shows that the limit is cho
o
sen well if the ratio is
- between 0.95 (lo
o
sing 5% for buffer length near and >=limit)
+ 4) This line shows that the limit is chosen well if the ratio is
+ between 0.95 (losing 5% for buffer length near and >=limit)
and 1.10 (not gaining 10% for buffer length near and <limit).
5) This line shows that the new protocol is 2..7 times faster
for long counts.
and 1.10 (not gaining 10% for buffer length near and <limit).
5) This line shows that the new protocol is 2..7 times faster
for long counts.
@@
-517,7
+517,8
@@
static void MPI_I_do_op(void* b1, void* b2, void* rslt, int cnt,
REDUCE_LIMITS
namespace simgrid{
namespace smpi{
REDUCE_LIMITS
namespace simgrid{
namespace smpi{
-static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all)
+static int MPI_I_anyReduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op,
+ int root, MPI_Comm comm, bool is_all)
{
char *scr1buf, *scr2buf, *scr3buf, *xxx, *sendbuf, *recvbuf;
int myrank, size, x_base, x_size, computed, idx;
{
char *scr1buf, *scr2buf, *scr3buf, *xxx, *sendbuf, *recvbuf;
int myrank, size, x_base, x_size, computed, idx;
@@
-540,7
+541,7
@@
static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
else if(mpi_datatype==MPI_DOUBLE ) datatype=MPIM_DOUBLE;
else if(mpi_datatype==MPI_BYTE ) datatype=MPIM_BYTE;
else
else if(mpi_datatype==MPI_DOUBLE ) datatype=MPIM_DOUBLE;
else if(mpi_datatype==MPI_BYTE ) datatype=MPIM_BYTE;
else
-
THROWF(arg_error,0, "reduce rab algorithm can't be used with this datatype !
");
+
throw std::invalid_argument("reduce rab algorithm can't be used with this datatype!
");
if (mpi_op==MPI_MAX ) op=MPIM_MAX;
else if(mpi_op==MPI_MIN ) op=MPIM_MIN;
if (mpi_op==MPI_MAX ) op=MPIM_MAX;
else if(mpi_op==MPI_MIN ) op=MPIM_MIN;
@@
-635,7
+636,7
@@
static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
# endif
n = 0; x_size = 1;
while (2*x_size <= size) { n++; x_size = x_size * 2; }
# endif
n = 0; x_size = 1;
while (2*x_size <= size) { n++; x_size = x_size * 2; }
- /* x_si
x
e == 2**n */
+ /* x_si
z
e == 2**n */
r = size - x_size;
/*...step 2 */
r = size - x_size;
/*...step 2 */
@@
-942,21
+943,21
@@
static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
} /* new_prot */
/*otherwise:*/
if (is_all)
} /* new_prot */
/*otherwise:*/
if (is_all)
-
return( Colls::allreduce(Sendbuf, Recvbuf, count, mpi_datatype, mpi_op, comm)
);
+
return (colls::allreduce(Sendbuf, Recvbuf, count, mpi_datatype, mpi_op, comm)
);
else
else
-
return( Colls::reduce(Sendbuf,Recvbuf, count,mpi_datatype,mpi_op, root, comm)
);
+
return (colls::reduce(Sendbuf, Recvbuf, count, mpi_datatype, mpi_op, root, comm)
);
}
#endif /*REDUCE_LIMITS*/
}
#endif /*REDUCE_LIMITS*/
-int
Coll_reduce_rab::reduce(
void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
+int
reduce__rab(const
void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
{
{
- return
( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, root, comm, 0)
);
+ return
MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, root, comm, false
);
}
}
-int
Coll_allreduce_rab::allreduce(
void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int
allreduce__rab(const
void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
{
- return
( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, -1, comm, 1)
);
+ return
MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, -1, comm, true
);
}
}
}
}
}
}