X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8bcc1dbe28f658ea786ba234a679601edd30758a..36fa571a13985879dc627c70ecc2340af606aa42:/src/smpi/smpi_mpi_dt_private.h diff --git a/src/smpi/smpi_mpi_dt_private.h b/src/smpi/smpi_mpi_dt_private.h index f0e612fcd5..0ac7ca5a5d 100644 --- a/src/smpi/smpi_mpi_dt_private.h +++ b/src/smpi/smpi_mpi_dt_private.h @@ -13,6 +13,8 @@ #include "private.h" +SG_BEGIN_DECL() + #define DT_FLAG_DESTROYED 0x0001 /**< user destroyed but some other layers still have a reference */ #define DT_FLAG_COMMITED 0x0002 /**< ready to be used for a send/recv operation */ #define DT_FLAG_CONTIGUOUS 0x0004 /**< contiguous datatype */ @@ -30,18 +32,11 @@ * We should make the difference here between the predefined contiguous and non contiguous * datatypes. The DT_FLAG_BASIC is held by all predefined contiguous datatypes. */ -#define DT_FLAG_BASIC (DT_FLAG_PREDEFINED | DT_FLAG_CONTIGUOUS | DT_FLAG_NO_GAPS | DT_FLAG_DATA | DT_FLAG_COMMITED) - -extern MPI_Datatype MPI_PTR; +#define DT_FLAG_BASIC (DT_FLAG_PREDEFINED | DT_FLAG_CONTIGUOUS | DT_FLAG_NO_GAPS | DT_FLAG_DATA | DT_FLAG_COMMITED) +extern const MPI_Datatype MPI_PTR; -//***************************************************************************************** - -/* - These are the structures that handle complex data type information, - used for serialization/unserialization of messages -*/ - +/* Structures that handle complex data type information, used for serialization/unserialization of messages */ typedef struct s_smpi_mpi_contiguous{ s_smpi_subtype_t base; MPI_Datatype old_type; @@ -100,117 +95,53 @@ typedef struct s_smpi_mpi_struct{ Functions to handle serialization/unserialization of messages, 3 for each type of MPI_Type One for creating the substructure to handle, one for serialization, one for unserialization */ -XBT_PRIVATE void unserialize_contiguous( const void *contiguous_vector, - void *noncontiguous_vector, - int count, - void *type, - MPI_Op op); - -XBT_PRIVATE void serialize_contiguous( const void *noncontiguous_vector, - void *contiguous_vector, - int count, - void *type); - +XBT_PRIVATE void unserialize_contiguous( void *contiguous_vector, void *noncontiguous_vector, int count, + void *type, MPI_Op op); +XBT_PRIVATE void serialize_contiguous( void *noncontiguous_vector, void *contiguous_vector, int count,void *type); XBT_PRIVATE void free_contiguous(MPI_Datatype* type); - -XBT_PRIVATE s_smpi_mpi_contiguous_t* smpi_datatype_contiguous_create( MPI_Aint lb, - int block_count, - MPI_Datatype old_type, - int size_oldtype); +XBT_PRIVATE void use_contiguous(MPI_Datatype* type); +XBT_PRIVATE s_smpi_mpi_contiguous_t* smpi_datatype_contiguous_create( MPI_Aint lb, int block_count, + MPI_Datatype old_type, int size_oldtype); -XBT_PRIVATE void unserialize_vector( const void *contiguous_vector, - void *noncontiguous_vector, - int count, - void *type, +XBT_PRIVATE void unserialize_vector( void *contiguous_vector, void *noncontiguous_vector, int count,void *type, MPI_Op op); - -XBT_PRIVATE void serialize_vector( const void *noncontiguous_vector, - void *contiguous_vector, - int count, - void *type); - +XBT_PRIVATE void serialize_vector( void *noncontiguous_vector, void *contiguous_vector, int count, void *type); XBT_PRIVATE void free_vector(MPI_Datatype* type); +XBT_PRIVATE void use_vector(MPI_Datatype* type); +XBT_PRIVATE s_smpi_mpi_vector_t* smpi_datatype_vector_create( int block_stride, int block_length, int block_count, + MPI_Datatype old_type, int size_oldtype); -XBT_PRIVATE s_smpi_mpi_vector_t* smpi_datatype_vector_create( int block_stride, - int block_length, - int block_count, - MPI_Datatype old_type, - int size_oldtype); - -XBT_PRIVATE void unserialize_hvector( const void *contiguous_vector, - void *noncontiguous_vector, - int count, - void *type, +XBT_PRIVATE void unserialize_hvector( void *contiguous_vector, void *noncontiguous_vector, int count, void *type, MPI_Op op); - -XBT_PRIVATE void serialize_hvector( const void *noncontiguous_vector, - void *contiguous_vector, - int count, - void *type); - +XBT_PRIVATE void serialize_hvector( void *noncontiguous_vector, void *contiguous_vector, int count, void *type); XBT_PRIVATE void free_hvector(MPI_Datatype* type); +XBT_PRIVATE void use_hvector(MPI_Datatype* type); +XBT_PRIVATE s_smpi_mpi_hvector_t* smpi_datatype_hvector_create( MPI_Aint block_stride, int block_length, + int block_count, MPI_Datatype old_type, int size_oldtype); -XBT_PRIVATE s_smpi_mpi_hvector_t* smpi_datatype_hvector_create( MPI_Aint block_stride, - int block_length, - int block_count, - MPI_Datatype old_type, - int size_oldtype); - - -XBT_PRIVATE void unserialize_indexed( const void *contiguous_indexed, - void *noncontiguous_indexed, - int count, - void *type, - MPI_Op op); - -XBT_PRIVATE void serialize_indexed( const void *noncontiguous_vector, - void *contiguous_vector, - int count, - void *type); - +XBT_PRIVATE void unserialize_indexed( void *contiguous_indexed, void *noncontiguous_indexed, int count, + void *type, MPI_Op op); +XBT_PRIVATE void serialize_indexed( void *noncontiguous_vector, void *contiguous_vector, int count, void *type); XBT_PRIVATE void free_indexed(MPI_Datatype* type); +XBT_PRIVATE void use_indexed(MPI_Datatype* type); +XBT_PRIVATE s_smpi_mpi_indexed_t* smpi_datatype_indexed_create(int* block_lengths, int* block_indices, + int block_count, MPI_Datatype old_type, int size_oldtype); -XBT_PRIVATE s_smpi_mpi_indexed_t* smpi_datatype_indexed_create(int* block_lengths, - int* block_indices, - int block_count, - MPI_Datatype old_type, - int size_oldtype); - -XBT_PRIVATE void unserialize_hindexed( const void *contiguous_indexed, - void *noncontiguous_indexed, - int count, - void *type, - MPI_Op op); - -XBT_PRIVATE void serialize_hindexed( const void *noncontiguous_vector, - void *contiguous_vector, - int count, - void *type); - +XBT_PRIVATE void unserialize_hindexed( void *contiguous_indexed, void *noncontiguous_indexed, int count, + void *type, MPI_Op op); +XBT_PRIVATE void serialize_hindexed( void *noncontiguous_vector, void *contiguous_vector, int count, void *type); XBT_PRIVATE void free_hindexed(MPI_Datatype* type); +XBT_PRIVATE void use_hindexed(MPI_Datatype* type); +XBT_PRIVATE s_smpi_mpi_hindexed_t* smpi_datatype_hindexed_create(int* block_lengths, MPI_Aint* block_indices, + int block_count, MPI_Datatype old_type, int size_oldtype); -XBT_PRIVATE s_smpi_mpi_hindexed_t* smpi_datatype_hindexed_create(int* block_lengths, - MPI_Aint* block_indices, - int block_count, - MPI_Datatype old_type, - int size_oldtype); - -XBT_PRIVATE void unserialize_struct( const void *contiguous_indexed, - void *noncontiguous_indexed, - int count, - void *type, +XBT_PRIVATE void unserialize_struct( void *contiguous_indexed, void *noncontiguous_indexed, int count, void *type, MPI_Op op); - -XBT_PRIVATE void serialize_struct( const void *noncontiguous_vector, - void *contiguous_vector, - int count, - void *type); - +XBT_PRIVATE void serialize_struct( void *noncontiguous_vector, void *contiguous_vector, int count, void *type); XBT_PRIVATE void free_struct(MPI_Datatype* type); +XBT_PRIVATE void use_struct(MPI_Datatype* type); +XBT_PRIVATE s_smpi_mpi_struct_t* smpi_datatype_struct_create(int* block_lengths, MPI_Aint* block_indices, + int block_count, MPI_Datatype* old_types); -XBT_PRIVATE s_smpi_mpi_struct_t* smpi_datatype_struct_create(int* block_lengths, - MPI_Aint* block_indices, - int block_count, - MPI_Datatype* old_types); - +SG_END_DECL() #endif