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 new entry in Release_Notes.
[simgrid.git]
/
src
/
smpi
/
colls
/
alltoall
/
alltoall-bruck.cpp
diff --git
a/src/smpi/colls/alltoall/alltoall-bruck.cpp
b/src/smpi/colls/alltoall/alltoall-bruck.cpp
index fe000c335791df5ca863e3f8b0f0d577c3f98d7e..21248d09f0b34764ff9d69c924aaece9a6506edb 100644
(file)
--- a/
src/smpi/colls/alltoall/alltoall-bruck.cpp
+++ b/
src/smpi/colls/alltoall/alltoall-bruck.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2013-20
17
. The SimGrid Team.
+/* Copyright (c) 2013-20
23
. 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
@@
-21,32
+21,27
@@
* Descrp: Function realizes the alltoall operation using the bruck algorithm.
* Descrp: Function realizes the alltoall operation using the bruck algorithm.
- * Auth
e
r: MPICH / modified by Ahmad Faraj
+ * Auth
o
r: MPICH / modified by Ahmad Faraj
****************************************************************************/
****************************************************************************/
-#include "../colls_private.h"
-
-namespace simgrid{
-namespace smpi{
+#include "../colls_private.hpp"
+namespace simgrid::smpi {
int
int
-
Coll_alltoall_bruck::alltoall(
void *send_buff, int send_count,
-
MPI_Datatype send_type, void *recv_buff,
-
int recv_count, MPI_Datatype recv_type,
-
MPI_Comm comm)
+
alltoall__bruck(const
void *send_buff, int send_count,
+ MPI_Datatype send_type, void *recv_buff,
+ int recv_count, MPI_Datatype recv_type,
+ MPI_Comm comm)
{
MPI_Status status;
MPI_Aint extent;
MPI_Datatype new_type;
{
MPI_Status status;
MPI_Aint extent;
MPI_Datatype new_type;
- int *blocks_length, *disps;
int i, src, dst, rank, num_procs, count, block, position;
int pack_size, tag = COLL_TAG_ALLTOALL, pof2 = 1;
int i, src, dst, rank, num_procs, count, block, position;
int pack_size, tag = COLL_TAG_ALLTOALL, pof2 = 1;
-
- char *tmp_buff;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
@@
-55,9
+50,9
@@
Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
extent = recv_type->get_extent();
extent = recv_type->get_extent();
-
tmp_buff = (char *)
smpi_get_tmp_sendbuffer(num_procs * recv_count * extent);
-
disps = (int *) xbt_malloc(sizeof(int) * num_procs)
;
-
blocks_length = (int *) xbt_malloc(sizeof(int) * num_procs)
;
+
unsigned char* tmp_buff =
smpi_get_tmp_sendbuffer(num_procs * recv_count * extent);
+
int* disps = new int[num_procs]
;
+
int* blocks_length = new int[num_procs]
;
Request::sendrecv(send_ptr + rank * send_count * extent,
(num_procs - rank) * send_count, send_type, rank, tag,
Request::sendrecv(send_ptr + rank * send_count * extent,
(num_procs - rank) * send_count, send_type, rank, tag,
@@
-98,8
+93,8
@@
Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
pof2 *= 2;
}
pof2 *= 2;
}
-
free(disps)
;
-
free(blocks_length)
;
+
delete[] disps
;
+
delete[] blocks_length
;
Request::sendrecv(recv_ptr + (rank + 1) * recv_count * extent,
(num_procs - rank - 1) * recv_count, send_type,
Request::sendrecv(recv_ptr + (rank + 1) * recv_count * extent,
(num_procs - rank - 1) * recv_count, send_type,
@@
-121,5
+116,4
@@
Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
-}
-}
+} // namespace simgrid::smpi