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

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Info_get_nkeys

   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_get_nkeys = PMPI_Info_get_nkeys
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPI_Info_get_nkeys MPI_Info_get_nkeys
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPI_Info_get_nkeys as PMPI_Info_get_nkeys
  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_get_nkeys - Returns the number of currently defined keys in info
  28 
  29 Input Parameters:
  30 . info - info object (handle)
  31 
  32 Output Parameters:
  33 . nkeys - number of defined keys (integer)
  34 
  35 .N fortran
  36 @*/
  37 int MPI_Info_get_nkeys(MPI_Info info, int *nkeys)
  38 {
  39     MPI_Info curr;
  40 
  41     if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) {
  42         FPRINTF(stderr, "MPI_Info_get_nkeys: Invalid info object\n");
  43         MPI_Abort(MPI_COMM_WORLD, 1);
  44     }
  45 
  46     curr = info->next;
  47     *nkeys = 0;
  48 
  49     while (curr) {
  50         curr = curr->next;
  51         (*nkeys)++;
  52     }
  53 
  54     return MPI_SUCCESS;
  55 }

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