Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI over SIMIX_network in a two days rush.
[simgrid.git] / src / smpi / private.h
1 #ifndef SMPI_PRIVATE_H
2 #define SMPI_PRIVATE_H
3
4 #include "xbt/mallocator.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 } s_smpi_mpi_request_t;
22
23 smpi_process_data_t smpi_process_data(void);
24 smpi_process_data_t smpi_process_remote_data(int index);
25 void smpi_global_init(void);
26 void smpi_global_destroy(void);
27
28 void smpi_process_init(int* argc, char*** argv);
29 void smpi_process_destroy(void);
30 int smpi_process_count(void);
31 int smpi_process_index(void);
32 xbt_os_timer_t smpi_process_timer(void);
33 void smpi_process_post_send(MPI_Comm comm, MPI_Request request);
34 void smpi_process_post_recv(MPI_Request request);
35
36 size_t smpi_datatype_size(MPI_Datatype datatype);
37 MPI_Aint smpi_datatype_lb(MPI_Datatype datatype);
38 MPI_Aint smpi_datatype_ub(MPI_Datatype datatype);
39 int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint* lb, MPI_Aint * extent);
40 int smpi_datatype_copy(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype);
41
42 MPI_Op smpi_op_new(MPI_User_function* function, int commute);
43 void smpi_op_destroy(MPI_Op op);
44 void smpi_op_apply(MPI_Op op, void* invec, void* inoutvec, int* len, MPI_Datatype* datatype);
45
46 MPI_Group smpi_group_new(int size);
47 void smpi_group_destroy(MPI_Group group);
48 void smpi_group_set_mapping(MPI_Group group, int index, int rank);
49 int smpi_group_index(MPI_Group group, int rank);
50 int smpi_group_rank(MPI_Group group, int index);
51 int smpi_group_use(MPI_Group group);
52 int smpi_group_unuse(MPI_Group group);
53 int smpi_group_size(MPI_Group group);
54 int smpi_group_compare(MPI_Group group1, MPI_Group group2);
55
56 MPI_Comm smpi_comm_new(MPI_Group group);
57 void smpi_comm_destroy(MPI_Comm comm);
58 MPI_Group smpi_comm_group(MPI_Comm comm);
59 int smpi_comm_size(MPI_Comm comm);
60 int smpi_comm_rank(MPI_Comm comm);
61
62 MPI_Request smpi_mpi_isend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
63 MPI_Request smpi_mpi_irecv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
64 void smpi_mpi_recv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status* status);
65 void smpi_mpi_send(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
66 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);
67 int smpi_mpi_test(MPI_Request* request, MPI_Status* status);
68 int smpi_mpi_testany(int count, MPI_Request requests[], int* index, MPI_Status* status);
69 void smpi_mpi_wait(MPI_Request* request, MPI_Status* status);
70 int smpi_mpi_waitany(int count, MPI_Request requests[], MPI_Status* status);
71 void smpi_mpi_waitall(int count, MPI_Request requests[],  MPI_Status status[]);
72 int smpi_mpi_waitsome(int incount, MPI_Request requests[], int* indices, MPI_Status status[]);
73 void smpi_mpi_bcast(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
74 void smpi_mpi_barrier(MPI_Comm comm);
75 void smpi_mpi_gather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
76 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);
77 void smpi_mpi_allgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
78 void smpi_mpi_allgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm);
79 void smpi_mpi_scatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
80 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);
81 void smpi_mpi_reduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
82 void smpi_mpi_allreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
83
84 void nary_tree_bcast(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, int arity);
85 void nary_tree_barrier(MPI_Comm comm, int arity);
86
87 int smpi_coll_tuned_alltoall_bruck(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
88 int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
89 int smpi_coll_tuned_alltoall_pairwise(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
90 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);
91
92 // utilities
93 void smpi_bench_init(void);
94 void smpi_bench_destroy(void);
95 void smpi_execute(double duration);
96 void smpi_bench_begin(void);
97 void smpi_bench_end(void);
98
99 #endif