diff --git a/src/distributed_io.c b/src/distributed_io.c index d37873f40626846591c6c4321656ef07a18d0c73..34cfe9c51e90ce656b98243ee74e77ef47dade9b 100644 --- a/src/distributed_io.c +++ b/src/distributed_io.c @@ -354,6 +354,16 @@ void write_output_distributed(struct engine* e, e->s->dim[1] * factor_length, e->s->dim[2] * factor_length}; + /* Determine if we are writing a reduced snapshot, and if so which + * output selection type to use */ + char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; + if (output_list) { + /* Users could have specified a different Select Output scheme for each + * snapshot. */ + output_list_get_current_select_output(output_list, + ¤t_selection_name[0]); + } + /* Print the relevant information and print status */ io_write_attribute(h_grp, "BoxSize", DOUBLE, dim, 3); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); @@ -393,6 +403,7 @@ void write_output_distributed(struct engine* e, io_write_attribute_i(h_grp, "NumFilesPerSnapshot", numFiles); io_write_attribute_i(h_grp, "ThisFile", mpi_rank); io_write_attribute_s(h_grp, "OutputType", "Snapshot"); + io_write_attribute_s(h_grp, "SelectOutput", current_selection_name); /* Close header */ H5Gclose(h_grp); @@ -706,13 +717,6 @@ void write_output_distributed(struct engine* e, /* Write everything that is not cancelled */ - char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; - if (output_list) { - /* Users could have specified a different Select Output scheme for each - * snapshot. */ - output_list_get_current_select_output(output_list, - ¤t_selection_name[0]); - } for (int i = 0; i < num_fields; ++i) { /* Did the user cancel this field? */ diff --git a/src/parallel_io.c b/src/parallel_io.c index 5961c919d615d4e91dc50cc88877257d6424236c..9f4fee1038d5bd767d8f0fb400e31b28d2561485 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -1102,6 +1102,16 @@ void prepare_file(struct engine* e, const char* fileName, e->s->dim[1] * factor_length, e->s->dim[2] * factor_length}; + /* Determine if we are writing a reduced snapshot, and if so which + * output selection type to use */ + char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; + if (output_list) { + /* Users could have specified a different Select Output scheme for each + * snapshot. */ + output_list_get_current_select_output(output_list, + ¤t_selection_name[0]); + } + /* Print the relevant information and print status */ io_write_attribute(h_grp, "BoxSize", DOUBLE, dim, 3); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); @@ -1142,6 +1152,7 @@ void prepare_file(struct engine* e, const char* fileName, io_write_attribute(h_grp, "NumFilesPerSnapshot", INT, &numFiles, 1); io_write_attribute_i(h_grp, "ThisFile", 0); io_write_attribute_s(h_grp, "OutputType", "Snapshot"); + io_write_attribute_s(h_grp, "SelectOutput", current_selection_name); /* Close header */ H5Gclose(h_grp); @@ -1260,13 +1271,6 @@ void prepare_file(struct engine* e, const char* fileName, /* Prepare everything that is not cancelled */ - char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; - if (output_list) { - /* Users could have specified a different Select Output scheme for each - * snapshot. */ - output_list_get_current_select_output(output_list, - ¤t_selection_name[0]); - } for (int i = 0; i < num_fields; ++i) { /* Did the user cancel this field? */ diff --git a/src/serial_io.c b/src/serial_io.c index 63318487a0d2b5284595c874fb601fa59a9b5efa..7782644489a60968115a24709437daa7d528b5e1 100644 --- a/src/serial_io.c +++ b/src/serial_io.c @@ -969,6 +969,16 @@ void write_output_serial(struct engine* e, e->s->dim[1] * factor_length, e->s->dim[2] * factor_length}; + /* Determine if we are writing a reduced snapshot, and if so which + * output selection type to use */ + char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; + if (output_list) { + /* Users could have specified a different Select Output scheme for each + * snapshot. */ + output_list_get_current_select_output(output_list, + ¤t_selection_name[0]); + } + /* Print the relevant information and print status */ io_write_attribute(h_grp, "BoxSize", DOUBLE, dim, 3); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); @@ -1009,6 +1019,7 @@ void write_output_serial(struct engine* e, io_write_attribute(h_grp, "NumFilesPerSnapshot", INT, &numFiles, 1); io_write_attribute_i(h_grp, "ThisFile", 0); io_write_attribute_s(h_grp, "OutputType", "Snapshot"); + io_write_attribute_s(h_grp, "SelectOutput", current_selection_name); /* Close header */ H5Gclose(h_grp); @@ -1389,13 +1400,6 @@ void write_output_serial(struct engine* e, /* Write everything that is not cancelled */ - char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; - if (output_list) { - /* Users could have specified a different Select Output scheme for - * each snapshot. */ - output_list_get_current_select_output(output_list, - ¤t_selection_name[0]); - } for (int i = 0; i < num_fields; ++i) { /* Did the user cancel this field? */ diff --git a/src/single_io.c b/src/single_io.c index 056c8d1b846f9867ce4961d2c70ca3c83e919807..1d104f0aec2942b227fda042bb7e04a3e6ec26e0 100644 --- a/src/single_io.c +++ b/src/single_io.c @@ -815,6 +815,16 @@ void write_output_single(struct engine* e, e->s->dim[1] * factor_length, e->s->dim[2] * factor_length}; + /* Determine if we are writing a reduced snapshot, and if so which + * output selection type to use */ + char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; + if (output_list) { + /* Users could have specified a different Select Output scheme for each + * snapshot. */ + output_list_get_current_select_output(output_list, + ¤t_selection_name[0]); + } + /* Print the relevant information and print status */ io_write_attribute(h_grp, "BoxSize", DOUBLE, dim, 3); io_write_attribute(h_grp, "Time", DOUBLE, &dblTime, 1); @@ -855,6 +865,7 @@ void write_output_single(struct engine* e, io_write_attribute(h_grp, "NumFilesPerSnapshot", INT, &numFiles, 1); io_write_attribute_i(h_grp, "ThisFile", 0); io_write_attribute_s(h_grp, "OutputType", "Snapshot"); + io_write_attribute_s(h_grp, "SelectOutput", current_selection_name); /* Close header */ H5Gclose(h_grp); @@ -1173,13 +1184,6 @@ void write_output_single(struct engine* e, /* Write everything that is not cancelled */ - char current_selection_name[FIELD_BUFFER_SIZE] = "Default"; - if (output_list) { - /* Users could have specified a different Select Output scheme for each - * snapshot. */ - output_list_get_current_select_output(output_list, - ¤t_selection_name[0]); - } for (int i = 0; i < num_fields; ++i) { /* Did the user cancel this field? */