X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/80b6c5866da8d8769469266da46c7ce979e23b8f..cbc4c75a33fdc7dd6adc43e55eda63fd490abaa0:/src/smpi/smpi_f77.c diff --git a/src/smpi/smpi_f77.c b/src/smpi/smpi_f77.c index 2f84829faf..ffe8916651 100644 --- a/src/smpi/smpi_f77.c +++ b/src/smpi/smpi_f77.c @@ -28,7 +28,7 @@ static int new_comm(MPI_Comm comm) { static MPI_Comm get_comm(int comm) { if(comm == -2) { return MPI_COMM_SELF; - } else if(comm >= 0) { + } else if(comm_lookup && comm >= 0 && comm < (int)xbt_dynar_length(comm_lookup)) { return *(MPI_Comm*)xbt_dynar_get_ptr(comm_lookup, comm); } return MPI_COMM_NULL; @@ -79,7 +79,7 @@ void mpi_init__(int* ierr) { comm_lookup = xbt_dynar_new(sizeof(MPI_Comm), NULL); new_comm(MPI_COMM_WORLD); - request_lookup = xbt_dict_new(); + request_lookup = xbt_dict_new_homogeneous(NULL); datatype_lookup = xbt_dynar_new(sizeof(MPI_Datatype), NULL); new_datatype(MPI_BYTE); @@ -101,6 +101,9 @@ void mpi_init__(int* ierr) { new_datatype(MPI_UINT16_T); new_datatype(MPI_UINT32_T); new_datatype(MPI_UINT64_T); + new_datatype(MPI_2FLOAT); + new_datatype(MPI_2DOUBLE); + op_lookup = xbt_dynar_new(sizeof(MPI_Op), NULL); new_op(MPI_MAX); @@ -123,9 +126,13 @@ void mpi_init__(int* ierr) { void mpi_finalize__(int* ierr) { *ierr = MPI_Finalize(); xbt_dynar_free(&op_lookup); + op_lookup = NULL; xbt_dynar_free(&datatype_lookup); + datatype_lookup = NULL; xbt_dict_free(&request_lookup); + request_lookup = NULL; xbt_dynar_free(&comm_lookup); + comm_lookup = NULL; } void mpi_abort__(int* comm, int* errorcode, int* ierr) { @@ -144,6 +151,10 @@ double mpi_wtime__(void) { return MPI_Wtime(); } +double mpi_wtick__(void) { + return MPI_Wtick(); +} + void mpi_comm_dup__(int* comm, int* newcomm, int* ierr) { MPI_Comm tmp; @@ -307,6 +318,13 @@ void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype, recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm)); } +void mpi_allgatherv__(void* sendbuf, int* sendcount, int* sendtype, + void* recvbuf, int* recvcount,int* displs, int* recvtype, + int* comm, int* ierr) { + *ierr = MPI_Allgatherv(sendbuf, *sendcount, get_datatype(*sendtype), + recvbuf, recvcount, displs, get_datatype(*recvtype), get_comm(*comm)); +} + void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr) { *ierr = MPI_Scan(sendbuf, recvbuf, *count, get_datatype(*datatype), @@ -318,3 +336,32 @@ void mpi_alltoall__(void* sendbuf, int* sendcount, int* sendtype, *ierr = MPI_Alltoall(sendbuf, *sendcount, get_datatype(*sendtype), recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm)); } + +void mpi_test__ (int * request, int *flag, MPI_Status * status, int* ierr){ + MPI_Request req = find_request(*request); + *ierr= MPI_Test(&req, flag, status); +} +void mpi_get_processor_name__(char *name, int *resultlen, int* ierr){ + *ierr = MPI_Get_processor_name(name, resultlen); +} + +void mpi_get_count__(MPI_Status * status, int* datatype, int *count, int* ierr){ + *ierr = MPI_Get_count(status, get_datatype(*datatype), count); +} + +void mpi_type_extent__(int* datatype, MPI_Aint * extent, int* ierr){ + *ierr= MPI_Type_extent(get_datatype(*datatype), extent); +} + +void mpi_type_ub__(int* datatype, MPI_Aint * disp, int* ierr){ + *ierr= MPI_Type_ub(get_datatype(*datatype), disp); +} + +void mpi_type_lb__(int* datatype, MPI_Aint * extent, int* ierr){ + *ierr= MPI_Type_extent(get_datatype(*datatype), extent); +} + +void mpi_type_size__(int* datatype, int *size, int* ierr) +{ + *ierr = MPI_Type_size(get_datatype(*datatype), size); +}