X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7f04fa5306f52960db709bb520c49e9f4ecec000..954676b700e711f38ec4d286d33d5427d3f4ca46:/src/smpi/colls/bcast-scatter-LR-allgather.c diff --git a/src/smpi/colls/bcast-scatter-LR-allgather.c b/src/smpi/colls/bcast-scatter-LR-allgather.c index 759f979853..87d84cae19 100644 --- a/src/smpi/colls/bcast-scatter-LR-allgather.c +++ b/src/smpi/colls/bcast-scatter-LR-allgather.c @@ -1,4 +1,10 @@ -#include "colls.h" +/* Copyright (c) 2013-2014. 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" /***************************************************************************** @@ -71,11 +77,11 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, int i, src, dst, rank, num_procs; int mask, relative_rank, curr_size, recv_size, send_size, nbytes; int scatter_size, left, right, next_src, *recv_counts, *disps; - int tag = 1; + int tag = COLL_TAG_BCAST; - MPI_Comm_rank(comm, &rank); - MPI_Comm_size(comm, &num_procs); - MPI_Type_extent(data_type, &extent); + rank = smpi_comm_rank(comm); + num_procs = smpi_comm_size(comm); + extent = smpi_datatype_get_extent(data_type); nbytes = extent * count; @@ -97,9 +103,9 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, curr_size = 0; // this process doesn't receive any data // because of uneven division else { - MPI_Recv((char *) buff + relative_rank * scatter_size, recv_size, + smpi_mpi_recv((char *) buff + relative_rank * scatter_size, recv_size, MPI_BYTE, src, tag, comm, &status); - MPI_Get_count(&status, MPI_BYTE, &curr_size); + curr_size = smpi_mpi_get_count(&status, MPI_BYTE); } break; } @@ -121,7 +127,7 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, dst = rank + mask; if (dst >= num_procs) dst -= num_procs; - MPI_Send((char *) buff + scatter_size * (relative_rank + mask), + smpi_mpi_send((char *) buff + scatter_size * (relative_rank + mask), send_size, MPI_BYTE, dst, tag, comm); curr_size -= send_size; @@ -153,7 +159,7 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count, next_src = left; for (i = 1; i < num_procs; i++) { - MPI_Sendrecv((char *) buff + disps[(src - root + num_procs) % num_procs], + smpi_mpi_sendrecv((char *) buff + disps[(src - root + num_procs) % num_procs], recv_counts[(src - root + num_procs) % num_procs], MPI_BYTE, right, tag, (char *) buff +