X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/067ec1dd6a6addce37f4b2f44075ba44f0dc4507..6235ffa5e7a5c3157228910d606b62971c57c1c5:/src/smpi/smpi_pmpi.c diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 3e30e4d291..4a9a8d22dd 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -2587,20 +2587,16 @@ int PMPI_Initialized(int* flag) { int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periodic, int reorder, MPI_Comm* comm_cart) { int retval = 0; - smpi_bench_end(); if (comm_old == MPI_COMM_NULL){ - return MPI_ERR_COMM; - } - else if (ndims < 0 || + retval = MPI_ERR_COMM; + } else if (ndims < 0 || (ndims > 0 && (dims == NULL || periodic == NULL)) || comm_cart == NULL) { - return MPI_ERR_ARG; + retval = MPI_ERR_ARG; + } else{ + retval = smpi_mpi_cart_create(comm_old, ndims, dims, periodic, reorder, comm_cart); } - retval = smpi_mpi_cart_create(comm_old, ndims, dims, periodic, reorder, comm_cart); - - smpi_bench_begin(); - return retval; } @@ -2685,7 +2681,16 @@ int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, if(oldtype == MPI_DATATYPE_NULL) { return MPI_ERR_TYPE; } - smpi_datatype_create(newtype,oldtype->size, lb, lb + extent, oldtype->has_subtype,oldtype->substruct, oldtype->flags); + int blocks[3] = { 1, 1, 1 }; + MPI_Aint disps[3] = { lb, 0, lb+extent }; + MPI_Datatype types[3] = { MPI_LB, oldtype, MPI_UB }; + + s_smpi_mpi_struct_t* subtype = smpi_datatype_struct_create( blocks, + disps, + 3, + types + ); + smpi_datatype_create(newtype,oldtype->size, lb, lb + extent, 1 , subtype, DT_FLAG_VECTOR); (*newtype)->flags &= ~DT_FLAG_COMMITED; return MPI_SUCCESS;