Skip to content

Commit

Permalink
Only read SimParamsFile if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
smutch committed Jan 31, 2024
1 parent b8bdca4 commit 3e156f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/read_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ void read_parameter_file(char* fname, int mode)

strncpy(params_tag[n_param], "SimParamsFile", tag_length);
params_addr[n_param] = run_params->SimParamsFile;
required_tag[n_param] = 1;
required_tag[n_param] = 0;
params_type[n_param++] = PARAM_TYPE_STRING;
*(run_params->SimParamsFile) = '\0';

strncpy(params_tag[n_param], "OutputDir", tag_length);
params_addr[n_param] = run_params->OutputDir;
Expand Down Expand Up @@ -1233,17 +1234,16 @@ void read_parameter_file(char* fname, int mode)
// Parse the user parameter file first
n_entries = parse_paramfile(fname, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read input.par", MLOG_MESG);

// Now parse the default parameter file
n_entries = parse_paramfile(run_params->DefaultsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read defaults.par", MLOG_MESG);

// Finally, parse the simulation parameter file
n_entries = parse_paramfile(run_params->SimParamsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read sims file", MLOG_MESG);
if (strlen(run_params->SimParamsFile) > 0) {
n_entries = parse_paramfile(run_params->SimParamsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
}

// Check to see if we are missing any required parameters
for (ii = 0; ii < n_param; ii++)
Expand Down

0 comments on commit 3e156f3

Please sign in to comment.