root/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_err.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPIO_Err_create_code
  2. MPIO_Err_return_file
  3. MPIO_Err_return_comm

   1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
   2 /*
   3  *   Copyright (C) 2004 University of Chicago.
   4  *   See COPYRIGHT notice in top-level directory.
   5  */
   6 
   7 #include <stdarg.h>
   8 #include <stdio.h>
   9 
  10 #include "mpioimpl.h"
  11 #include "adio_extern.h"
  12 
  13 /* Default error handling implementation.
  14  *
  15  * Note that only MPI_ERRORS_ARE_FATAL and MPI_ERRORS_RETURN are
  16  * handled correctly; other handlers cause an abort.
  17  */
  18 
  19 int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[],
  20                          int line, int error_class, const char generic_msg[],
  21                          const char specific_msg[], ...)
  22 {
  23     va_list Argp;
  24     int idx = 0;
  25     char *buf;
  26 
  27     buf = (char *) ADIOI_Malloc(1024);
  28     if (buf != NULL) {
  29         idx += ADIOI_Snprintf(buf, 1023, "%s (line %d): ", fcname, line);
  30         if (specific_msg == NULL) {
  31             ADIOI_Snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg);
  32         }
  33         else {
  34             va_start(Argp, specific_msg);
  35             vsnprintf(&buf[idx], 1023 - idx, specific_msg, Argp);
  36             va_end(Argp);
  37         }
  38         ADIOI_Free(buf);
  39     }
  40 
  41     return error_class;
  42 }
  43 
  44 int MPIO_Err_return_file(MPI_File mpi_fh, int error_code)
  45 {
  46     return error_code;
  47 }
  48 
  49 int MPIO_Err_return_comm(MPI_Comm mpi_comm, int error_code)
  50 {
  51     return error_code;
  52 }

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