Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMP: for compiling with perf enhancements #59

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fd38b4d
COMP: for compiling with perf enhancements
stnava Sep 4, 2018
4afbf73
COMP: for compiling with perf enhancements
stnava Sep 4, 2018
f44174c
COMP: for compiling with perf enhancements - forgot file add
stnava Sep 4, 2018
ccd1d4e
trying to get a windows build to work
muschellij2 Oct 1, 2018
e84f2b1
merged with stnava
muschellij2 Oct 1, 2018
41fb22d
Merged with upstream ITK
muschellij2 Oct 9, 2018
a9f5c6f
Merged with Insight UPstream
muschellij2 Oct 10, 2018
6adf864
COMP: for compiling with perf enhancements
stnava Sep 4, 2018
9b2fff2
COMP: for compiling with perf enhancements - forgot file add
stnava Sep 4, 2018
e8010f4
Merge branch 'master' of https://github.com/stnava/ITK
stnava Oct 11, 2018
abc43ba
Merging with stnava
muschellij2 Oct 11, 2018
0e4fa23
Merging with ITK full branch
muschellij2 Oct 11, 2018
e820b29
Merge branch 'master' of https://itk.org/ITK
stnava Oct 13, 2018
8b2880e
Merging with ITK main
muschellij2 Oct 17, 2018
2c571cb
STYLE: remove annoying warnings
stnava Oct 17, 2018
0a7cfd3
Merge branch 'master' of https://itk.org/ITK
stnava Oct 17, 2018
e58141e
BUG: undo bad attempt at h5 fix
stnava Oct 17, 2018
a7944c2
Merge branch 'master' of https://itk.org/ITK
stnava Oct 17, 2018
f397baa
Merged with the up<BS> branch 'upstream/master'
muschellij2 Oct 17, 2018
a8eb21f
trying to get with ITK
muschellij2 Oct 17, 2018
66e7226
Merge branch 'master' of https://itk.org/ITK
stnava Oct 18, 2018
20a456c
Merge branch 'master' of https://itk.org/ITK
stnava Oct 18, 2018
8745264
merging with stnava
muschellij2 Oct 18, 2018
dc8765d
Merge pull request #1 from muschellij2/master
stnava Oct 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Modules/ThirdParty/HDF5/src/itkhdf5/src/H5F.c
Expand Up @@ -505,8 +505,8 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")

