root/ompi/mca/io/romio321/romio/mpi2-other/info/info_free.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Info_free

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 1997 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "mpioimpl.h"
   9 
  10 #ifdef HAVE_WEAK_SYMBOLS
  11 
  12 #if defined(HAVE_PRAGMA_WEAK)
  13 #pragma weak MPI_Info_free = PMPI_Info_free
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPI_Info_free MPI_Info_free
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPI_Info_free as PMPI_Info_free
  18 /* end of weak pragmas */
  19 #endif
  20 
  21 /* Include mapping from MPI->PMPI */
  22 #define MPIO_BUILD_PROFILING
  23 #include "mpioprof.h"
  24 #endif
  25 
  26 /*@
  27     MPI_Info_free - Frees an info object
  28 
  29 Input Parameters:
  30 . info - info object (handle)
  31 
  32 .N fortran
  33 @*/
  34 int MPI_Info_free(MPI_Info *info)
  35 {
  36     MPI_Info curr, next;
  37 
  38     if ((*info <= (MPI_Info) 0) || ((*info)->cookie != MPIR_INFO_COOKIE)) {
  39         FPRINTF(stderr, "MPI_Info_free: Invalid info object\n");
  40         MPI_Abort(MPI_COMM_WORLD, 1);
  41     }
  42 
  43     curr = (*info)->next;
  44     ADIOI_Free(*info);
  45     *info = MPI_INFO_NULL;
  46 
  47     while (curr) {
  48         next = curr->next;
  49         ADIOI_Free(curr->key);
  50         ADIOI_Free(curr->value);
  51         ADIOI_Free(curr);
  52         curr = next;
  53     }
  54 
  55     return MPI_SUCCESS;
  56 }

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