X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bd9bee9dcbceb25fdb5a293b91abbd5476db7ad2..3c072dea92bbf0e4df46b1d8d56cd62e68883b33:/src/smpi/private.h diff --git a/src/smpi/private.h b/src/smpi/private.h index 115b23f17a..3ee7f8bcf7 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -27,6 +27,10 @@ typedef struct smpi_mpi_communicator_t { // smpi mpi datatype typedef struct smpi_mpi_datatype_t { size_t size; + ptrdiff_t lb; + ptrdiff_t ub; + uint16_t flags; /* flags: has it been committed, etc ...*/ + uint16_t id; /* unused so far : data id, normally the index in the data array. */ } s_smpi_mpi_datatype_t; // smpi mpi request @@ -41,7 +45,7 @@ typedef struct smpi_mpi_request_t { smpi_mpi_datatype_t datatype; short int completed:1; - short int consumed:1; /* for waitany */ + short int consumed:1; /* for waitany */ smx_mutex_t mutex; smx_cond_t cond; @@ -91,7 +95,6 @@ typedef struct smpi_global_t { smx_process_t *main_processes; xbt_os_timer_t timer; - smx_mutex_t timer_mutex; smx_cond_t timer_cond; // keeps track of previous times @@ -112,7 +115,7 @@ typedef struct smpi_host_data_t { smx_process_t sender; smx_process_t receiver; - int finalize; /* so that main process stops its sender&receiver */ + int finalize; /* so that main process stops its sender&receiver */ xbt_fifo_t pending_recv_request_queue; xbt_fifo_t pending_send_request_queue; @@ -121,17 +124,26 @@ typedef struct smpi_host_data_t { typedef struct smpi_host_data_t *smpi_process_data_t; // function prototypes -void smpi_process_init(int *argc,char ***argv); +void smpi_process_init(int *argc, char ***argv); void smpi_process_finalize(void); int smpi_mpi_comm_rank(smpi_mpi_communicator_t comm); +int smpi_mpi_type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent); +int smpi_mpi_bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm); int smpi_mpi_barrier(smpi_mpi_communicator_t comm); + int smpi_mpi_isend(smpi_mpi_request_t request); int smpi_mpi_irecv(smpi_mpi_request_t request); +int smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); +int smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, + void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); int smpi_mpi_wait(smpi_mpi_request_t request, smpi_mpi_status_t * status); -int smpi_mpi_wait_all(int count, smpi_mpi_request_t *requests, smpi_mpi_status_t **status); -int smpi_mpi_wait_any(int count, smpi_mpi_request_t *requests, int *index, smpi_mpi_status_t *status); +int smpi_mpi_waitall(int count, smpi_mpi_request_t requests[], smpi_mpi_status_t status[]); +int smpi_mpi_waitany(int count, smpi_mpi_request_t requests[], int *index, smpi_mpi_status_t status[]); + +// utilities void smpi_execute(double duration); void smpi_start_timer(void); double smpi_stop_timer(void); @@ -150,7 +162,7 @@ int smpi_create_request(void *buf, int count, smpi_mpi_datatype_t datatype, smpi_mpi_communicator_t comm, smpi_mpi_request_t * request); -int smpi_sender(int argc,char*argv[]); -int smpi_receiver(int argc, char*argv[]); +int smpi_sender(int argc, char *argv[]); +int smpi_receiver(int argc, char *argv[]); #endif