1
1
openmpi/ompi/mca/io/base/io_base_request.h
Brian Barrett b57b8c5b3f Clean up request handling in the I/O framework to be more consistent with
other request-using frameworks.

 - Rather than having mpi/c/* functions allocate requests explicitly,
   pass the MPI_Request* down to the I/O component and have it 
   perform the allocation.
 - While the I/O base provides a base request which can be used,
   it is not required and all request management occurs within
   the component.
 - Push progress management into the component, rather than having it
   happen in the base.  Progress functions are now easily registered,
   and not all (ie, the one existing) components use progress functions
   in any rational way.

ROMIO switched to generalized requests instead of MPIO_Requests many
moons ago, and Open MPI now uses ROMIO's generalized requests, so there
is no reason to wrap those requests (which are OMPI requests) in another
level of request.

Now the file function passes the MPI_Request* to the ROMIO component,
which passes it to the underlying ROMIO function, which calls 
MPI_Grequest_start to create an OMPI request, which is what gets set
as the request to the user.  Much cleaner.

This patch has two motivations.  One, a whole heck of a lot of code
just got removed, and request handling is now much cleaner for I/O
components.  Two, by adding support for Argonne's proposed generalized
request extensions, we can allow ROMIO to provide async I/O through
generalized requests, which we couldn't rationally do in the old
setup due to the crazy request completion rules.

This commit was SVN r22235.
2009-11-26 05:13:43 +00:00

66 строки
1.7 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* This is the base request type for all IO requests.
*/
#ifndef IO_BASE_REQUEST_H
#define IO_BASE_REQUEST_H
#include "ompi_config.h"
#include "opal/class/opal_object.h"
#include "ompi/request/request.h"
#include "ompi/file/file.h"
#include "ompi/mca/io/base/base.h"
/**
* Base request type.
*/
struct mca_io_base_request_t {
/** Base request */
ompi_request_t super;
/** ompi_file_t of the file that owns this request */
ompi_file_t *req_file;
/** io component version number of the module that owns this
request (i.e., this defines what follows this entry in
memory) */
mca_io_base_version_t req_ver;
/** True if free has been called on this request (before it has
been finalized */
volatile bool free_called;
};
/**
* Convenience typedef
*/
typedef struct mca_io_base_request_t mca_io_base_request_t;
BEGIN_C_DECLS
/**
* Declare the class
*/
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_io_base_request_t);
END_C_DECLS
#endif