2005-02-08 09:03:48 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2005-02-08 09:03:48 +08:00
|
|
|
|
* 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 *
|
2017-04-18 03:32:16 +08:00
|
|
|
|
* the COPYING file, which can be found at the root of the source code *
|
|
|
|
|
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
|
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
|
* help@hdfgroup.org. *
|
2005-02-08 09:03:48 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
|
2005-03-11 08:31:39 +08:00
|
|
|
|
* Thursday, February 3, 2005
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: v2 B-tree testing functions.
|
2006-03-12 05:57:18 +08:00
|
|
|
|
*
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*/
|
|
|
|
|
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
/****************/
|
|
|
|
|
/* Module Setup */
|
|
|
|
|
/****************/
|
|
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
|
#include "H5B2module.h" /* This source code file is part of the H5B2 module */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
|
|
|
|
|
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
/***********/
|
|
|
|
|
/* Headers */
|
|
|
|
|
/***********/
|
2005-02-08 09:03:48 +08:00
|
|
|
|
#include "H5private.h" /* Generic Functions */
|
2006-03-12 05:57:18 +08:00
|
|
|
|
#include "H5B2pkg.h" /* v2 B-trees */
|
2005-02-26 21:05:41 +08:00
|
|
|
|
#include "H5Eprivate.h" /* Error handling */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
/****************/
|
|
|
|
|
/* Local Macros */
|
|
|
|
|
/****************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************/
|
|
|
|
|
/* Local Typedefs */
|
|
|
|
|
/******************/
|
|
|
|
|
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
/* v2 B-tree client callback context */
|
|
|
|
|
typedef struct H5B2_test_ctx_t {
|
|
|
|
|
uint8_t sizeof_size; /* Size of file sizes */
|
|
|
|
|
} H5B2_test_ctx_t;
|
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
|
2006-03-16 04:16:04 +08:00
|
|
|
|
/********************/
|
|
|
|
|
/* Package Typedefs */
|
|
|
|
|
/********************/
|
|
|
|
|
|
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
/********************/
|
|
|
|
|
/* Local Prototypes */
|
|
|
|
|
/********************/
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
/* v2 B-tree driver callbacks for 'test' B-trees */
|
2015-05-15 09:46:00 +08:00
|
|
|
|
static void *H5B2__test_crt_context(void *udata);
|
|
|
|
|
static herr_t H5B2__test_dst_context(void *ctx);
|
|
|
|
|
static herr_t H5B2__test_store(void *nrecord, const void *udata);
|
2016-02-19 04:50:37 +08:00
|
|
|
|
static herr_t H5B2__test_compare(const void *rec1, const void *rec2, int *result);
|
2015-05-15 09:46:00 +08:00
|
|
|
|
static herr_t H5B2__test_encode(uint8_t *raw, const void *nrecord, void *ctx);
|
|
|
|
|
static herr_t H5B2__test_decode(const uint8_t *raw, void *nrecord, void *ctx);
|
2015-11-21 04:24:23 +08:00
|
|
|
|
static herr_t H5B2__test_debug(FILE *stream, int indent, int fwidth,
|
|
|
|
|
const void *record, const void *_udata);
|
2015-12-30 01:06:36 +08:00
|
|
|
|
|
|
|
|
|
/* v2 B-tree driver callbacks for 'test2' B-trees */
|
|
|
|
|
static herr_t H5B2__test2_store(void *nrecord, const void *udata);
|
2016-02-19 04:50:37 +08:00
|
|
|
|
static herr_t H5B2__test2_compare(const void *rec1, const void *rec2, int *result);
|
2015-12-30 01:06:36 +08:00
|
|
|
|
static herr_t H5B2__test2_encode(uint8_t *raw, const void *nrecord, void *ctx);
|
|
|
|
|
static herr_t H5B2__test2_decode(const uint8_t *raw, void *nrecord, void *ctx);
|
|
|
|
|
static herr_t H5B2__test2_debug(FILE *stream, int indent, int fwidth,
|
|
|
|
|
const void *record, const void *_udata);
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
/*********************/
|
|
|
|
|
/* Package Variables */
|
|
|
|
|
/*********************/
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
/* Class structure for testing simple B-tree records */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */
|
2006-08-10 11:42:51 +08:00
|
|
|
|
H5B2_TEST_ID, /* Type of B-tree */
|
[svn-r17740] Description:
Refactor v2 B-tree code to take creation parameters to H5B2_create() as
a struct (instead of individual arguments), call the client's class "cls"
instead of "type" internally, and add client class name to client class struct.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-25 03:16:06 +08:00
|
|
|
|
"H5B2_TEST_ID", /* Name of B-tree class */
|
2006-08-10 11:42:51 +08:00
|
|
|
|
sizeof(hsize_t), /* Size of native record */
|
2015-05-15 09:46:00 +08:00
|
|
|
|
H5B2__test_crt_context, /* Create client callback context */
|
|
|
|
|
H5B2__test_dst_context, /* Destroy client callback context */
|
|
|
|
|
H5B2__test_store, /* Record storage callback */
|
|
|
|
|
H5B2__test_compare, /* Record comparison callback */
|
|
|
|
|
H5B2__test_encode, /* Record encoding callback */
|
|
|
|
|
H5B2__test_decode, /* Record decoding callback */
|
2015-12-30 01:06:36 +08:00
|
|
|
|
H5B2__test_debug /* Record debugging callback */
|
|
|
|
|
}};
|
|
|
|
|
|
|
|
|
|
/* Class structure for testing key/value B-tree records */
|
|
|
|
|
const H5B2_class_t H5B2_TEST2[1]={{ /* B-tree class information */
|
|
|
|
|
H5B2_TEST2_ID, /* Type of B-tree */
|
|
|
|
|
"H5B2_TEST2_ID", /* Name of B-tree class */
|
|
|
|
|
sizeof(H5B2_test_rec_t), /* Size of native record */
|
|
|
|
|
H5B2__test_crt_context, /* Create client callback context */
|
|
|
|
|
H5B2__test_dst_context, /* Destroy client callback context */
|
|
|
|
|
H5B2__test2_store, /* Record storage callback */
|
|
|
|
|
H5B2__test2_compare, /* Record comparison callback */
|
|
|
|
|
H5B2__test2_encode, /* Record encoding callback */
|
|
|
|
|
H5B2__test2_decode, /* Record decoding callback */
|
|
|
|
|
H5B2__test2_debug /* Record debugging callback */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
}};
|
|
|
|
|
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
2006-02-27 11:30:22 +08:00
|
|
|
|
/*****************************/
|
|
|
|
|
/* Library Private Variables */
|
|
|
|
|
/*****************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************/
|
|
|
|
|
/* Local Variables */
|
|
|
|
|
/*******************/
|
|
|
|
|
|
[svn-r17785] Description:
Further refactor v2 B-tree code to bring it closer to modern data
structure designed in the library, mainly by introducing a H5B2_t type so that
the v2 B-tree could be held open, but not require the B-tree header to be
protected the whole time. A few other minor tweaks as well.
Also, remove unused 'dirty' flag from fractal heap header.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-29 21:58:52 +08:00
|
|
|
|
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
/* Declare a free list to manage the H5B2_test_ctx_t struct */
|
|
|
|
|
H5FL_DEFINE_STATIC(H5B2_test_ctx_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_crt_context
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Create client callback context
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-NULL
|
|
|
|
|
* Failure: NULL
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, November 26, 2009
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static void *
|
2015-05-15 09:46:00 +08:00
|
|
|
|
H5B2__test_crt_context(void *_f)
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
{
|
|
|
|
|
H5F_t *f = (H5F_t *)_f; /* User data for building callback context */
|
|
|
|
|
H5B2_test_ctx_t *ctx; /* Callback context structure */
|
2015-09-14 11:58:59 +08:00
|
|
|
|
void *ret_value = NULL; /* Return value */
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
|
|
|
|
|
/* Sanity check */
|
|
|
|
|
HDassert(f);
|
|
|
|
|
|
|
|
|
|
/* Allocate callback context */
|
|
|
|
|
if(NULL == (ctx = H5FL_MALLOC(H5B2_test_ctx_t)))
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate callback context")
|
|
|
|
|
|
|
|
|
|
/* Determine the size of lengths in the file */
|
|
|
|
|
ctx->sizeof_size = H5F_SIZEOF_SIZE(f);
|
|
|
|
|
|
|
|
|
|
/* Set return value */
|
|
|
|
|
ret_value = ctx;
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_crt_context() */
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_dst_context
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Destroy client callback context
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, November 26, 2009
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-05-15 09:46:00 +08:00
|
|
|
|
H5B2__test_dst_context(void *_ctx)
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
{
|
|
|
|
|
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
|
|
|
|
|
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
|
|
|
|
|
/* Sanity check */
|
|
|
|
|
HDassert(ctx);
|
|
|
|
|
|
|
|
|
|
/* Release callback context */
|
|
|
|
|
ctx = H5FL_FREE(H5B2_test_ctx_t, ctx);
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_dst_context() */
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_store
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Store native information into record for B-tree
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, February 3, 2005
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-05-15 09:46:00 +08:00
|
|
|
|
H5B2__test_store(void *nrecord, const void *udata)
|
2005-02-08 09:03:48 +08:00
|
|
|
|
{
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2006-03-12 05:57:18 +08:00
|
|
|
|
*(hsize_t *)nrecord = *(const hsize_t *)udata;
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2006-03-12 05:57:18 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_store() */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_compare
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Compare two native information records, according to some key
|
|
|
|
|
*
|
|
|
|
|
* Return: <0 if rec1 < rec2
|
|
|
|
|
* =0 if rec1 == rec2
|
|
|
|
|
* >0 if rec1 > rec2
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, February 3, 2005
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2016-02-19 04:50:37 +08:00
|
|
|
|
H5B2__test_compare(const void *rec1, const void *rec2, int *result)
|
2005-02-08 09:03:48 +08:00
|
|
|
|
{
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2016-02-19 04:50:37 +08:00
|
|
|
|
*result = (int)(*(const hssize_t *)rec1 - *(const hssize_t *)rec2);
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_compare() */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_encode
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Encode native information into raw form for storing on disk
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, February 3, 2005
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-05-15 09:46:00 +08:00
|
|
|
|
H5B2__test_encode(uint8_t *raw, const void *nrecord, void *_ctx)
|
2005-02-08 09:03:48 +08:00
|
|
|
|
{
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
|
|
|
|
|
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
/* Sanity check */
|
|
|
|
|
HDassert(ctx);
|
|
|
|
|
|
|
|
|
|
H5F_ENCODE_LENGTH_LEN(raw, *(const hsize_t *)nrecord, ctx->sizeof_size);
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2006-03-12 05:57:18 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_encode() */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_decode
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Decode raw disk form of record into native form
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Friday, February 4, 2005
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-05-15 09:46:00 +08:00
|
|
|
|
H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx)
|
2005-02-08 09:03:48 +08:00
|
|
|
|
{
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
|
|
|
|
|
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback
context provided to the encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-02 00:45:27 +08:00
|
|
|
|
/* Sanity check */
|
|
|
|
|
HDassert(ctx);
|
|
|
|
|
|
|
|
|
|
H5F_DECODE_LENGTH_LEN(raw, *(hsize_t *)nrecord, ctx->sizeof_size);
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2006-03-12 05:57:18 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_decode() */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-05-15 09:46:00 +08:00
|
|
|
|
* Function: H5B2__test_debug
|
2005-02-08 09:03:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Debug native form of record
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Friday, February 4, 2005
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-11-21 04:24:23 +08:00
|
|
|
|
H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record,
|
|
|
|
|
const void H5_ATTR_UNUSED *_udata)
|
2005-02-08 09:03:48 +08:00
|
|
|
|
{
|
2015-05-15 09:46:00 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2015-08-22 11:08:43 +08:00
|
|
|
|
HDassert(record);
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Record:",
|
|
|
|
|
*(const hsize_t *)record);
|
|
|
|
|
|
2006-03-12 05:57:18 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-05-15 09:46:00 +08:00
|
|
|
|
} /* H5B2__test_debug() */
|
2005-02-08 09:03:48 +08:00
|
|
|
|
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-12-30 01:06:36 +08:00
|
|
|
|
* Function: H5B2__test2_store
|
2015-11-21 04:24:23 +08:00
|
|
|
|
*
|
2015-12-30 01:06:36 +08:00
|
|
|
|
* Purpose: Store native information into record for B-tree
|
2015-11-21 04:24:23 +08:00
|
|
|
|
*
|
2015-12-30 01:06:36 +08:00
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
2015-11-21 04:24:23 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
2015-12-30 01:06:36 +08:00
|
|
|
|
* Friday, December 25, 2015
|
2015-11-21 04:24:23 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2015-12-30 01:06:36 +08:00
|
|
|
|
static herr_t
|
|
|
|
|
H5B2__test2_store(void *nrecord, const void *udata)
|
2015-11-21 04:24:23 +08:00
|
|
|
|
{
|
2015-12-30 01:06:36 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
*(H5B2_test_rec_t *)nrecord = *(const H5B2_test_rec_t *)udata;
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* H5B2__test2_store() */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5B2__test2_compare
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Compare two native information records, according to some key
|
|
|
|
|
*
|
|
|
|
|
* Return: <0 if rec1 < rec2
|
|
|
|
|
* =0 if rec1 == rec2
|
|
|
|
|
* >0 if rec1 > rec2
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Friday, December 25, 2015
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2016-02-19 04:50:37 +08:00
|
|
|
|
H5B2__test2_compare(const void *rec1, const void *rec2, int *result)
|
2015-12-30 01:06:36 +08:00
|
|
|
|
{
|
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
|
|
|
|
|
2016-02-19 04:50:37 +08:00
|
|
|
|
*result = (int)(((const H5B2_test_rec_t *)rec1)->key - ((const H5B2_test_rec_t *)rec2)->key);
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2015-12-30 01:06:36 +08:00
|
|
|
|
} /* H5B2__test2_compare() */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5B2__test2_encode
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Encode native information into raw form for storing on disk
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Friday, December 25, 2015
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
|
|
|
|
H5B2__test2_encode(uint8_t *raw, const void *nrecord, void *_ctx)
|
|
|
|
|
{
|
|
|
|
|
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
|
|
|
|
|
|
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
|
|
|
|
/* Sanity check */
|
2015-12-30 01:06:36 +08:00
|
|
|
|
HDassert(ctx);
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
H5F_ENCODE_LENGTH_LEN(raw, ((const H5B2_test_rec_t *)nrecord)->key, ctx->sizeof_size);
|
|
|
|
|
H5F_ENCODE_LENGTH_LEN(raw, ((const H5B2_test_rec_t *)nrecord)->val, ctx->sizeof_size);
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* H5B2__test2_encode() */
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5B2__test2_decode
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Decode raw disk form of record into native form
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Friday, December 25, 2015
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
|
|
|
|
H5B2__test2_decode(const uint8_t *raw, void *nrecord, void *_ctx)
|
|
|
|
|
{
|
|
|
|
|
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
2015-12-30 01:06:36 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
|
|
|
|
|
|
|
|
|
/* Sanity check */
|
|
|
|
|
HDassert(ctx);
|
|
|
|
|
|
|
|
|
|
H5F_DECODE_LENGTH_LEN(raw, ((H5B2_test_rec_t *)nrecord)->key, ctx->sizeof_size);
|
|
|
|
|
H5F_DECODE_LENGTH_LEN(raw, ((H5B2_test_rec_t *)nrecord)->val, ctx->sizeof_size);
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* H5B2__test2_decode() */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5B2__test2_debug
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Debug native form of record
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: non-negative
|
|
|
|
|
* Failure: negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Friday, December 25, 2015
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
|
|
|
|
H5B2__test2_debug(FILE *stream, int indent, int fwidth, const void *record,
|
|
|
|
|
const void H5_ATTR_UNUSED *_udata)
|
|
|
|
|
{
|
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
|
|
|
|
|
|
|
|
|
HDassert(record);
|
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s (%Hu, %Hu)\n", indent, "", fwidth, "Record:",
|
|
|
|
|
((const H5B2_test_rec_t *)record)->key,
|
|
|
|
|
((const H5B2_test_rec_t *)record)->val);
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* H5B2__test2_debug() */
|
2015-11-21 04:24:23 +08:00
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Function: H5B2__get_root_addr_test
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Purpose: Retrieve the root node's address
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Return: SUCCEED/FAIL
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Saturday, February 26, 2005
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
herr_t
|
2018-05-30 05:06:01 +08:00
|
|
|
|
H5B2__get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr)
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
{
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
|
|
|
|
|
/* Check arguments. */
|
|
|
|
|
HDassert(bt2);
|
|
|
|
|
HDassert(root_addr);
|
|
|
|
|
|
|
|
|
|
/* Get B-tree root addr */
|
|
|
|
|
*root_addr = bt2->hdr->root.addr;
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2018-05-30 05:06:01 +08:00
|
|
|
|
} /* H5B2__get_root_addr_test() */
|
2005-02-26 21:05:41 +08:00
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Function: H5B2__get_node_info_test
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Purpose: Determine information about a node holding a record in the B-tree
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Return: SUCCEED/FAIL
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, August 31, 2006
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
herr_t
|
2018-03-16 05:54:30 +08:00
|
|
|
|
H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo)
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
{
|
|
|
|
|
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
|
|
|
|
|
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
|
2016-12-03 00:07:04 +08:00
|
|
|
|
void *parent = NULL; /* Parent of current node */
|
2015-05-15 09:46:00 +08:00
|
|
|
|
uint16_t depth; /* Current depth of the tree */
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
int cmp; /* Comparison value of records */
|
|
|
|
|
unsigned idx; /* Location of record which matches key */
|
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
|
|
|
|
|
2018-03-16 05:54:30 +08:00
|
|
|
|
FUNC_ENTER_PACKAGE
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
|
|
|
|
|
/* Check arguments. */
|
|
|
|
|
HDassert(bt2);
|
|
|
|
|
|
|
|
|
|
/* Set the shared v2 B-tree header's file context for this operation */
|
|
|
|
|
bt2->hdr->f = bt2->f;
|
|
|
|
|
|
|
|
|
|
/* Get the v2 B-tree header */
|
|
|
|
|
hdr = bt2->hdr;
|
|
|
|
|
|
|
|
|
|
/* Make copy of the root node pointer to start search with */
|
|
|
|
|
curr_node_ptr = hdr->root;
|
|
|
|
|
|
2016-12-03 00:07:04 +08:00
|
|
|
|
/* Set initial parent, if doing swmr writes */
|
|
|
|
|
if(hdr->swmr_write)
|
|
|
|
|
parent = hdr;
|
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
/* Current depth of the tree */
|
|
|
|
|
depth = hdr->depth;
|
|
|
|
|
|
|
|
|
|
/* Check for empty tree */
|
|
|
|
|
if(0 == curr_node_ptr.node_nrec)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree has no records")
|
|
|
|
|
|
|
|
|
|
/* Walk down B-tree to find record or leaf node where record is located */
|
|
|
|
|
cmp = -1;
|
|
|
|
|
while(depth > 0 && cmp != 0) {
|
|
|
|
|
H5B2_internal_t *internal; /* Pointer to internal node in B-tree */
|
|
|
|
|
H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */
|
|
|
|
|
|
|
|
|
|
/* Lock B-tree current node */
|
2018-03-16 05:54:30 +08:00
|
|
|
|
if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG)))
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
|
|
|
|
|
|
2016-12-03 00:07:04 +08:00
|
|
|
|
/* Unpin parent if necessary */
|
|
|
|
|
if(parent) {
|
|
|
|
|
if(parent != hdr && H5AC_unpin_entry(parent) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry")
|
|
|
|
|
parent = NULL;
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
/* Locate node pointer for child */
|
2016-02-19 04:50:37 +08:00
|
|
|
|
if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native,
|
|
|
|
|
udata, &idx, &cmp) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
|
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
if(cmp > 0)
|
|
|
|
|
idx++;
|
|
|
|
|
|
|
|
|
|
if(cmp != 0) {
|
|
|
|
|
/* Get node pointer for next node to search */
|
|
|
|
|
next_node_ptr = internal->node_ptrs[idx];
|
|
|
|
|
|
|
|
|
|
/* Unlock current node */
|
2018-03-16 05:54:30 +08:00
|
|
|
|
if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0)
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
|
|
|
|
|
|
2016-12-03 00:07:04 +08:00
|
|
|
|
/* Keep track of parent if necessary */
|
|
|
|
|
if(hdr->swmr_write)
|
|
|
|
|
parent = internal;
|
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
/* Set pointer to next node to load */
|
|
|
|
|
curr_node_ptr = next_node_ptr;
|
|
|
|
|
} /* end if */
|
|
|
|
|
else {
|
|
|
|
|
/* Unlock current node */
|
2018-03-16 05:54:30 +08:00
|
|
|
|
if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0)
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
|
|
|
|
|
|
|
|
|
|
/* Fill in information about the node */
|
|
|
|
|
ninfo->depth = depth;
|
|
|
|
|
ninfo->nrec = curr_node_ptr.node_nrec;
|
|
|
|
|
|
|
|
|
|
/* Indicate success */
|
|
|
|
|
HGOTO_DONE(SUCCEED)
|
|
|
|
|
} /* end else */
|
|
|
|
|
|
|
|
|
|
/* Decrement depth we're at in B-tree */
|
|
|
|
|
depth--;
|
|
|
|
|
} /* end while */
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */
|
|
|
|
|
|
|
|
|
|
/* Lock B-tree leaf node */
|
2018-03-16 05:54:30 +08:00
|
|
|
|
if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG)))
|
[svn-r18702] Description:
Bring r18672 from metadata journaling "merging" branch to trunk:
Mostly changes to move to only using one 'user data' parameter for
calls to H5AC_protect(), along with some minor reformatting code cleanups.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-05-05 21:39:56 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
|
2016-12-03 00:07:04 +08:00
|
|
|
|
/* Unpin parent if necessary */
|
|
|
|
|
if(parent) {
|
|
|
|
|
if(parent != hdr && H5AC_unpin_entry(parent) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry")
|
|
|
|
|
parent = NULL;
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
/* Locate record */
|
2016-02-19 04:50:37 +08:00
|
|
|
|
if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native,
|
|
|
|
|
udata, &idx, &cmp) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
|
|
|
|
|
/* Unlock current node */
|
2018-03-16 05:54:30 +08:00
|
|
|
|
if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0)
|
[svn-r17848] Description:
Further refactoring v2 B-trees so that they can get context to the
encode/decode client callbacks:
- Switch tests to using refactored routines
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-07 21:12:06 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
|
|
|
|
|
|
|
|
|
|
/* Indicate the depth that the record was found */
|
|
|
|
|
if(cmp != 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "record not in B-tree")
|
|
|
|
|
} /* end block */
|
|
|
|
|
|
|
|
|
|
/* Fill in information about the leaf node */
|
|
|
|
|
ninfo->depth = depth;
|
|
|
|
|
ninfo->nrec = curr_node_ptr.node_nrec;
|
|
|
|
|
|
|
|
|
|
done:
|
2016-12-03 00:07:04 +08:00
|
|
|
|
if(parent) {
|
|
|
|
|
HDassert(ret_value < 0);
|
|
|
|
|
if(parent != hdr && H5AC_unpin_entry(parent) < 0)
|
|
|
|
|
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry")
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
2006-09-05 00:37:41 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2018-03-16 05:54:30 +08:00
|
|
|
|
} /* H5B2__get_node_info_test() */
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Function: H5B2__get_node_depth_test
|
2006-09-05 00:37:41 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Purpose: Determine the depth of a node holding a record in the B-tree
|
2006-09-05 00:37:41 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Note: Just a simple wrapper around the H5B2__get_node_info_test() routine
|
2006-09-05 00:37:41 +08:00
|
|
|
|
*
|
2018-05-30 05:06:01 +08:00
|
|
|
|
* Return: Success: Non-negative depth of the node where the record
|
|
|
|
|
* was found
|
|
|
|
|
*
|
|
|
|
|
* Failure: -1
|
2006-09-05 00:37:41 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Saturday, August 26, 2006
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
int
|
2018-03-16 05:54:30 +08:00
|
|
|
|
H5B2__get_node_depth_test(H5B2_t *bt2, void *udata)
|
2006-09-05 00:37:41 +08:00
|
|
|
|
{
|
|
|
|
|
H5B2_node_info_test_t ninfo; /* Node information */
|
2015-09-14 11:58:59 +08:00
|
|
|
|
int ret_value = -1; /* Return information */
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|
2018-03-16 05:54:30 +08:00
|
|
|
|
FUNC_ENTER_PACKAGE
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|
|
|
|
|
/* Check arguments. */
|
[svn-r17893] Descrption:
Remove old shim H5B2 routines from refactoring, rename new routines to
old routine names and switch all users of the H5B2 interface back to the old
routine names now that the switch to using the more current open -> <operation>
-> pattern is used for all the H5B2 code. This is the final change before
adding a context to the H5B2 client encode/decode callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-11-15 11:38:58 +08:00
|
|
|
|
HDassert(bt2);
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|
|
|
|
|
/* Get information abou the node */
|
2018-03-16 05:54:30 +08:00
|
|
|
|
if(H5B2__get_node_info_test(bt2, udata, &ninfo) < 0)
|
2018-05-30 05:06:01 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, (-1), "error looking up node info")
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|
|
|
|
|
/* Set return value */
|
2009-04-03 02:08:05 +08:00
|
|
|
|
ret_value = (int)ninfo.depth;
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2018-03-16 05:54:30 +08:00
|
|
|
|
} /* H5B2__get_node_depth_test() */
|
2006-09-05 00:37:41 +08:00
|
|
|
|
|