/* Open the file */
if(NULL == (new_file = H5F__open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file")
if(NULL == (new_file = H5F__open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file")

/* Get an atom for the file */
if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0)
Expand Down Expand Up @@ -1451,7 +1451,7 @@ H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled,
* Function: H5Fset_libver_bounds
*
* Purpose: Set to a different low and high bounds while a file is open.
* This public routine is introduced in place of
* This public routine is introduced in place of
* H5Fset_latest_format() starting release 1.10.2.
* See explanation for H5Fset_latest_format() in H5Fdeprec.c.
*
Expand Down
7 changes: 3 additions & 4 deletions Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fint.c
Expand Up @@ -1396,7 +1396,7 @@ H5F__open(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
HDassert(filename);

/* Open the file */
if(NULL == (ret_value = H5F_open(filename, flags, fcpl_id, fapl_id)))
if(NULL == (ret_value = H5F_open(filename, flags, fcpl_id, fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file")

done:
Expand Down Expand Up @@ -1696,8 +1696,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
} /* end if */
else if (1 == shared->nrefs) {
/* Read the superblock if it hasn't been read before. */
if(H5F__super_read(file, a_plist, TRUE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
if(H5F__super_read(file, a_plist, TRUE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")

/* Create the page buffer before initializing the superblock */
if(page_buf_size)
Expand Down Expand Up @@ -3684,4 +3684,3 @@ H5F__format_convert(H5F_t *f)
done:
FUNC_LEAVE_NOAPI_VOL(ret_value)
} /* H5F__format_convert() */

85 changes: 42 additions & 43 deletions Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fsuper.c
Expand Up @@ -227,10 +227,10 @@ H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created)
/*-------------------------------------------------------------------------
* Function: H5F__update_super_ext_driver_msg
*
* Purpose: Update the superblock extension file driver info message if
* Purpose: Update the superblock extension file driver info message if
* we are using a V 2 superblock. Observe that the function
* is a NO-OP if the file driver info message does not exist.
* This is necessary, as the function is called whenever the
* This is necessary, as the function is called whenever the
* EOA is updated, and were it to create the file driver info
* message, it would find itself in an infinite recursion.
*
Expand Down Expand Up @@ -270,8 +270,8 @@ H5F__update_super_ext_driver_msg(H5F_t *f)
/* Check for driver info */
H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t);

/* Nothing to do unless there is both driver info and
* the driver info superblock extension message has
/* Nothing to do unless there is both driver info and
* the driver info superblock extension message has
* already been created.
*/
if(driver_size > 0) {
Expand All @@ -287,7 +287,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f)

/* Write the message to the superblock extension.
*
* Note that the superblock extension and the
* Note that the superblock extension and the
* file driver info message must already exist.
*/
drvinfo.len = driver_size;
Expand Down Expand Up @@ -342,7 +342,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG)

/* initialize the drvinfo to NULL -- we will overwrite this if there
* is a driver information block
* is a driver information block
*/
f->shared->drvinfo = NULL;

Expand Down Expand Up @@ -407,8 +407,8 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
#ifdef H5_HAVE_PARALLEL
} /* end else */
#endif /* H5_HAVE_PARALLEL */
if(!H5F_addr_defined(super_addr))
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found")
if(!H5F_addr_defined(super_addr))
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found")

/* Check for userblock present */
if(H5F_addr_gt(super_addr, 0)) {
Expand All @@ -434,7 +434,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "can't get property list")

/* Make certain we can read the fixed-size portion of the superblock */
if(H5F__set_eoa(f, H5FD_MEM_SUPER,
if(H5F__set_eoa(f, H5FD_MEM_SUPER,
(haddr_t)(H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "set end of space allocation request failed")

Expand All @@ -454,12 +454,12 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags)))
HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock")

/*
/*
* When opening a file with SWMR-write access, the library will first
* check to ensure that superblock version 3 is used. Otherwise fail
* check to ensure that superblock version 3 is used. Otherwise fail
* file open.
*
* Then the library will upgrade the file's low_bound depending on
* Then the library will upgrade the file's low_bound depending on
* superblock version as follows:
* --version 0 or 1: no change to low_bound
* --version 2: upgrade low_bound to at least V18
Expand Down Expand Up @@ -592,8 +592,8 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
* as the file can appear truncated if only part of it has been
* been flushed to disk by the SWMR writer process.
*/
/* The EOF check is also skipped when the private property
* H5F_ACS_SKIP_EOF_CHECK_NAME exists in the fapl.
/* The EOF check is also skipped when the private property
* H5F_ACS_SKIP_EOF_CHECK_NAME exists in the fapl.
* This property is enabled by the tool h5clear with these
* two options: (1) --filesize (2) --increment
*/
Expand All @@ -604,7 +604,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get skip EOF check value")

if(H5F_INTENT(f) & H5F_ACC_SWMR_READ) {
/*
/*
* When the file is opened for SWMR read access, skip the check if:
* --the file is already marked for SWMR writing and
* --the file has version 3 superblock for SWMR support
Expand Down Expand Up @@ -646,10 +646,10 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
drvrinfo_udata.f = f;
drvrinfo_udata.driver_addr = sblock->driver_addr;

/* extend EOA so we can read at least the fixed sized
* portion of the driver info block
/* extend EOA so we can read at least the fixed sized
* portion of the driver info block
*/
if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) /* will extend eoa later if required */
if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) /* will extend eoa later if required */
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "set end of space allocation request failed")

/* Look up the driver info block */
Expand All @@ -662,7 +662,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
if(((rw_flags & H5AC__READ_ONLY_FLAG) == 0) && H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_DRVRINFO_LOAD))
drvinfo_flags |= H5AC__DIRTIED_FLAG;

/* set the pin entry flag so that the driver information block
/* set the pin entry flag so that the driver information block
* cache entry will be pinned in the cache.
*/
drvinfo_flags |= H5AC__PIN_ENTRY_FLAG;
Expand Down Expand Up @@ -840,7 +840,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)

/* As "eoa_pre_fsm_fsalloc" may be undefined for a crashed file
* with persistent free space managers, therefore, set
* "first_alloc_dealloc" when the condition
* "first_alloc_dealloc" when the condition
* "dropping free-space to the floor is true.
* This will ensure that no action is done to settle things on file
* close via H5MF_settle_meta_data_fsm() and H5MF_settle_raw_data_fsm().
Expand All @@ -854,9 +854,9 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
f->shared->fs_addr[u] = fsinfo.fs_addr[u - 1];

/* If the following two conditions are true:
* (1) file is persisting free-space
* (1) file is persisting free-space
* (2) dropping free-space to the floor (null_fsm_addr)
* nullify the addresses of the FSMs
* nullify the addresses of the FSMs
*/
if(f->shared->fs_persist && null_fsm_addr)
for(u = 0; u < NELMTS(fsinfo.fs_addr); u++)
Expand All @@ -871,7 +871,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */
/* KLUGE ALERT!!
*
* H5F__super_ext_write_msg() expects f->shared->sblock to
* H5F__super_ext_write_msg() expects f->shared->sblock to
* be set -- verify that it is NULL, and then set it.
* Set it back to NULL when we are done.
*/
Expand Down Expand Up @@ -908,12 +908,12 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
/* if the metadata cache image superblock extension message exists,
* read its contents and pass the data on to the metadata cache.
* Given this data, the cache will load and decode the metadata
* cache image block, decoded it and load its contents into the
* the cache on the test protect call.
* cache image block, decoded it and load its contents into the
* the cache on the test protect call.
*
* Further, if the file is opened R/W, the metadata cache will
* Further, if the file is opened R/W, the metadata cache will
* delete the metadata cache image superblock extension and free
* the cache image block. Don't do this now as f->shared
* the cache image block. Don't do this now as f->shared
* is not fully setup, which complicates matters.
*/

Expand Down Expand Up @@ -964,7 +964,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */
/* KLUGE ALERT!!
*
* H5F__super_ext_write_msg() expects f->shared->sblock to
* H5F__super_ext_write_msg() expects f->shared->sblock to
* be set -- verify that it is NULL, and then set it.
* Set it back to NULL when we are done.
*/
Expand Down Expand Up @@ -1008,10 +1008,10 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
if(sblock && H5AC_unprotect(f, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock")

/* If we have failed, make sure no entries are left in the
/* If we have failed, make sure no entries are left in the
* metadata cache, so that it can be shut down and discarded.
*/
if(ret_value < 0) {
if(ret_value < 0) {
/* Unpin and discard drvinfo cache entry */
if(f->shared->drvinfo) {
if(H5AC_unpin_entry(f->shared->drvinfo) < 0)
Expand Down Expand Up @@ -1104,7 +1104,7 @@ H5F__super_init(H5F_t *f)
f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF))
non_default_fs_settings = TRUE;

/*
/*
* When creating a file with write access, the library will:
* -- set superblock version to 0, 1 or 2 based on feature enabled
* -- no change to low_bound
Expand All @@ -1113,9 +1113,9 @@ H5F__super_init(H5F_t *f)
* -- set superblock version to 3
* -- upgrade low_bound to at least V110
*
* Then the library will finalize superblock version to that allowed by
* Then the library will finalize superblock version to that allowed by
* low_bound if that is higher.
* Lastly, the library will check to ensure the superblock version does not
* Lastly, the library will check to ensure the superblock version does not
* exceed the version allowed by high_bound. Otherwise fail file open.
*
* For details, please see RFC:Setting Bounds for Object Creation in HDF5 1.10.0.
Expand All @@ -1125,12 +1125,12 @@ H5F__super_init(H5F_t *f)
* the status_flags field in the superblock. The problem is discussed in
* jira issue SWMR-79 and also in the RFC: File Format Changes in HDF5 1.10.0.
* The file's low_bound is upgraded for SWMR so that the library will
* use the best format versions available in 1.10.
* Due to the possible upgrade, the fapl returned from H5Fget_access_plist()
* use the best format versions available in 1.10.
* Due to the possible upgrade, the fapl returned from H5Fget_access_plist()
* might indicate a low_bound higher than what the user originally set.
*/

/*
/*
* Creating a file with SWMR-write access will
* upgrade superblock version and low_bound
*/
Expand All @@ -1141,10 +1141,10 @@ H5F__super_init(H5F_t *f)
/* Bump superblock version to create superblock extension for SOHM info */
} else if(f->shared->sohm_nindexes > 0)
super_vers = HDF5_SUPERBLOCK_VERSION_2;
/*
/*
* Bump superblock version to create superblock extension for:
* -- non-default file space strategy or
* -- non-default persisting free-space or
* -- non-default file space strategy or
* -- non-default persisting free-space or
* -- non-default free-space threshold or
* -- non-default page_size
*/
Expand Down Expand Up @@ -1221,7 +1221,7 @@ H5F__super_init(H5F_t *f)
/* Compute the size of the driver information block */
H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t);

/* The following code sets driver_size to the valued needed
/* The following code sets driver_size to the valued needed
* for the driver info block, and sets the driver info block
* address regardless of the version of the superblock.
*/
Expand Down Expand Up @@ -1494,8 +1494,8 @@ H5F_eoa_dirty(H5F_t *f)
if(H5F_super_dirty(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty")

/* If the driver information block exists, mark it dirty as well
* so that the change in eoa will be reflected there as well if
/* If the driver information block exists, mark it dirty as well
* so that the change in eoa will be reflected there as well if
* appropriate.
*/
if(f->shared->drvinfo) {
Expand Down Expand Up @@ -1799,4 +1799,3 @@ H5F__super_ext_remove_msg(H5F_t *f, unsigned id)

FUNC_LEAVE_NOAPI(ret_value)
} /* H5F__super_ext_remove_msg() */

18 changes: 10 additions & 8 deletions Modules/ThirdParty/HDF5/src/itkhdf5/src/H5win32defs.h 100644 → 100755
Expand Up @@ -47,14 +47,6 @@ typedef __int64 h5_stat_size_t;
#define HDmkdir(S,M) _mkdir(S)
#define HDnanosleep(N, O) Wnanosleep(N, O)
#define HDoff_t __int64
/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
* transformations when performing I/O. Note that this will
* produce Unix-style text files, though.
*
* Also note that the variadic macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.
*/
#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
#define HDread(F,M,Z) _read(F,M,Z)
#define HDrmdir(S) _rmdir(S)
#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
Expand All @@ -68,6 +60,15 @@ typedef __int64 h5_stat_size_t;

#ifdef H5_HAVE_VISUAL_STUDIO

/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
* transformations when performing I/O. Note that this will
* produce Unix-style text files, though.
*
* Also note that the variadic macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.
*/
#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)

#if (_MSC_VER < 1800)
#ifndef H5_HAVE_STRTOLL
#define HDstrtoll(S,R,N) _strtoi64(S,R,N)
Expand Down Expand Up @@ -150,6 +151,7 @@ extern "C" {
#define HDpthread_self_ulong() ((unsigned long)GetCurrentThreadId())

#ifndef H5_HAVE_MINGW
#define HDopen(S,F,M) _open(S, F | _O_BINARY, M)
#define HDftruncate(F,L) _chsize_s(F,L)
#define HDfseek(F,O,W) _fseeki64(F,O,W)
#endif /* H5_HAVE_MINGW */
Expand Down