X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/40616078da72e823931c1fb884949054699ec39d..1bf033cc925aa31693ef5163ea056fde5b75ff1e:/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp diff --git a/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp b/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp index c9d2b20023..5b1aaeda38 100644 --- a/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp +++ b/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp @@ -1,10 +1,10 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "../colls_private.h" +#include "../colls_private.hpp" +#include "smpi_status.hpp" /***************************************************************************** @@ -67,8 +67,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Auther: MPIH / modified by Ahmad Faraj ****************************************************************************/ +namespace simgrid{ +namespace smpi{ int -smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, +Coll_bcast_scatter_LR_allgather::bcast(void *buff, int count, MPI_Datatype data_type, int root, MPI_Comm comm) { @@ -85,7 +87,7 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, nbytes = extent * count; - scatter_size = (nbytes + num_procs - 1) / num_procs; // ceiling division + scatter_size = (nbytes + num_procs - 1) / num_procs; // ceiling division curr_size = (rank == root) ? nbytes : 0; // root starts with all the data relative_rank = (rank >= root) ? rank - root : rank - root + num_procs; @@ -101,11 +103,11 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, // allows you to post a larger recv. if (recv_size <= 0) curr_size = 0; // this process doesn't receive any data - // because of uneven division + // because of uneven division else { Request::recv((char *) buff + relative_rank * scatter_size, recv_size, MPI_BYTE, src, tag, comm, &status); - curr_size = smpi_mpi_get_count(&status, MPI_BYTE); + curr_size = Status::get_count(&status, MPI_BYTE); } break; } @@ -121,7 +123,7 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, while (mask > 0) { if (relative_rank + mask < num_procs) { send_size = curr_size - scatter_size * mask; - // mask is also the size of this process's subtree + // mask is also the size of this process's subtree if (send_size > 0) { dst = rank + mask; @@ -176,3 +178,6 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, return MPI_SUCCESS; } + +} +}