diff --git a/ompi/datatype/ompi_datatype.h b/ompi/datatype/ompi_datatype.h index 0119bc49b5..8966f5cf16 100644 --- a/ompi/datatype/ompi_datatype.h +++ b/ompi/datatype/ompi_datatype.h @@ -39,10 +39,7 @@ #endif #include "ompi/constants.h" -#include "opal/class/opal_pointer_array.h" -#include "opal/class/opal_hash_table.h" #include "opal/datatype/opal_convertor.h" -#include "opal/datatype/opal_datatype.h" #include "mpi.h" BEGIN_C_DECLS @@ -177,31 +174,8 @@ ompi_datatype_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, uint return opal_datatype_add( &pdtBase->super, &pdtAdd->super, count, disp, extent ); } - -static inline int32_t -ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newType ) -{ - ompi_datatype_t * new_ompi_datatype = ompi_datatype_create( oldType->super.desc.used + 2 ); - - *newType = new_ompi_datatype; - if( NULL == new_ompi_datatype ) { - return OMPI_ERR_OUT_OF_RESOURCE; - } - opal_datatype_clone( &oldType->super, &new_ompi_datatype->super); - /* Strip the predefined flag at the OMPI level. */ - new_ompi_datatype->super.flags &= ~OMPI_DATATYPE_FLAG_PREDEFINED; - /* By default maintain the relationships related to the old data (such as ops) */ - new_ompi_datatype->id = oldType->id; - - /* Set the keyhash to NULL -- copying attributes is *only* done at - the top level (specifically, MPI_TYPE_DUP). */ - new_ompi_datatype->d_keyhash = NULL; - new_ompi_datatype->args = NULL; - snprintf (new_ompi_datatype->name, MPI_MAX_OBJECT_NAME, "Dup %s", - oldType->name); - - return OMPI_SUCCESS; -} +OMPI_DECLSPEC int32_t +ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newType ); OMPI_DECLSPEC int32_t ompi_datatype_create_contiguous( int count, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); OMPI_DECLSPEC int32_t ompi_datatype_create_vector( int count, int bLength, int stride, diff --git a/ompi/datatype/ompi_datatype_args.c b/ompi/datatype/ompi_datatype_args.c index 400dc2b380..f08497548d 100644 --- a/ompi/datatype/ompi_datatype_args.c +++ b/ompi/datatype/ompi_datatype_args.c @@ -24,8 +24,6 @@ #include -#include "mpi.h" - #include "opal/align.h" #include "opal/types.h" #include "opal/util/arch.h" diff --git a/ompi/datatype/ompi_datatype_create.c b/ompi/datatype/ompi_datatype_create.c index 804afac99d..b73eb781ca 100644 --- a/ompi/datatype/ompi_datatype_create.c +++ b/ompi/datatype/ompi_datatype_create.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2010 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -24,7 +24,6 @@ #include #endif -#include "ompi/constants.h" #include "opal/class/opal_pointer_array.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/attribute/attribute.h" @@ -87,3 +86,29 @@ int32_t ompi_datatype_destroy( ompi_datatype_t** type) *type = NULL; return OMPI_SUCCESS; } + +int32_t +ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newType ) +{ + ompi_datatype_t * new_ompi_datatype = ompi_datatype_create( oldType->super.desc.used + 2 ); + + *newType = new_ompi_datatype; + if( NULL == new_ompi_datatype ) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + opal_datatype_clone( &oldType->super, &new_ompi_datatype->super); + /* Strip the predefined flag at the OMPI level. */ + new_ompi_datatype->super.flags &= ~OMPI_DATATYPE_FLAG_PREDEFINED; + /* By default maintain the relationships related to the old data (such as ops) */ + new_ompi_datatype->id = oldType->id; + + /* Set the keyhash to NULL -- copying attributes is *only* done at + the top level (specifically, MPI_TYPE_DUP). */ + new_ompi_datatype->d_keyhash = NULL; + new_ompi_datatype->args = NULL; + snprintf (new_ompi_datatype->name, MPI_MAX_OBJECT_NAME, "Dup %s", + oldType->name); + + return OMPI_SUCCESS; +} + diff --git a/ompi/datatype/ompi_datatype_create_contiguous.c b/ompi/datatype/ompi_datatype_create_contiguous.c index 70ae21a89e..fb44673ef5 100644 --- a/ompi/datatype/ompi_datatype_create_contiguous.c +++ b/ompi/datatype/ompi_datatype_create_contiguous.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -20,7 +20,6 @@ */ #include "ompi_config.h" -#include "ompi/constants.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/datatype/ompi_datatype_internal.h" #include "mpi.h" diff --git a/ompi/datatype/ompi_datatype_create_darray.c b/ompi/datatype/ompi_datatype_create_darray.c index c27e8bff2d..7fcaf4e1ef 100644 --- a/ompi/datatype/ompi_datatype_create_darray.c +++ b/ompi/datatype/ompi_datatype_create_darray.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2011 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -24,7 +24,6 @@ #include -#include "ompi/constants.h" #include "ompi/datatype/ompi_datatype.h" static int diff --git a/ompi/datatype/ompi_datatype_create_indexed.c b/ompi/datatype/ompi_datatype_create_indexed.c index 0645ad03ef..9a75bca7a0 100644 --- a/ompi/datatype/ompi_datatype_create_indexed.c +++ b/ompi/datatype/ompi_datatype_create_indexed.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2010 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -24,7 +24,6 @@ #include -#include "ompi/constants.h" #include "ompi/datatype/ompi_datatype.h" diff --git a/ompi/datatype/ompi_datatype_create_struct.c b/ompi/datatype/ompi_datatype_create_struct.c index e03cdfc941..e2457d16ec 100644 --- a/ompi/datatype/ompi_datatype_create_struct.c +++ b/ompi/datatype/ompi_datatype_create_struct.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -24,7 +24,6 @@ #include -#include "ompi/constants.h" #include "ompi/datatype/ompi_datatype.h" int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, diff --git a/ompi/datatype/ompi_datatype_create_subarray.c b/ompi/datatype/ompi_datatype_create_subarray.c index 2c9b1caa8c..25b9a8f6f2 100644 --- a/ompi/datatype/ompi_datatype_create_subarray.c +++ b/ompi/datatype/ompi_datatype_create_subarray.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2011 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -24,7 +24,6 @@ #include -#include "ompi/constants.h" #include "ompi/datatype/ompi_datatype.h" int32_t ompi_datatype_create_subarray(int ndims, diff --git a/ompi/datatype/ompi_datatype_create_vector.c b/ompi/datatype/ompi_datatype_create_vector.c index a4b2aaf67a..c899f1d902 100644 --- a/ompi/datatype/ompi_datatype_create_vector.c +++ b/ompi/datatype/ompi_datatype_create_vector.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -24,7 +24,6 @@ #include -#include "ompi/constants.h" #include "ompi/datatype/ompi_datatype.h" /* Open questions ... diff --git a/ompi/datatype/ompi_datatype_external32.c b/ompi/datatype/ompi_datatype_external32.c index 098e7925aa..501f8d5fe8 100644 --- a/ompi/datatype/ompi_datatype_external32.c +++ b/ompi/datatype/ompi_datatype_external32.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -20,8 +20,6 @@ #include "ompi_config.h" -#include "ompi/constants.h" - #include "opal/datatype/opal_convertor.h" #include "opal/util/arch.h" #include "ompi/datatype/ompi_datatype.h" diff --git a/ompi/datatype/ompi_datatype_get_elements.c b/ompi/datatype/ompi_datatype_get_elements.c index 1274c96e92..a350f95fb7 100644 --- a/ompi/datatype/ompi_datatype_get_elements.c +++ b/ompi/datatype/ompi_datatype_get_elements.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2010 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, @@ -24,8 +24,6 @@ #include #include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" #include "ompi/datatype/ompi_datatype.h" int ompi_datatype_get_elements (ompi_datatype_t *datatype, size_t ucount, size_t *count) diff --git a/ompi/datatype/ompi_datatype_internal.h b/ompi/datatype/ompi_datatype_internal.h index 710cd9493f..4a37457efe 100644 --- a/ompi/datatype/ompi_datatype_internal.h +++ b/ompi/datatype/ompi_datatype_internal.h @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2009-2010 The University of Tennessee and The University + * Copyright (c) 2009-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. @@ -26,7 +26,6 @@ #define OMPI_DATATYPE_INTERNAL_H #include "opal/datatype/opal_datatype_internal.h" -#include "ompi/class/ompi_free_list.h" /* * This is the OMPI-layered numbering of ALL supported MPI types diff --git a/ompi/datatype/ompi_datatype_match_size.c b/ompi/datatype/ompi_datatype_match_size.c index 2c72a69d17..1e036c7003 100644 --- a/ompi/datatype/ompi_datatype_match_size.c +++ b/ompi/datatype/ompi_datatype_match_size.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -20,6 +20,7 @@ */ #include "ompi_config.h" +#include "opal/class/opal_pointer_array.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/datatype/ompi_datatype_internal.h" diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index 295334be5c..76578c35f2 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2010 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -27,9 +27,9 @@ #include #include -#include "ompi/constants.h" #include "opal/datatype/opal_convertor_internal.h" #include "opal/util/output.h" +#include "opal/class/opal_pointer_array.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/datatype/ompi_datatype_internal.h" diff --git a/ompi/datatype/ompi_datatype_sndrcv.c b/ompi/datatype/ompi_datatype_sndrcv.c index f0dd1caa85..8cbbac038c 100644 --- a/ompi/datatype/ompi_datatype_sndrcv.c +++ b/ompi/datatype/ompi_datatype_sndrcv.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2009 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -20,7 +20,6 @@ #include "ompi_config.h" -#include "ompi/constants.h" #include "opal/datatype/opal_datatype.h" #include "opal/datatype/opal_datatype_internal.h" #include "opal/datatype/opal_convertor.h"