Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
0ddb0faefea08b89495122070dffec316daeceb4
[simgrid.git] / src / smpi / private.h
1 #ifndef SMPI_PRIVATE_H
2 #define SMPI_PRIVATE_H
3
4 #include "xbt.h"
5 #include "xbt/xbt_os_time.h"
6 #include "simix/simix.h"
7 #include "smpi/smpi.h"
8
9 struct s_smpi_process_data;
10 typedef struct s_smpi_process_data* smpi_process_data_t;
11
12 typedef struct s_smpi_mpi_request {
13   MPI_Comm comm;
14   int src;
15   int dst;
16   int tag;
17   size_t size;
18   smx_rdv_t rdv;
19   smx_comm_t pair;
20   int complete;
21   MPI_Request match;
22 } s_smpi_mpi_request_t;
23
24 void smpi_process_init(int* argc, char*** argv);
25 void smpi_process_destroy(void);
26
27 smpi_process_data_t smpi_process_data(void);
28 smpi_process_data_t smpi_process_remote_data(int index);
29 int smpi_process_count(void);
30 int smpi_process_index(void);
31 xbt_os_timer_t smpi_process_timer(void);
32 void smpi_process_post_send(MPI_Comm comm, MPI_Request request);
33 void smpi_process_post_recv(MPI_Request request);
34
35 void smpi_global_init(void);
36 void smpi_global_destroy(void);
37
38 size_t smpi_datatype_size(MPI_Datatype datatype);
39 MPI_Aint smpi_datatype_lb(MPI_Datatype datatype);
40 MPI_Aint smpi_datatype_ub(MPI_Datatype datatype);
41 int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint* lb, MPI_Aint * extent);
42 int smpi_datatype_copy(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype);
43
44 MPI_Op smpi_op_new(MPI_User_function* function, int commute);
45 void smpi_op_destroy(MPI_Op op);
46 void smpi_op_apply(MPI_Op op, void* invec, void* inoutvec, int* len, MPI_Datatype* datatype);
47
48 MPI_Group smpi_group_new(int size);
49 void smpi_group_destroy(MPI_Group group);
50 void smpi_group_set_mapping(MPI_Group group, int index, int rank);
51 int smpi_group_index(MPI_Group group, int rank);
52 int smpi_group_rank(MPI_Group group, int index);
53 int smpi_group_use(MPI_Group group);
54 int smpi_group_unuse(MPI_Group group);
55 int smpi_group_size(MPI_Group group);
56 int smpi_group_compare(MPI_Group group1, MPI_Group group2);
57
58 MPI_Comm smpi_comm_new(MPI_Group group);
59 void smpi_comm_destroy(MPI_Comm comm);
60 MPI_Group smpi_comm_group(MPI_Comm comm);
61 int smpi_comm_size(MPI_Comm comm);
62 int smpi_comm_rank(MPI_Comm comm);
63
64 MPI_Request smpi_mpi_isend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
65 MPI_Request smpi_mpi_irecv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
66 void smpi_mpi_recv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status* status);
67 void smpi_mpi_send(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
68 void smpi_mpi_sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status* status);
69 int smpi_mpi_test(MPI_Request* request, MPI_Status* status);
70 int smpi_mpi_testany(int count, MPI_Request requests[], int* index, MPI_Status* status);
71 void smpi_mpi_wait(MPI_Request* request, MPI_Status* status);
72 int smpi_mpi_waitany(int count, MPI_Request requests[], MPI_Status* status);
73 void smpi_mpi_waitall(int count, MPI_Request requests[],  MPI_Status status[]);
74 int smpi_mpi_waitsome(int incount, MPI_Request requests[], int* indices, MPI_Status status[]);
75 void smpi_mpi_bcast(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
76 void smpi_mpi_barrier(MPI_Comm comm);
77 void smpi_mpi_gather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
78 void smpi_mpi_gatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm);
79 void smpi_mpi_allgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
80 void smpi_mpi_allgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm);
81 void smpi_mpi_scatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
82 void smpi_mpi_scatterv(void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
83 void smpi_mpi_reduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
84 void smpi_mpi_allreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
85 void smpi_mpi_scan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
86
87 void nary_tree_bcast(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, int arity);
88 void nary_tree_barrier(MPI_Comm comm, int arity);
89
90 int smpi_coll_tuned_alltoall_bruck(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
91 int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
92 int smpi_coll_tuned_alltoall_pairwise(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
93 int smpi_coll_basic_alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm);
94
95 // utilities
96 void smpi_bench_begin(int rank, const char* mpi_call);
97 void smpi_bench_end(int rank, const char* mpi_call);
98
99 #endif