diff options
author | cvs2svn <no_author@cvs2svn> | 2004-08-02 14:10:07 (GMT) |
---|---|---|
committer | cvs2svn <no_author@cvs2svn> | 2004-08-02 14:10:07 (GMT) |
commit | 529c7b27c78a42fddc90df243d8d3f43e8fec7d6 (patch) | |
tree | 61100929e0c289603c8016a9fa147c818056ff30 /src | |
parent | f8b2efd52d6239251d65975ca7146dd3d20c4843 (diff) | |
download | hdf5-529c7b27c78a42fddc90df243d8d3f43e8fec7d6.zip hdf5-529c7b27c78a42fddc90df243d8d3f43e8fec7d6.tar.gz hdf5-529c7b27c78a42fddc90df243d8d3f43e8fec7d6.tar.bz2 |
[svn-r8984] This commit was manufactured by cvs2svn to create branch 'hdf5_1_6'.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDmpi.h | 94 | ||||
-rw-r--r-- | src/H5HGdbg.c | 135 | ||||
-rw-r--r-- | src/H5HGpkg.h | 96 | ||||
-rw-r--r-- | src/H5HLpkg.h | 81 |
4 files changed, 406 insertions, 0 deletions
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h new file mode 100644 index 0000000..aac7bf6 --- /dev/null +++ b/src/H5FDmpi.h @@ -0,0 +1,94 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Friday, January 30, 2004 + * + * Purpose: The public header file for common items for all MPI VFL drivers + */ +#ifndef H5FDmpi_H +#define H5FDmpi_H + +/* Type of I/O for data transfer properties */ +typedef enum H5FD_mpio_xfer_t { + H5FD_MPIO_INDEPENDENT = 0, /*zero is the default*/ + H5FD_MPIO_COLLECTIVE +} H5FD_mpio_xfer_t; + +#ifdef H5_HAVE_PARALLEL + +/* Sub-class the H5FD_class_t to add more specific functions for MPI-based VFDs */ +typedef struct H5FD_class_mpi_t { + H5FD_class_t super; /* Superclass information & methods */ + int (*get_rank)(const H5FD_t *file); /* Get the MPI rank of a process */ + int (*get_size)(const H5FD_t *file); /* Get the MPI size of a communicator */ + MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */ +} H5FD_class_mpi_t; +#endif /* H5_HAVE_PARALLEL */ + +/* Include all the MPI VFL headers */ +#include "H5FDfphdf5.h" /* Flexible PHDF5 file driver */ +#include "H5FDmpio.h" /* MPI I/O file driver */ +#include "H5FDmpiposix.h" /* MPI/posix I/O file driver */ + +/* Macros */ + +/* Single macro to check for all file drivers that use MPI */ +#define IS_H5FD_MPI(file) \ + (IS_H5FD_MPIO(file) || IS_H5FD_MPIPOSIX(file) || IS_H5FD_FPHDF5(file)) + +#ifdef H5_HAVE_PARALLEL +/* ======== Temporary data transfer properties ======== */ +/* Definitions for memory MPI type property */ +#define H5FD_MPI_XFER_MEM_MPI_TYPE_NAME "H5FD_mpi_mem_mpi_type" +#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype) +/* Definitions for file MPI type property */ +#define H5FD_MPI_XFER_FILE_MPI_TYPE_NAME "H5FD_mpi_file_mpi_type" +#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype) + +/* + * The view is set to this value + */ +H5_DLLVAR char H5FD_mpi_native_g[]; + +/* Function prototypes */ +#ifdef __cplusplus +extern "C" { +#endif +/* General routines */ +H5_DLL haddr_t H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off); +H5_DLL herr_t H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/); +H5_DLL herr_t H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, + MPI_Comm *comm_new, MPI_Info *info_new); +H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info); +#ifdef NOT_YET +H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); +H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file); +#endif /* NOT_YET */ +H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, + MPI_Datatype ftype); +H5_DLL herr_t H5FD_mpi_teardown_collective(hid_t dxpl_id); + +/* Driver specific methods */ +H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); +H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); +H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); +#ifdef __cplusplus +} +#endif + +#endif /* H5_HAVE_PARALLEL */ + +#endif /* H5FDmpi_H */ diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c new file mode 100644 index 0000000..68a3e85 --- /dev/null +++ b/src/H5HGdbg.c @@ -0,0 +1,135 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Wednesday, July 9, 2003 + * + * Purpose: Global Heap object debugging functions. + */ +#define H5HG_PACKAGE /*suppress error about including H5HGpkg */ + +/* Pablo information */ +/* (Put before include files to avoid problems with inline functions) */ +#define PABLO_MASK H5HGdbg_mask + +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5HGpkg.h" /* Global heaps */ +#include "H5Iprivate.h" /* ID Functions */ + + +/*------------------------------------------------------------------------- + * Function: H5HG_debug + * + * Purpose: Prints debugging information about a global heap collection. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Mar 27, 1998 + * + * Modifications: + * Robb Matzke, 1999-07-28 + * The ADDR argument is passed by value. + * + * Robb Matzke, LLNL, 2003-06-05 + * The size does not include the object header, just the data. + *------------------------------------------------------------------------- + */ +herr_t +H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, + int fwidth) +{ + unsigned u, nused, maxobj; + unsigned j, k; + H5HG_heap_t *h = NULL; + char buf[64]; + uint8_t *p = NULL; + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5HG_debug, FAIL); + + /* check arguments */ + assert(f); + assert(H5F_addr_defined (addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + + if (NULL == (h = H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, NULL, NULL, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load global heap collection"); + + fprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); + fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, + "Dirty:", + (int)(h->cache_info.is_dirty)); + fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + "Total collection size in file:", + (unsigned long)(h->size)); + + for (u=1, nused=0, maxobj=0; u<h->nused; u++) { + if (h->obj[u].begin) { + nused++; + if (u>maxobj) maxobj = u; + } + } + fprintf (stream, "%*s%-*s %u/%lu/", indent, "", fwidth, + "Objects defined/allocated/max:", + nused, (unsigned long)h->nalloc); + fprintf (stream, nused ? "%u\n": "NA\n", maxobj); + + fprintf (stream, "%*s%-*s %lu\n", indent, "", fwidth, + "Free space:", + (unsigned long)(h->obj[0].size)); + + for (u=1; u<h->nused; u++) { + if (h->obj[u].begin) { + sprintf (buf, "Object %u", u); + fprintf (stream, "%*s%s\n", indent, "", buf); + fprintf (stream, "%*s%-*s %d\n", indent+3, "", MIN(fwidth-3, 0), + "Reference count:", + h->obj[u].nrefs); + fprintf (stream, "%*s%-*s %lu/%lu\n", indent+3, "", + MIN(fwidth-3, 0), + "Size of object body:", + (unsigned long)(h->obj[u].size), + (unsigned long)H5HG_ALIGN(h->obj[u].size)); + p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f); + for (j=0; j<h->obj[u].size; j+=16) { + fprintf (stream, "%*s%04d: ", indent+6, "", j); + for (k=0; k<16; k++) { + if (8==k) fprintf (stream, " "); + if (j+k<h->obj[u].size) { + fprintf (stream, "%02x ", p[j+k]); + } else { + HDfputs(" ", stream); + } + } + for (k=0; k<16 && j+k<h->obj[u].size; k++) { + if (8==k) fprintf (stream, " "); + HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream); + } + fprintf (stream, "\n"); + } + } + } + +done: + if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, FALSE) != SUCCEED) + HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); + + FUNC_LEAVE_NOAPI(ret_value); +} diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h new file mode 100644 index 0000000..de5bb77 --- /dev/null +++ b/src/H5HGpkg.h @@ -0,0 +1,96 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Wednesday, July 9, 2003 + * + * Purpose: This file contains declarations which are visible + * only within the H5HG package. Source files outside the + * H5HG package should include H5HGprivate.h instead. + */ +#ifndef H5HG_PACKAGE +#error "Do not include this file outside the H5HG package!" +#endif + +#ifndef _H5HGpkg_H +#define _H5HGpkg_H + +/* Get package's private header */ +#include "H5HGprivate.h" + +/* Other private headers needed by this file */ + +/*****************************/ +/* Package Private Variables */ +/*****************************/ + +/* The cache subclass */ +H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1]; + +/**************************/ +/* Package Private Macros */ +/**************************/ + +/* + * Pad all global heap messages to a multiple of eight bytes so we can load + * the entire collection into memory and operate on it there. Eight should + * be sufficient for machines that have alignment constraints because our + * largest data type is eight bytes. + */ +#define H5HG_ALIGNMENT 8 +#define H5HG_ALIGN(X) (H5HG_ALIGNMENT*(((X)+H5HG_ALIGNMENT-1)/ \ + H5HG_ALIGNMENT)) +#define H5HG_ISALIGNED(X) ((X)==H5HG_ALIGN(X)) + +/* + * The overhead associated with each object in the heap, always a multiple of + * the alignment so that the stuff that follows the header is aligned. + */ +#define H5HG_SIZEOF_OBJHDR(f) \ + H5HG_ALIGN(2 + /*object id number */ \ + 2 + /*reference count */ \ + 4 + /*reserved */ \ + H5F_SIZEOF_SIZE(f)) /*object data size */ + +/****************************/ +/* Package Private Typedefs */ +/****************************/ + +typedef struct H5HG_obj_t { + int nrefs; /*reference count */ + size_t size; /*total size of object */ + uint8_t *begin; /*ptr to object into heap->chunk*/ +} H5HG_obj_t; + +struct H5HG_heap_t { + H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ + /* first field in structure */ + haddr_t addr; /*collection address */ + size_t size; /*total size of collection */ + uint8_t *chunk; /*the collection, incl. header */ + size_t nalloc; /*numb object slots allocated */ + size_t nused; /*number of slots used */ + /* If this value is >65535 then all indices */ + /* have been used at some time and the */ + /* correct new index should be searched for */ + H5HG_obj_t *obj; /*array of object descriptions */ +}; + +/******************************/ +/* Package Private Prototypes */ +/******************************/ + +#endif + diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h new file mode 100644 index 0000000..1a61866 --- /dev/null +++ b/src/H5HLpkg.h @@ -0,0 +1,81 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Wednesday, July 9, 2003 + * + * Purpose: This file contains declarations which are visible + * only within the H5HL package. Source files outside the + * H5HL package should include H5HLprivate.h instead. + */ +#ifndef H5HL_PACKAGE +#error "Do not include this file outside the H5HL package!" +#endif + +#ifndef _H5HLpkg_H +#define _H5HLpkg_H + +/* Get package's private header */ +#include "H5HLprivate.h" + +/* Other private headers needed by this file */ + +/*****************************/ +/* Package Private Variables */ +/*****************************/ + +/* The cache subclass */ +H5_DLLVAR const H5AC_class_t H5AC_LHEAP[1]; + +/**************************/ +/* Package Private Macros */ +/**************************/ + +#define H5HL_SIZEOF_HDR(F) \ + H5HL_ALIGN(H5HL_SIZEOF_MAGIC + /*heap signature */ \ + 4 + /*reserved */ \ + H5F_SIZEOF_SIZE (F) + /*data size */ \ + H5F_SIZEOF_SIZE (F) + /*free list head */ \ + H5F_SIZEOF_ADDR (F)) /*data address */ + +/****************************/ +/* Package Private Typedefs */ +/****************************/ + +typedef struct H5HL_free_t { + size_t offset; /*offset of free block */ + size_t size; /*size of free block */ + struct H5HL_free_t *prev; /*previous entry in free list */ + struct H5HL_free_t *next; /*next entry in free list */ +} H5HL_free_t; + +struct H5HL_t { + H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ + /* first field in structure */ + haddr_t addr; /*address of data */ + size_t disk_alloc; /*data bytes allocated on disk */ + size_t mem_alloc; /*data bytes allocated in mem */ + size_t disk_resrv; /*data bytes "reserved" on disk */ + uint8_t *chunk; /*the chunk, including header */ + H5HL_free_t *freelist; /*the free list */ +}; + +/******************************/ +/* Package Private Prototypes */ +/******************************/ + +#endif + + |