Branch | Commit message | Author | Age |
8_5_with_8_6_regexp | Minor clean-ups (e.g. turn back const -> CONST, as common in 8.5 branch) | jan.nijtmans | 9 years |
Coverity_CID_1251203 | Fix the documentation comment. | dkf | 9 years |
ISC_peephole | merge trunk | mig | 12 years |
activestate_nre_excised_variant_1_roll_forward | while 'info' is destroyed and becoms inaccessible after TclEvalObjEx. | andreask | 14 years |
activestate_nre_excised_variant_2_subtracted | The re-creation of this branch should have deleted a few NRE specific testsui... | andreask | 14 years |
adjust_fix | Patch to the original line continuation commit to fix up TclCompileTokens. | dgp | 11 years |
ajuba_ajuba2_2_0_synthetic | Created branch ajuba-ajuba2-2-0-synthetic | cvs2fossil | 24 years |
ajuba_ajuba2_2_1_base_synthetic | Created branch ajuba-ajuba2-2-1-base-synthetic | cvs2fossil | 24 years |
aku_mem_debug_allow_regular | Minor compilation issue fix, make sure variable declaration (via macro) is fi... | Joe Mistachkin | 9 years |
aku_review | Docs for Tcl_CreateChannelHandler() state that the registered handler proc | dgp | 10 years |
aku_tip_280_cl_perf_trial | Merge to feature branch | dkf | 14 years |
aku_tkt_6141c15186 | Update to trunk work | aku | 9 years |
amg_array_enum_c_api | Check in stash. This code probably does not compile as-is. Changes intended... | andy | 7 years |
amg_string_insert | Simplify implementation of non-bytecoded [string replace] | andy | 7 years |
androwish | merge zipfs | jan.nijtmans | 7 years |
apn_hash_opt | Some cleanup of style issues. | dkf | 10 years |
array_search_unset | Reference ticket number in tests var-13.2 and var-13.3 | andy | 8 years |
aspect_async_pipe | don't panic when EAGAIN - if the pipe is full, we have to drop the message | aspect | 8 years |
aspect_bug_391bc0fd2c | glob for hidden files on unix should not require stat() | aspect | 7 years |
aspect_lreplace_cleanup | [47ac84309b] Import of aspect's branch from his personal repository on chisel... | dkf | 9 years |
aspect_lreplace_fix | undo erroneous change in [1fa2e32e07] | aspect | 10 years |
aspect_lreplace_refix | lreplace: more tests, doc improvement | aspect | 9 years |
aspect_shimmer_singleton_lists | add some tests for singleton list optimisation [738900] | aspect | 8 years |
aspect_string_match | fix advancement of snext: could not cook up a test for this, but the error i... | aspect | 7 years |
aspect_tip288 | Taking a stab at TIP#288 implementation. | aspect | 7 years |
avl_strcat_fix |
hsize_t i, j, k;
name = filename_g;
/* Open the file */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
return -1;
if(use_swmr_g)
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
return -1;
if((fid = H5Fopen(name, H5F_ACC_RDWR | (use_swmr_g ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0){
HDfprintf(stderr, "H5Fopen failed\n");
return -1;
}
/* Open the dataset of the program name */
if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
HDfprintf(stderr, "H5Dopen2 failed\n");
return -1;
}
/* Disabled mdc flushed for the dataset */
if(H5Odisable_mdc_flushes(dsid) < 0) {
HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
return -1;
}
/* Get mdc disabled status of the dataset */
if(H5Oare_mdc_flushes_disabled(dsid, &disabled) < 0) {
HDfprintf(stderr, "H5Oare_mdc_flushes_disabled failed\n");
return -1;
} else if(disabled)
HDprintf("Dataset has disabled mdc flushes.\n");
else
HDprintf("Dataset should have disabled its mdc flushes.\n");
/* Find chunksize used */
if ((dcpl = H5Dget_create_plist(dsid)) < 0){
HDfprintf(stderr, "H5Dget_create_plist failed\n");
return -1;
}
if (H5D_CHUNKED != H5Pget_layout(dcpl)){
HDfprintf(stderr, "storage layout is not chunked\n");
return -1;
}
if ((rank = H5Pget_chunk(dcpl, 3, chunk_dims)) != 3){
HDfprintf(stderr, "storage rank is not 3\n");
return -1;
}
/* verify chunk_dims against set paramenters */
if (chunk_dims[0]!= chunkdims_g[0] || chunk_dims[1] != cz || chunk_dims[2] != cz){
HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n",
(unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
(unsigned long long)chunk_dims[2]);
return -1;
}
/* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
memdims[0]=1;
memdims[1] = dims_g[1];
memdims[2] = dims_g[2];
if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) {
HDfprintf(stderr, "malloc: failed\n");
return -1;
};
/*
* Get dataset rank and dimension.
*/
f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK){
HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
return -1;
}
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
return -1;
}
HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n",
rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
(unsigned long long)(dims[2]));
/* verify that file space dims are as expected and are consistent with memory space dims */
if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]){
HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n",
(unsigned long long)dims[0], (unsigned long long)dims[1],
(unsigned long long)dims[2]);
return -1;
}
/* setup mem-space for buffer */
if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){
HDfprintf(stderr, "H5Screate_simple for memory failed\n");
return -1;
};
/* write planes */
count[0]=1;
count[1]=dims[1];
count[2]=dims[2];
for (i=0; i<nplanes_g; i++){
/* fill buffer with value i+1 */
bufptr = buffer;
for (j=0; j<dims[1]; j++)
for (k=0; k<dims[2]; k++)
*bufptr++ = i;
/* extend the dataset by one for new plane */
dims[0]=i+1;
if(H5Dset_extent(dsid, dims) < 0){
HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
}
/* Get the dataset's dataspace */
if((f_sid = H5Dget_space(dsid)) < 0){
HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
}
start[0]=i;
/* Choose the next plane to write */
if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
HDfprintf(stderr, "Failed H5Sselect_hyperslab\n");
return -1;
}
/* Write plane to the dataset */
if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
HDfprintf(stderr, "Failed H5Dwrite\n");
return -1;
}
/* Flush the dataset for every "chunkplanes_g" planes */
if(!((i + 1) % (hsize_t)chunkplanes_g)) {
if(H5Dflush(dsid) < 0) {
HDfprintf(stderr, "Failed to H5Dflush dataset\n");
return -1;
}
}
}
if(H5Dflush(dsid) < 0) {
HDfprintf(stderr, "Failed to H5Dflush dataset\n");
return -1;
}
/* Enable mdc flushes for the dataset */
/* Closing the dataset later will enable mdc flushes automatically if this is not done */
if(disabled)
if(H5Oenable_mdc_flushes(dsid) < 0) {
HDfprintf(stderr, "Failed to H5Oenable_mdc_flushes\n");
return -1;
}
/* Done writing. Free/Close all resources including data file */
HDfree(buffer);
if(H5Dclose(dsid) < 0){
HDfprintf(stderr, "Failed to close datasete\n");
return -1;
}
if(H5Sclose(m_sid) < 0){
HDfprintf(stderr, "Failed to close memory space\n");
return -1;
}
if(H5Sclose(f_sid) < 0){
HDfprintf(stderr, "Failed to close file space\n");
return -1;
}
if(H5Pclose(fapl) < 0){
HDfprintf(stderr, "Failed to property list\n");
return -1;
}
if(H5Fclose(fid) < 0){
HDfprintf(stderr, "Failed to close file id\n");
return -1;
}
return 0;
} /* write_file() */
/* Overall Algorithm:
* Parse options from user;
* Generate/pre-created test files needed and close it;
* Write to the file.
*/
int
main(int argc, char *argv[])
{
int ret_value = 0;
/* initialization */
if(setup_parameters(argc, argv) < 0)
Hgoto_error(1);
/* ============*/
/* Create file */
/* ============*/
HDprintf("Creating skeleton data file for testing H5Odisable_mdc_flushes()...\n");
if(create_file() < 0) {
HDfprintf(stderr, "***encounter error\n");
Hgoto_error(1);
} /* end if */
else
HDprintf("File created.\n");
HDprintf("writing to the file\n");
if(write_file() < 0) {
HDfprintf(stderr, "write_file encountered error\n");
Hgoto_error(1);
}
done:
/* Print result and exit */
if(ret_value != 0)
HDprintf("Error(s) encountered\n");
else
HDprintf("All passed\n");
return(ret_value);
}
#else /* H5_HAVE_FORK */
int
main(void)
{
HDfprintf(stderr, "Non-POSIX platform. Skipping.\n");
HDexit(EXIT_SUCCESS);
} /* end main() */
#endif /* H5_HAVE_FORK */
|