root/ompi/mca/io/romio321/romio/adio/common/ad_threaded_io.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_IO_Thread_Func

   1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
   2 /*
   3  *   Copyright (C) 1997-2001 University of Chicago.
   4  *   See COPYRIGHT notice in top-level directory.
   5  */
   6 
   7 #include "adio.h"
   8 #include "adio_extern.h"
   9 
  10 #include <pthread.h>
  11 /* Function for running in another thread for doing the file reading while the
  12  * main thread is doing data aggregation - useful only when multiple rounds are
  13  * needed due to file size relative to the read buffer size and number of
  14  * aggregators */
  15 
  16 void *ADIOI_IO_Thread_Func(void *vptr_args) {
  17     ADIOI_IO_ThreadFuncData *args = (ADIOI_IO_ThreadFuncData*)vptr_args;
  18 
  19     ADIOI_Assert(args->size == (int)(args->size));
  20 
  21     if (args->io_kind == ADIOI_READ) {
  22         ADIO_ReadContig(args->fd, args->buf, args->size, MPI_BYTE,
  23                 ADIO_EXPLICIT_OFFSET, args->offset,
  24                 args->status, &(args->error_code));
  25     } else {
  26         ADIO_WriteContig(args->fd, args->buf, args->size, MPI_BYTE,
  27                 ADIO_EXPLICIT_OFFSET, args->offset,
  28                 args->status, &(args->error_code));
  29     }
  30     pthread_exit(&(args->error_code));
  31     return NULL;
  32 }

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