[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Copyright by The HDF Group. *
|
|
|
|
* 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 *
|
2021-02-17 22:52:04 +08:00
|
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
2017-04-18 03:32:16 +08:00
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
* help@hdfgroup.org. *
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
#include "hdf5.h"
|
2017-03-14 12:30:37 +08:00
|
|
|
#include <assert.h>
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define NELMTS(X) (sizeof(X) / sizeof(X[0])) /* # of elements */
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
|
|
|
|
const char *FILENAMES[] = {
|
2020-09-30 22:27:10 +08:00
|
|
|
"fsm_aggr_nopersist.h5", /* H5F_FSPACE_STRATEGY_FSM_AGGR + not persisting free-space */
|
|
|
|
"fsm_aggr_persist.h5", /* H5F_FSPACE_STRATEGY_FSM_AGGR + persisting free-space */
|
|
|
|
"paged_nopersist.h5", /* H5F_FSPACE_STRATEGY_PAGE + not persisting free-space */
|
|
|
|
"paged_persist.h5", /* H5F_FSPACE_STRATEGY_PAGE + persisting free-space */
|
|
|
|
"aggr.h5", /* H5F_FSPACE_STRATEGY_AGGR */
|
|
|
|
"none.h5" /* H5F_FSPACE_STRATEGY_NONE */
|
2010-01-30 12:29:13 +08:00
|
|
|
};
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define DATASET "dset"
|
|
|
|
#define NUM_ELMTS 100
|
|
|
|
#define FALSE 0
|
|
|
|
#define TRUE 1
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
|
|
|
|
/*
|
2017-03-14 12:30:37 +08:00
|
|
|
* Compile and run this program in the trunk to generate
|
|
|
|
* HDF5 files with combinations of 4 file space strategies
|
|
|
|
* and persist/not persist free-space.
|
|
|
|
* The library creates the file space info message with "mark if unknown"
|
|
|
|
* in these files.
|
|
|
|
*
|
|
|
|
* Move these files to 1.8 branch for compatibility testing:
|
|
|
|
* test_filespace_compatible() in test/tfile.c will use these files.
|
|
|
|
*
|
2020-04-21 07:12:00 +08:00
|
|
|
* Copy these files from the 1.8 branch back to the trunk for
|
2017-03-14 12:30:37 +08:00
|
|
|
* compatibility testing via test_filespace_round_compatible() in test/tfile.c.
|
|
|
|
*
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
int
|
|
|
|
main(void)
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t fid = -1; /* File ID */
|
|
|
|
hid_t fcpl = -1; /* File creation property list */
|
|
|
|
hid_t did = -1; /* Dataset ID */
|
|
|
|
hid_t sid = -1; /* Dataspace ID */
|
|
|
|
hsize_t dim[1]; /* Dimension sizes */
|
|
|
|
int data[NUM_ELMTS]; /* Buffer for data */
|
|
|
|
int i, j; /* Local index variables */
|
|
|
|
H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */
|
|
|
|
unsigned fs_persist; /* Persisting free-space or not */
|
2017-03-14 12:30:37 +08:00
|
|
|
|
|
|
|
j = 0;
|
2020-09-30 22:27:10 +08:00
|
|
|
for (fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_strategy < H5F_FSPACE_STRATEGY_NTYPES;
|
|
|
|
fs_strategy++) {
|
|
|
|
for (fs_persist = FALSE; fs_persist <= TRUE; fs_persist++) {
|
2017-03-14 12:30:37 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (fs_persist && fs_strategy >= H5F_FSPACE_STRATEGY_AGGR)
|
2017-03-14 12:30:37 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Get a copy of the default file creation property */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Pset_file_space_strategy(fcpl, fs_strategy, fs_persist, (hsize_t)1) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Create the file with the file space info */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((fid = H5Fcreate(FILENAMES[j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Create the dataset */
|
|
|
|
dim[0] = NUM_ELMTS;
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((sid = H5Screate_simple(1, dim, NULL)) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
|
|
|
|
0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < NUM_ELMTS; i++)
|
2017-03-14 12:30:37 +08:00
|
|
|
data[i] = i;
|
|
|
|
|
|
|
|
/* Write the dataset */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Closing */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Dclose(did) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Sclose(sid) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Fclose(fid) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Pclose(fcpl) < 0)
|
2017-03-14 12:30:37 +08:00
|
|
|
goto error;
|
|
|
|
++j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assert(j == NELMTS(FILENAMES));
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
|
|
|
|
return 0;
|
2017-03-14 12:30:37 +08:00
|
|
|
|
|
|
|
error:
|
2020-09-30 22:27:10 +08:00
|
|
|
H5E_BEGIN_TRY
|
|
|
|
{
|
2017-03-14 12:30:37 +08:00
|
|
|
H5Sclose(sid);
|
|
|
|
H5Sclose(did);
|
|
|
|
H5Pclose(fcpl);
|
|
|
|
H5Fclose(fid);
|
2020-09-30 22:27:10 +08:00
|
|
|
}
|
|
|
|
H5E_END_TRY;
|
2017-03-14 12:30:37 +08:00
|
|
|
return -1;
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
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.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
}
|