diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/credel.c | 45 | ||||
-rw-r--r-- | examples/gaussians.c | 28 |
2 files changed, 6 insertions, 67 deletions
diff --git a/examples/credel.c b/examples/credel.c index 92ea662..46cfbb8 100644 --- a/examples/credel.c +++ b/examples/credel.c @@ -255,11 +255,11 @@ delete_dataset(state_t *s, const int64_t didx) if (s->verbose > 0) fprintf(stderr, "Deleted dataset %s\n", dname); -#if 1 + const hid_t ds = s->dataset[didx % ndatasets]; if (H5Dclose(ds) < 0) errx(EXIT_FAILURE, "H5Dclose failed"); -#endif + s->dataset[didx % ndatasets] = H5I_INVALID_HID; s->stats.datasets.deleted++; } @@ -300,22 +300,8 @@ create_dataset(state_t *s, const int64_t didx) static void create_and_write_dataset(state_t *s, const int64_t didx) { -#if 0 - const int64_t gidx = didx / 2; - const int ngroups = __arraycount(s->group); - const hid_t g = s->group[gidx % ngroups]; - - if (H5Odisable_mdc_flushes(g) < 0) - err(EXIT_FAILURE, "H5Odisable_mdc_flushes failed"); -#endif - create_dataset(s, didx); write_dataset(s, didx); - -#if 0 - if (H5Oenable_mdc_flushes(g) < 0) - err(EXIT_FAILURE, "H5Oenable_mdc_flushes failed"); -#endif } static void @@ -369,12 +355,9 @@ main(int argc, char **argv) errx(EXIT_FAILURE, "%s.%d H5Pcreate failed", __func__, __LINE__); } - config.version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; - config.tick_len = 4; - config.max_lag = 5; -#if 0 /* raw-data flushing is not implemented */ - config.flush_raw_data = true; -#endif + config.version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; + config.tick_len = 4; + config.max_lag = 5; config.writer = true; config.md_pages_reserved = 128; strlcpy(config.md_file_path, "./my_md_file", sizeof(config.md_file_path)); @@ -399,6 +382,7 @@ main(int argc, char **argv) s->file = H5Fcreate(s->output_file, H5F_ACC_TRUNC, fcpl, fapl); H5Pclose(fapl); + H5Pclose(fcpl); if (s->file < 0) errx(EXIT_FAILURE, "H5Fcreate failed"); @@ -441,23 +425,6 @@ main(int argc, char **argv) H5Fvfd_swmr_end_tick(s->file); (void)sigsuspend(&mask); } -#if 0 - fprintf(stderr, "Interrupted. Cleaning up.\n"); - - int j; - for (--i, j = 0; j < 4; j++, --i) { - if (i % 2 == 1) { - delete_dataset(s, i - 1); - delete_dataset(s, i); - delete_group(s, i / 2); - } - } - - for (j = 0; j < 4; j++) { - assert(s->dataset[j] == H5I_INVALID_HID); - assert(s->group[j / 2] == H5I_INVALID_HID); - } -#endif if (s->print_stats) print_stats(&s->stats); diff --git a/examples/gaussians.c b/examples/gaussians.c index f67ea2f..7517949 100644 --- a/examples/gaussians.c +++ b/examples/gaussians.c @@ -202,25 +202,6 @@ matrix_read(state_t *s, int *framenop, float mat[ROWS][COLS]) *framenop = frameno + 2; } -#if 0 - if (!s->constantrate && (lead < -2 || 2 < lead)) { - int gain = 31250 / 4; - const struct timespec prior_integral = s->update_integral; - struct timespec current_interval; - if (lead > 0) - gain *= 2; - struct timespec adjustment = (struct timespec){.tv_sec = 0, - .tv_nsec = gain * MAX(MIN(4, lead), -4)}; - /* XXX clamp it XXX */ - timespecadd(&s->update_integral, - &adjustment, &s->update_integral); - timespecadd(&s->update_integral, - &s->update_interval, ¤t_interval); - if (timespeccmp(¤t_interval, &s->min_interval, <=)) - s->update_integral = prior_integral; - } -#endif - if (frameno >= dims[0]) { int i, j; for (i = 0; i < ROWS; i++) { @@ -565,11 +546,6 @@ matrix_open(state_t *s, bool rw) config.writer = rw; config.md_pages_reserved = 128; -#if 0 /* raw-data flushing is not implemented; default open-tries is ok */ - config.flush_raw_data = true; - config.md_open_tries = 1; -#endif - strlcpy(config.md_file_path, "./my_md_file", sizeof(config.md_file_path)); /* Enable page buffering */ @@ -688,10 +664,6 @@ main(int argc, char **argv) case READ: case STANDALONE: matrix_draw(w, mat); -#if 0 - wmove(topw, ROWS + 3, 0); - waddstr(topw, "\"Don't cross the streams.\""); -#endif break; case WRITE: matrix_write(&s, frameno, mat); |