X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2703e1ee2a79e9fc7c86ebb122caa515ecf24d14..b3b356352e87ae00a20f737c48e19b0c8413455a:/src/smpi/colls/allgather-ring.c diff --git a/src/smpi/colls/allgather-ring.c b/src/smpi/colls/allgather-ring.c index 9e143ded7b..0e96a53ebb 100644 --- a/src/smpi/colls/allgather-ring.c +++ b/src/smpi/colls/allgather-ring.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" /***************************************************************************** @@ -66,25 +72,25 @@ smpi_coll_tuned_allgather_ring(void *send_buff, int send_count, MPI_Aint extent; int i, src, dst, rank, num_procs; - int tag = 1; + int tag = COLL_TAG_ALLGATHER; MPI_Status status; char *sendptr = (char *) send_buff; char *recvptr = (char *) recv_buff; - MPI_Comm_rank(comm, &rank); - MPI_Comm_size(comm, &num_procs); - MPI_Type_extent(send_type, &extent); + rank = smpi_comm_rank(comm); + num_procs = smpi_comm_size(comm); + extent = smpi_datatype_get_extent(send_type); // local send/recv - MPI_Sendrecv(sendptr, send_count, send_type, rank, tag, + smpi_mpi_sendrecv(sendptr, send_count, send_type, rank, tag, recvptr + rank * recv_count * extent, recv_count, recv_type, rank, tag, comm, &status); for (i = 1; i < num_procs; i++) { src = (rank - i + num_procs) % num_procs; dst = (rank + i) % num_procs; - MPI_Sendrecv(sendptr, send_count, send_type, dst, tag, + smpi_mpi_sendrecv(sendptr, send_count, send_type, dst, tag, recvptr + src * recv_count * extent, recv_count, recv_type, src, tag, comm, &status); }