From 811ff592891dd9e02209362ac59c53af70bec2d5 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 7 Mar 2016 18:57:06 -0500 Subject: [svn-r29328] Change H5D_BT2_NODE_SIZE from 512 to 2048 for performance issue. Tested on quail, osx1010test, platypus, ostrich, kite, emu, mayll, kituo. --- hl/tools/h5watch/h5watch.c | 43 ++++++++++++++++++++++++++++--------------- src/H5Dpkg.h | 2 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 643b4e7..47fdb86 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -39,6 +39,9 @@ */ const char *progname = "h5watch"; /* tool name */ +hid_t g_fid = -1; +hid_t g_fapl = -1; + static char *g_list_of_fields = NULL; /* command line input for "list_of_fields" */ static char *g_dup_fields = NULL; /* copy of "list_of_fields" */ static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */ @@ -803,8 +806,20 @@ parse_command_line(int argc, const char *argv[]) */ static void catch_signal(int H5_ATTR_UNUSED signo) { + /* Close the file access property list */ + if(g_fapl > 0 && H5Pclose(g_fapl) < 0) { + error_msg("unable to close property list\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* Close the file */ + if(g_fid > 0 && H5Fclose(g_fid) < 0) { + error_msg("unable to close file\n"); + h5tools_setstatus(EXIT_FAILURE); + } + /* Exit from h5watch */ - leave(EXIT_SUCCESS); + leave(h5tools_getstatus()); } /* catch_signal() */ @@ -830,8 +845,6 @@ main(int argc, const char *argv[]) void *edata; H5E_auto2_t func; char *x; - hid_t fid = -1; - hid_t fapl = -1; /* Set up tool name and exit status */ h5tools_setprogname(PROGRAMNAME); @@ -887,18 +900,18 @@ main(int argc, const char *argv[]) } /* Create a copy of file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if((g_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) return -1; /* Set to use the latest library format */ - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + if(H5Pset_libver_bounds(g_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; do { while(fname && *fname) { - fid = h5tools_fopen(fname, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl, NULL, drivername, sizeof drivername); + g_fid = h5tools_fopen(fname, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, g_fapl, NULL, drivername, sizeof drivername); - if(fid >= 0) { + if(g_fid >= 0) { HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); break; /*success*/ } /* end if */ @@ -913,12 +926,12 @@ main(int argc, const char *argv[]) *dname = '\0'; } /* end while */ /* Try opening the file again if somehow unstable */ - } while(g_retry-- > 0 && fid == FAIL); + } while(g_retry-- > 0 && g_fid == FAIL); - if(fid < 0) { + if(g_fid < 0) { error_msg("unable to open file \"%s\"\n", fname); if(fname) HDfree(fname); - if(fapl >= 0) H5Pclose(fapl); + if(g_fapl >= 0) H5Pclose(g_fapl); leave(EXIT_FAILURE); } @@ -935,18 +948,18 @@ main(int argc, const char *argv[]) } else { *x = '\0'; /* Validate dataset */ - if(check_dataset(fid, dname) < 0) + if(check_dataset(g_fid, dname) < 0) h5tools_setstatus(EXIT_FAILURE); /* Validate input "fields" */ else if(g_list_of_fields && *g_list_of_fields) - if(process_cmpd_fields(fid, dname) < 0) + if(process_cmpd_fields(g_fid, dname) < 0) h5tools_setstatus(EXIT_FAILURE); } } /* If everything is fine, start monitoring the datset */ if(h5tools_getstatus() != EXIT_FAILURE) - if(monitor_dataset(fid, dname) < 0) + if(monitor_dataset(g_fid, dname) < 0) h5tools_setstatus(EXIT_FAILURE); /* Free spaces */ @@ -960,13 +973,13 @@ main(int argc, const char *argv[]) if(g_dup_fields) HDfree(g_dup_fields); /* Close the file access property list */ - if(fapl >= 0 && H5Pclose(fapl) < 0) { + if(g_fapl >= 0 && H5Pclose(g_fapl) < 0) { error_msg("unable to close file access property list\n"); h5tools_setstatus(EXIT_FAILURE); } /* Close the file */ - if(H5Fclose(fid) < 0) { + if(H5Fclose(g_fid) < 0) { error_msg("unable to close file\n"); h5tools_setstatus(EXIT_FAILURE); } diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 62497fe..215f034 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -85,7 +85,7 @@ /* v2 B-tree creation values for raw meta_size */ #define H5D_BT2_CREATE_PARAM_SIZE 6 /* Size of the creation parameters in bytes */ -#define H5D_BT2_NODE_SIZE 512 +#define H5D_BT2_NODE_SIZE 2048 #define H5D_BT2_SPLIT_PERC 100 #define H5D_BT2_MERGE_PERC 40 -- cgit v0.12