From: scastelli Date: Wed, 11 Jun 2014 06:56:57 +0000 (+0200) Subject: Implementation of MPI_Type_create_resized X-Git-Tag: v3_12~988 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/067ec1dd6a6addce37f4b2f44075ba44f0dc4507?hp=6010e52c780a30c647d0864ed4d897f4b075ea8b Implementation of MPI_Type_create_resized --- diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index d5d9ecf58f..3e30e4d291 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. */ @@ -2680,6 +2681,16 @@ 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; + } + smpi_datatype_create(newtype,oldtype->size, lb, lb + extent, oldtype->has_subtype,oldtype->substruct, oldtype->flags); + + (*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 +2700,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 }