Skip to content
Snippets Groups Projects
Commit 42a00772 authored by rttw52's avatar rttw52
Browse files

Updating subdir_per_output to use the correct counter, and how it compares to the default value

parent 520b031f
Branches
Tags
1 merge request!1103Updating subdir_per_output to use the correct counter, and how it compares to the default value
...@@ -648,7 +648,7 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) { ...@@ -648,7 +648,7 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
/* Generate directory name for this output - start with snapshot directory, if /* Generate directory name for this output - start with snapshot directory, if
* specified */ * specified */
char outputDirName[FILENAME_BUFFER_SIZE] = ""; char outputDirName[FILENAME_BUFFER_SIZE] = "";
if (strnlen(e->snapshot_subdir, PARSER_MAX_LINE_SIZE) > 0) { if (strcmp(e->snapshot_subdir, engine_default_snapshot_subdir) != 0) {
if (snprintf(outputDirName, FILENAME_BUFFER_SIZE, "%s/", if (snprintf(outputDirName, FILENAME_BUFFER_SIZE, "%s/",
e->snapshot_subdir) >= FILENAME_BUFFER_SIZE) { e->snapshot_subdir) >= FILENAME_BUFFER_SIZE) {
error("FILENAME_BUFFER_SIZE is to small for snapshot directory name!"); error("FILENAME_BUFFER_SIZE is to small for snapshot directory name!");
...@@ -661,10 +661,10 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) { ...@@ -661,10 +661,10 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
/* Then create output-specific subdirectory if necessary */ /* Then create output-specific subdirectory if necessary */
char subDirName[FILENAME_BUFFER_SIZE] = ""; char subDirName[FILENAME_BUFFER_SIZE] = "";
if (strnlen(e->stf_subdir_per_output, PARSER_MAX_LINE_SIZE) > 0) { if (strcmp(e->stf_subdir_per_output, engine_default_stf_subdir_per_output) != 0) {
if (snprintf(subDirName, FILENAME_BUFFER_SIZE, "%s%s_%04i/", outputDirName, if (snprintf(subDirName, FILENAME_BUFFER_SIZE, "%s%s_%04i/", outputDirName,
e->stf_subdir_per_output, e->stf_subdir_per_output,
e->snapshot_output_count) >= FILENAME_BUFFER_SIZE) { e->stf_output_count) >= FILENAME_BUFFER_SIZE) {
error( error(
"FILENAME_BUFFER_SIZE is to small for Velociraptor directory name!"); "FILENAME_BUFFER_SIZE is to small for Velociraptor directory name!");
} }
...@@ -677,9 +677,6 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) { ...@@ -677,9 +677,6 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
strncpy(subDirName, outputDirName, FILENAME_BUFFER_SIZE); strncpy(subDirName, outputDirName, FILENAME_BUFFER_SIZE);
} }
/* What is the snapshot number? */
int snapnum = e->stf_output_count;
/* What should the filename be? */ /* What should the filename be? */
char outputFileName[FILENAME_BUFFER_SIZE]; char outputFileName[FILENAME_BUFFER_SIZE];
if (snprintf(outputFileName, FILENAME_BUFFER_SIZE, "%s%s_%04i.VELOCIraptor", if (snprintf(outputFileName, FILENAME_BUFFER_SIZE, "%s%s_%04i.VELOCIraptor",
...@@ -722,7 +719,7 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) { ...@@ -722,7 +719,7 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
/* Call VELOCIraptor. */ /* Call VELOCIraptor. */
group_info = (struct groupinfo *)InvokeVelociraptor( group_info = (struct groupinfo *)InvokeVelociraptor(
snapnum, outputFileName, cosmo_info, sim_info, nr_gparts, nr_parts, e->stf_output_count, outputFileName, cosmo_info, sim_info, nr_gparts, nr_parts,
nr_sparts, swift_parts, cell_node_ids, e->nr_threads, linked_with_snap, nr_sparts, swift_parts, cell_node_ids, e->nr_threads, linked_with_snap,
&num_gparts_in_groups); &num_gparts_in_groups);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment