H5FDmpi.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 /*
00017  * Programmer:  Quincey Koziol <koziol@ncsa.uiuc.edu>
00018  *              Friday, January 30, 2004
00019  *
00020  * Purpose:     The public header file for common items for all MPI VFL drivers
00021  */
00022 #ifndef H5FDmpi_H
00023 #define H5FDmpi_H
00024 
00025 /***** Macros for One linked collective IO case. *****/
00026 /* The default value to do one linked collective IO for all chunks.
00027    If the average number of chunks per process is greater than this value,
00028       the library will create an MPI derived datatype to link all chunks to do collective IO.
00029       The user can set this value through an API. */
00030 
00031 #define H5D_ONE_LINK_CHUNK_IO_THRESHOLD 0
00032 /***** Macros for multi-chunk collective IO case. *****/
00033 /* The default value of the threshold to do collective IO for this chunk.
00034    If the average percentage of processes per chunk is greater than the default value,
00035    collective IO is done for this chunk.
00036 */
00037 
00038 #define H5D_MULTI_CHUNK_IO_COL_THRESHOLD 60
00039 /* Type of I/O for data transfer properties */
00040 typedef enum H5FD_mpio_xfer_t {
00041     H5FD_MPIO_INDEPENDENT = 0,          /*zero is the default*/
00042     H5FD_MPIO_COLLECTIVE
00043 } H5FD_mpio_xfer_t;
00044 
00045 /* Type of chunked dataset I/O */
00046 typedef enum H5FD_mpio_chunk_opt_t {
00047     H5FD_MPIO_CHUNK_DEFAULT = 0,
00048     H5FD_MPIO_CHUNK_ONE_IO,             /*zero is the default*/
00049     H5FD_MPIO_CHUNK_MULTI_IO
00050 } H5FD_mpio_chunk_opt_t;
00051 
00052 /* Type of collective I/O */
00053 typedef enum H5FD_mpio_collective_opt_t {
00054     H5FD_MPIO_COLLECTIVE_IO = 0,
00055     H5FD_MPIO_INDIVIDUAL_IO             /*zero is the default*/
00056 } H5FD_mpio_collective_opt_t;
00057 
00058 
00059 #ifdef H5_HAVE_PARALLEL
00060 
00061 /* Sub-class the H5FD_class_t to add more specific functions for MPI-based VFDs */
00062 typedef struct H5FD_class_mpi_t {
00063     H5FD_class_t        super;          /* Superclass information & methods */
00064     int  (*get_rank)(const H5FD_t *file);     /* Get the MPI rank of a process */
00065     int  (*get_size)(const H5FD_t *file);     /* Get the MPI size of a communicator */
00066     MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */
00067 } H5FD_class_mpi_t;
00068 #endif /* H5_HAVE_PARALLEL */
00069 
00070 /* Include all the MPI VFL headers */
00071 #include "H5FDmpio.h"           /* MPI I/O file driver                  */
00072 #include "H5FDmpiposix.h"       /* MPI/posix I/O file driver            */
00073 
00074 /* Macros */
00075 
00076 /* Single macro to check for all file drivers that use MPI */
00077 #define IS_H5FD_MPI(file)  \
00078         (IS_H5FD_MPIO(file) || IS_H5FD_MPIPOSIX(file))
00079 
00080 #ifdef H5_HAVE_PARALLEL
00081 /* ======== Temporary data transfer properties ======== */
00082 /* Definitions for memory MPI type property */
00083 #define H5FD_MPI_XFER_MEM_MPI_TYPE_NAME        "H5FD_mpi_mem_mpi_type"
00084 #define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE        sizeof(MPI_Datatype)
00085 /* Definitions for file MPI type property */
00086 #define H5FD_MPI_XFER_FILE_MPI_TYPE_NAME       "H5FD_mpi_file_mpi_type"
00087 #define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE       sizeof(MPI_Datatype)
00088 
00089 /*
00090  * The view is set to this value
00091  */
00092 H5_DLLVAR char H5FD_mpi_native_g[];
00093 
00094 /* Function prototypes */
00095 #ifdef __cplusplus
00096 extern "C" {
00097 #endif
00098 /* General routines */
00099 H5_DLL haddr_t H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off);
00100 H5_DLL herr_t H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/);
00101 H5_DLL herr_t H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info,
00102                                 MPI_Comm *comm_new, MPI_Info *info_new);
00103 H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info);
00104 #ifdef NOT_YET
00105 H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file);
00106 H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file);
00107 #endif /* NOT_YET */
00108 H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype,
00109     MPI_Datatype ftype);
00110 H5_DLL herr_t H5FD_mpi_teardown_collective(hid_t dxpl_id);
00111 
00112 /* Driver specific methods */
00113 H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file);
00114 H5_DLL int H5FD_mpi_get_size(const H5FD_t *file);
00115 H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file);
00116 #ifdef __cplusplus
00117 }
00118 #endif
00119 
00120 #endif /* H5_HAVE_PARALLEL */
00121 
00122 #endif /* H5FDmpi_H */
00123