From a105a8e03b4cf188ac6a3a5b9d87433d78ac56f7 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Thu, 26 Sep 2013 09:24:48 +0200 Subject: Set default frame set size when setting stride len. By befault adapt the frame set to 100*stride length in util functions. diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index c682a92..70d114c 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -13728,7 +13728,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_frequency_set current_trajectory_frame_set; tng_particle_data_t p_data; tng_non_particle_data_t np_data; - int64_t n_particles, n_frames = 10000; + int64_t n_particles, n_frames = 100*f; tng_function_status stat; if(!frame_set || tng_data->n_trajectory_frame_sets <= 0) @@ -13863,7 +13863,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write current_trajectory_frame_set; tng_particle_data_t p_data; tng_non_particle_data_t np_data; - int64_t n_particles, n_frames = 10000, stride_length = 1000, frame_pos; + int64_t n_particles, n_frames = 10000, stride_length = 100, frame_pos; tng_function_status stat; char block_type_flag; @@ -13886,7 +13886,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write return(stat); } } - else if(frame_nr >= frame_set->first_frame + n_frames) + else + { + n_frames = frame_set->n_frames; + } + if(frame_nr >= frame_set->first_frame + n_frames) { stat = tng_frame_set_write(tng_data, TNG_USE_HASH); if(stat != TNG_SUCCESS) @@ -13904,10 +13908,6 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write return(stat); } } - else - { - n_frames = frame_set->n_frames; - } frame_set->n_unwritten_frames = frame_nr - frame_set->first_frame + 1; } -- cgit v0.10.1