1 /*High level handling of collective algorithms*/
2 /* Copyright (c) 2009-2010, 2012-2014. The SimGrid Team.
3 * All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
21 static void set_collectives();
22 static void set_gather(const char* name);
23 static void set_allgather(const char* name);
24 static void set_allgatherv(const char* name);
25 static void set_alltoall(const char* name);
26 static void set_alltoallv(const char* name);
27 static void set_allreduce(const char* name);
28 static void set_reduce(const char* name);
29 static void set_reduce_scatter(const char* name);
30 static void set_scatter(const char* name);
31 static void set_barrier(const char* name);
32 static void set_bcast(const char* name);
34 static void coll_help(const char *category, s_mpi_coll_description_t * table);
36 static int (*gather)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, int root, MPI_Comm);
37 static int (*allgather)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
38 static int (*allgatherv)(void *, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
39 static int (*allreduce)(void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
40 static int (*alltoall)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
41 static int (*alltoallv)(void *, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
42 static int (*bcast)(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm com);
43 static int (*reduce)(void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
44 static int (*reduce_scatter)(void *sbuf, void *rbuf, int *rcounts,MPI_Datatype dtype,MPI_Op op,MPI_Comm comm);
45 static int (*scatter)(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm);
46 static int (*barrier)(MPI_Comm comm);
48 //These fairly unused collectives only have one implementation in SMPI
50 static int gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm);
51 static int scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
52 static int scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
53 static int exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
63 class Coll_gather : public Coll_algo {
66 static int gather (void *, int, MPI_Datatype, void*, int, MPI_Datatype, int root, MPI_Comm);
69 class Coll_allgather : public Coll_algo {
72 static int allgather (void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
75 class Coll_allgatherv : public Coll_algo {
78 static int allgatherv (void *, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
81 class Coll_allreduce : public Coll_algo {
84 static int allreduce (void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
87 class Coll_alltoall : public Coll_algo {
90 static int alltoall (void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
93 class Coll_alltoallv : public Coll_algo {
96 static int alltoallv (void *, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
99 class Coll_bcast : public Coll_algo {
102 static int bcast (void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm com);
105 class Coll_reduce : public Coll_algo {
108 static int reduce (void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
111 class Coll_reduce_scatter : public Coll_algo {
114 static int reduce_scatter (void *sbuf, void *rbuf, int *rcounts,MPI_Datatype dtype,MPI_Op op,MPI_Comm comm);
117 class Coll_scatter : public Coll_algo {
120 static int scatter (void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm);
123 class Coll_barrier : public Coll_algo {
126 static int barrier (MPI_Comm);