summaryrefslogtreecommitdiffstats
path: root/ChangeLog.1999
Commit message (Expand)AuthorAgeFilesLines
* Filling in names for email addresses in the "old days"dkf2004-04-231-448/+447
* * ChangeLog.1999:hobbs2001-09-131-0/+2698
lass="hl opt">, 0.0) < 0) goto error; } if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk(dcpl, 1, ch_size) < 0) goto error; if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; if(H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2]) < 0) goto error; if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error; if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; #if !defined( __MWERKS__) /* workaround for a bug in the Metrowerks version 6.0 open function */ if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error; #endif for (i=1; i<=cur_size[0]; i++) { /* Decide which chunk to write to */ switch (fill_style) { case FILL_FORWARD: hs_start[0] = i-1; break; case FILL_REVERSE: hs_start[0] = cur_size[0]-i; break; case FILL_INWARD: hs_start[0] = i%2 ? i/2 : cur_size[0]-i/2; break; case FILL_OUTWARD: j = (int)(cur_size[0]-i)+1; hs_start[0] = j%2 ? j/2 : (hssize_t)cur_size[0]-j/2; break; case FILL_RANDOM: for (j=HDrand()%(int)cur_size[0]; had[j]; j=(j+1)%(int)cur_size[0]) /*void*/; hs_start[0] = j; had[j] = 1; break; case FILL_ALL: abort(); } /* Write the chunk */ if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_start, NULL, hs_count, NULL) < 0) goto error; if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i) < 0) { goto error; } #if !defined( __MWERKS__) /* Determine overhead */ if (verbose) { if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error; if (HDfstat(fd, &sb) < 0) goto error; /* * The extra cast in the following statement is a bug workaround * for the Win32 version 5.0 compiler. * 1998-11-06 ptl */ printf("%4lu %8.3f ***\n", (unsigned long)i, (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i); } #endif } H5Dclose(dset); H5Sclose(mspace); H5Sclose(fspace); H5Pclose(dcpl); H5Pclose(xfer); H5Fclose(file); if (!verbose) { switch (fill_style) { case FILL_FORWARD: sname = "forward"; break; case FILL_REVERSE: sname = "reverse"; break; case FILL_INWARD: sname = "inward"; break; case FILL_OUTWARD: sname = "outward"; break; case FILL_RANDOM: sname = "random"; break; case FILL_ALL: abort(); } #if !defined( __MWERKS__) if (HDfstat(fd, &sb) < 0) goto error; printf("%-7s %8.3f\n", sname, (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/ (hssize_t)cur_size[0]); #endif } #if !defined( __MWERKS__) HDclose(fd); #endif return 0; error: H5Dclose(dset); H5Sclose(mspace); H5Sclose(fspace); H5Pclose(dcpl); H5Pclose(xfer); H5Fclose(file); free(had); HDclose(fd); return 1; } /*------------------------------------------------------------------------- * Function: main * * Purpose: * * Return: Success: zero * * Failure: non-zero * * Programmer: Robb Matzke * Monday, September 28, 1998 * * Modifications: * *------------------------------------------------------------------------- */ int main(int argc, char *argv[]) { hid_t xfer; fill_t fill_style = FILL_ALL; hbool_t use_cache = FALSE; double splits[3]; int i, j, nerrors=0; /* Default split ratios */ H5Eset_auto2(H5E_DEFAULT, display_error_cb, NULL); if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; if(H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2) < 0) goto error; if(H5Pclose(xfer) < 0) goto error; /* Parse command-line options */ for(i = 1, j = 0; i < argc; i++) { if (!strcmp(argv[i], "forward")) { fill_style = FILL_FORWARD; } else if (!strcmp(argv[i], "reverse")) { fill_style = FILL_REVERSE; } else if (!strcmp(argv[i], "inward")) { fill_style = FILL_INWARD; } else if (!strcmp(argv[i], "outward")) { fill_style = FILL_OUTWARD; } else if (!strcmp(argv[i], "random")) { fill_style = FILL_RANDOM; } else if (!strcmp(argv[i], "cache")) { use_cache = TRUE; } else if (j<3 && (isdigit(argv[i][0]) || '.'==argv[i][0])) { splits[j++] = strtod(argv[i], NULL); } else { usage(argv[0]); } } if (FILL_ALL==fill_style) { printf("%-7s %8s\n", "Style", "Bytes/Chunk"); printf("%-7s %8s\n", "-----", "-----------"); nerrors += test(FILL_FORWARD, splits, FALSE, use_cache); nerrors += test(FILL_REVERSE, splits, FALSE, use_cache); nerrors += test(FILL_INWARD, splits, FALSE, use_cache); nerrors += test(FILL_OUTWARD, splits, FALSE, use_cache); nerrors += test(FILL_RANDOM, splits, FALSE, use_cache); } else { if (use_cache) usage(argv[0]); nerrors += test(fill_style, splits, TRUE, FALSE); } if (nerrors>0) goto error; cleanup(); return 0; error: fprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; }