root/opal/datatype/opal_datatype_resize.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. opal_datatype_resize

   1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
   2 /*
   3  * Copyright (c) 2004-2009 The University of Tennessee and The University
   4  *                         of Tennessee Research Foundation.  All rights
   5  *                         reserved.
   6  * Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
   7  * Copyright (c) 2015-2017 Research Organization for Information Science
   8  *                         and Technology (RIST). All rights reserved.
   9  * $COPYRIGHT$
  10  *
  11  * Additional copyrights may follow
  12  *
  13  * $HEADER$
  14  */
  15 
  16 #include "opal_config.h"
  17 #include "opal/constants.h"
  18 #include "opal/datatype/opal_datatype.h"
  19 #include "opal/datatype/opal_datatype_internal.h"
  20 
  21 int32_t opal_datatype_resize( opal_datatype_t* type, ptrdiff_t lb, ptrdiff_t extent )
  22 {
  23     type->lb = lb;
  24     type->ub = lb + extent;
  25 
  26     type->flags &= ~OPAL_DATATYPE_FLAG_NO_GAPS;
  27     if( (extent == (ptrdiff_t)type->size) &&
  28         (type->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) ) {
  29         type->flags |= OPAL_DATATYPE_FLAG_NO_GAPS;
  30     }
  31     return OPAL_SUCCESS;
  32 }

/* [<][>][^][v][top][bottom][index][help] */