1 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "xbt/xbt_os_time.h"
12 #include "simix/simix.h"
13 #include "smpi/smpi.h"
14 #include "instr/private.h"
16 struct s_smpi_process_data;
17 typedef struct s_smpi_process_data *smpi_process_data_t;
19 #define PERSISTENT 0x0
20 #define NON_PERSISTENT 0x1
24 typedef struct s_smpi_mpi_request {
40 } s_smpi_mpi_request_t;
42 void smpi_process_init(int *argc, char ***argv);
43 void smpi_process_destroy(void);
45 smpi_process_data_t smpi_process_data(void);
46 smpi_process_data_t smpi_process_remote_data(int index);
47 int smpi_process_count(void);
48 int smpi_process_index(void);
49 xbt_os_timer_t smpi_process_timer(void);
50 void smpi_process_simulated_start(void);
51 double smpi_process_simulated_elapsed(void);
52 void print_request(const char *message, MPI_Request request);
53 void smpi_process_post_send(MPI_Comm comm, MPI_Request request);
54 void smpi_process_post_recv(MPI_Request request);
56 void smpi_global_init(void);
57 void smpi_global_destroy(void);
59 size_t smpi_datatype_size(MPI_Datatype datatype);
60 MPI_Aint smpi_datatype_lb(MPI_Datatype datatype);
61 MPI_Aint smpi_datatype_ub(MPI_Datatype datatype);
62 int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint * lb,
64 int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
65 void *recvbuf, int recvcount,
66 MPI_Datatype recvtype);
68 MPI_Op smpi_op_new(MPI_User_function * function, int commute);
69 void smpi_op_destroy(MPI_Op op);
70 void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
71 MPI_Datatype * datatype);
73 MPI_Group smpi_group_new(int size);
74 void smpi_group_destroy(MPI_Group group);
75 void smpi_group_set_mapping(MPI_Group group, int index, int rank);
76 int smpi_group_index(MPI_Group group, int rank);
77 int smpi_group_rank(MPI_Group group, int index);
78 int smpi_group_use(MPI_Group group);
79 int smpi_group_unuse(MPI_Group group);
80 int smpi_group_size(MPI_Group group);
81 int smpi_group_compare(MPI_Group group1, MPI_Group group2);
83 MPI_Comm smpi_comm_new(MPI_Group group);
84 void smpi_comm_destroy(MPI_Comm comm);
85 MPI_Group smpi_comm_group(MPI_Comm comm);
86 int smpi_comm_size(MPI_Comm comm);
87 int smpi_comm_rank(MPI_Comm comm);
88 MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key);
90 MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype,
91 int dst, int tag, MPI_Comm comm);
92 MPI_Request smpi_mpi_recv_init(void *buf, int count, MPI_Datatype datatype,
93 int src, int tag, MPI_Comm comm);
94 void smpi_mpi_start(MPI_Request request);
95 void smpi_mpi_startall(int count, MPI_Request * requests);
96 void smpi_mpi_request_free(MPI_Request * request);
97 MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype,
98 int dst, int tag, MPI_Comm comm);
99 MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype,
100 int dst, int tag, MPI_Comm comm);
101 MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype,
102 int src, int tag, MPI_Comm comm);
103 MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype,
104 int src, int tag, MPI_Comm comm);
105 void smpi_mpi_recv(void *buf, int count, MPI_Datatype datatype, int src,
106 int tag, MPI_Comm comm, MPI_Status * status);
107 void smpi_mpi_send(void *buf, int count, MPI_Datatype datatype, int dst,
108 int tag, MPI_Comm comm);
109 void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
110 int dst, int sendtag, void *recvbuf, int recvcount,
111 MPI_Datatype recvtype, int src, int recvtag,
112 MPI_Comm comm, MPI_Status * status);
113 int smpi_mpi_test(MPI_Request * request, MPI_Status * status);
114 int smpi_mpi_testany(int count, MPI_Request requests[], int *index,
115 MPI_Status * status);
116 int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype);
117 void smpi_mpi_wait(MPI_Request * request, MPI_Status * status);
118 int smpi_mpi_waitany(int count, MPI_Request requests[],
119 MPI_Status * status);
120 void smpi_mpi_waitall(int count, MPI_Request requests[],
121 MPI_Status status[]);
122 int smpi_mpi_waitsome(int incount, MPI_Request requests[], int *indices,
123 MPI_Status status[]);
124 void smpi_mpi_bcast(void *buf, int count, MPI_Datatype datatype, int root,
126 void smpi_mpi_barrier(MPI_Comm comm);
127 void smpi_mpi_gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
128 void *recvbuf, int recvcount, MPI_Datatype recvtype,
129 int root, MPI_Comm comm);
130 void smpi_mpi_gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
131 void *recvbuf, int *recvcounts, int *displs,
132 MPI_Datatype recvtype, int root, MPI_Comm comm);
133 void smpi_mpi_allgather(void *sendbuf, int sendcount,
134 MPI_Datatype sendtype, void *recvbuf,
135 int recvcount, MPI_Datatype recvtype,
137 void smpi_mpi_allgatherv(void *sendbuf, int sendcount,
138 MPI_Datatype sendtype, void *recvbuf,
139 int *recvcounts, int *displs,
140 MPI_Datatype recvtype, MPI_Comm comm);
141 void smpi_mpi_scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
142 void *recvbuf, int recvcount, MPI_Datatype recvtype,
143 int root, MPI_Comm comm);
144 void smpi_mpi_scatterv(void *sendbuf, int *sendcounts, int *displs,
145 MPI_Datatype sendtype, void *recvbuf, int recvcount,
146 MPI_Datatype recvtype, int root, MPI_Comm comm);
147 void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count,
148 MPI_Datatype datatype, MPI_Op op, int root,
150 void smpi_mpi_allreduce(void *sendbuf, void *recvbuf, int count,
151 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
152 void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count,
153 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
155 void nary_tree_bcast(void *buf, int count, MPI_Datatype datatype, int root,
156 MPI_Comm comm, int arity);
157 void nary_tree_barrier(MPI_Comm comm, int arity);
159 int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount,
160 MPI_Datatype sendtype, void *recvbuf,
161 int recvcount, MPI_Datatype recvtype,
163 int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount,
164 MPI_Datatype sendtype,
165 void *recvbuf, int recvcount,
166 MPI_Datatype recvtype,
168 int smpi_coll_tuned_alltoall_pairwise(void *sendbuf, int sendcount,
169 MPI_Datatype sendtype, void *recvbuf,
170 int recvcount, MPI_Datatype recvtype,
172 int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
173 int *senddisps, MPI_Datatype sendtype,
174 void *recvbuf, int *recvcounts,
175 int *recvdisps, MPI_Datatype recvtype,
179 void smpi_bench_destroy(void);
180 void smpi_bench_begin(int rank, const char *mpi_call);
181 void smpi_bench_end(int rank, const char *mpi_call);