X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/43cb0b7a116ccf23fd546a7dafded7782e5d6ba4..3de9a311baa2836973d459c793990c0ce1402f73:/src/smpi/smpi_pmpi.c?ds=sidebyside diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index d5d9ecf58f..22858c3f3f 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -1,3 +1,4 @@ + /* Copyright (c) 2007-2014. The SimGrid Team. * All rights reserved. */ @@ -2586,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; + 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; } retval = smpi_mpi_cart_create(comm_old, ndims, dims, periodic, reorder, comm_cart); - - smpi_bench_begin(); - return retval; } @@ -2680,6 +2677,25 @@ int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) { return smpi_mpi_cart_sub(comm, remain_dims, comm_new); } +int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype){ + if(oldtype == MPI_DATATYPE_NULL) { + return MPI_ERR_TYPE; + } + 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; +} + /* The following calls are not yet implemented and will fail at runtime. */ /* Once implemented, please move them above this notice. */ @@ -2689,10 +2705,6 @@ int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) { return MPI_SUCCESS; \ } -int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype){ - NOT_YET_IMPLEMENTED -} - int PMPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype){ NOT_YET_IMPLEMENTED }