From: Frederic Suter Date: Thu, 16 Feb 2017 11:34:57 +0000 (+0100) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_15~344 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1687df79d61a9418bba830bbd0ab7de16e457090?hp=e22b7989466ef66078c8f7b60a7776e15cd8080d Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/src/smpi/colls/bcast-arrival-scatter.c b/src/smpi/colls/bcast-arrival-scatter.c index 7e700eb570..ff7b10bc8e 100644 --- a/src/smpi/colls/bcast-arrival-scatter.c +++ b/src/smpi/colls/bcast-arrival-scatter.c @@ -192,12 +192,9 @@ int smpi_coll_tuned_bcast_arrival_scatter(void *buf, int count, 0, tag, comm, &status); /* at this point all nodes in this set perform all-gather operation */ - to = header_buf[myordering + 1]; - from = header_buf[myordering - 1]; - if (myordering == 0) - from = header_buf[total_nodes - 1]; - if (myordering == (total_nodes - 1)) - to = header_buf[0]; + + to = (myordering == (total_nodes - 1)) ? header_buf[0] : header_buf[myordering + 1]; + from = (myordering == 0) ? header_buf[total_nodes - 1] : header_buf[myordering - 1]; /* last segment may have a larger size since it also include the remainder */ diff --git a/src/smpi/colls/reduce-rab.c b/src/smpi/colls/reduce-rab.c index e293606bbe..61653b7b98 100644 --- a/src/smpi/colls/reduce-rab.c +++ b/src/smpi/colls/reduce-rab.c @@ -410,7 +410,7 @@ Benchmark results on CRAY T3E #endif typedef enum {MPIM_SHORT, MPIM_INT, MPIM_LONG, MPIM_UNSIGNED_SHORT, - MPIM_UNSIGNED, MPIM_UNSIGNED_LONG, MPIM_FLOAT, + MPIM_UNSIGNED, MPIM_UNSIGNED_LONG, MPIM_UNSIGNED_LONG_LONG, MPIM_FLOAT, MPIM_DOUBLE, MPIM_BYTE} MPIM_Datatype; typedef enum {MPIM_MAX, MPIM_MIN, MPIM_SUM, MPIM_PROD, @@ -467,6 +467,7 @@ MPI_I_DO_OP_C_INTEGER( MPI_I_do_op_long, long) MPI_I_DO_OP_C_INTEGER( MPI_I_do_op_ushort, unsigned short) MPI_I_DO_OP_C_INTEGER( MPI_I_do_op_uint, unsigned int) MPI_I_DO_OP_C_INTEGER( MPI_I_do_op_ulong, unsigned long) +MPI_I_DO_OP_C_INTEGER( MPI_I_do_op_ulonglong, unsigned long long) MPI_I_DO_OP_FP( MPI_I_do_op_float, float) MPI_I_DO_OP_FP( MPI_I_do_op_double, double) MPI_I_DO_OP_BYTE( MPI_I_do_op_byte, char) @@ -487,6 +488,8 @@ static void MPI_I_do_op(void* b1, void* b2, void* rslt, int cnt, MPI_I_DO_OP_CALL(MPI_I_do_op_uint, unsigned int) case MPIM_UNSIGNED_LONG: MPI_I_DO_OP_CALL(MPI_I_do_op_ulong, unsigned long) + case MPIM_UNSIGNED_LONG_LONG: + MPI_I_DO_OP_CALL(MPI_I_do_op_ulonglong, unsigned long long) case MPIM_FLOAT : MPI_I_DO_OP_CALL(MPI_I_do_op_float, float) case MPIM_DOUBLE: MPI_I_DO_OP_CALL(MPI_I_do_op_double, double) case MPIM_BYTE : MPI_I_DO_OP_CALL(MPI_I_do_op_byte, char) @@ -513,9 +516,12 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype else if(mpi_datatype==MPI_UNSIGNED_SHORT) datatype=MPIM_UNSIGNED_SHORT; else if(mpi_datatype==MPI_UNSIGNED ) datatype=MPIM_UNSIGNED; else if(mpi_datatype==MPI_UNSIGNED_LONG ) datatype=MPIM_UNSIGNED_LONG; + else if(mpi_datatype==MPI_UNSIGNED_LONG_LONG ) datatype=MPIM_UNSIGNED_LONG_LONG; else if(mpi_datatype==MPI_FLOAT ) datatype=MPIM_FLOAT; 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 ! "); if (mpi_op==MPI_MAX ) op=MPIM_MAX; else if(mpi_op==MPI_MIN ) op=MPIM_MIN; @@ -546,7 +552,7 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype new_prot = count >= Lsh[is_all][ss]; break; case MPIM_INT: case MPIM_UNSIGNED: new_prot = count >= Lin[is_all][ss]; break; - case MPIM_LONG: case MPIM_UNSIGNED_LONG: + case MPIM_LONG: case MPIM_UNSIGNED_LONG: case MPIM_UNSIGNED_LONG_LONG: new_prot = count >= Llg[is_all][ss]; break; default: break; diff --git a/src/smpi/smpi_rma.cpp b/src/smpi/smpi_rma.cpp index 68d8507b8d..6edbee3e47 100644 --- a/src/smpi/smpi_rma.cpp +++ b/src/smpi/smpi_rma.cpp @@ -117,13 +117,16 @@ int smpi_mpi_win_fence( int assert, MPI_Win win){ std::vector *reqs = win->requests; int size = static_cast(reqs->size()); // start all requests that have been prepared by another process - for(auto req: *reqs){ - if (req && (req->flags & PREPARED)) - smpi_mpi_start(req); - } + if(size>0){ + for(auto req: *reqs){ + if (req && (req->flags & PREPARED)) + smpi_mpi_start(req); + } + + MPI_Request* treqs = &(*reqs)[0]; - MPI_Request* treqs = &(*reqs)[0]; - smpi_mpi_waitall(size,treqs,MPI_STATUSES_IGNORE); + smpi_mpi_waitall(size,treqs,MPI_STATUSES_IGNORE); + } win->count=0; } win->assert = assert; diff --git a/teshsuite/smpi/coll-reduce/coll-reduce.c b/teshsuite/smpi/coll-reduce/coll-reduce.c index 9543c53bee..b7da72ae68 100644 --- a/teshsuite/smpi/coll-reduce/coll-reduce.c +++ b/teshsuite/smpi/coll-reduce/coll-reduce.c @@ -19,16 +19,16 @@ int main(int argc, char *argv[]) { int rank, size; int i; - long int *sb; - long int *rb; + unsigned long long *sb; + unsigned long long *rb; int status; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); - sb = (long int *) xbt_malloc(size * sizeof(long int)); - rb = (long int *) xbt_malloc(size * sizeof(long int)); + sb = (unsigned long long *) xbt_malloc(size * sizeof(unsigned long long)); + rb = (unsigned long long *) xbt_malloc(size * sizeof(unsigned long long)); for (i = 0; i < size; ++i) { sb[i] = rank*size + i; @@ -36,17 +36,17 @@ int main(int argc, char *argv[]) } printf("[%d] sndbuf=[", rank); for (i = 0; i < size; i++) - printf("%ld ", sb[i]); + printf("%llu ", sb[i]); printf("]\n"); int root=0; - status = MPI_Reduce(sb, rb, size, MPI_LONG, MPI_SUM, root, MPI_COMM_WORLD); + status = MPI_Reduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, root, MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD); if (rank == root) { printf("[%d] rcvbuf=[", rank); for (i = 0; i < size; i++) - printf("%ld ", rb[i]); + printf("%llu ", rb[i]); printf("]\n"); if (status != MPI_SUCCESS) { printf("all_to_all returned %d\n", status); @@ -56,17 +56,17 @@ int main(int argc, char *argv[]) printf("[%d] second sndbuf=[", rank); for (i = 0; i < 1; i++) - printf("%ld ", sb[i]); + printf("%llu ", sb[i]); printf("]\n"); root=size-1; - status = MPI_Reduce(sb, rb, 1, MPI_LONG, MPI_PROD, root, MPI_COMM_WORLD); + status = MPI_Reduce(sb, rb, 1, MPI_UNSIGNED_LONG_LONG, MPI_PROD, root, MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD); if (rank == root) { printf("[%d] rcvbuf=[", rank); for (i = 0; i < 1; i++) - printf("%ld ", rb[i]); + printf("%llu ", rb[i]); printf("]\n"); if (status != MPI_SUCCESS) { printf("all_to_all returned %d\n", status);