Skip to content

Commit

Permalink
Ensure that simulation parameter file takes precedence over defaults …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
smutch committed Feb 20, 2024
1 parent ec55941 commit d23bbb2
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 @@ -1174,16 +1174,16 @@ void read_parameter_file(char* fname, int mode)
n_entries = parse_paramfile(fname, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);

// 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);

// Finally, parse the simulation parameter file
// Now parse the simulation parameter file
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);
}

// Finally, 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);

// Check to see if we are missing any required parameters
for (ii = 0; ii < n_param; ii++)
if ((used_tag[ii] == 0) && (required_tag[ii] == 1)) {
Expand Down Expand Up @@ -1234,4 +1234,4 @@ void read_parameter_file(char* fname, int mode)
// If running mpi then broadcast the run parameters to all cores
MPI_Bcast(run_params, sizeof(run_params_t), MPI_BYTE, 0, run_globals.mpi_comm);
MPI_Bcast(&(run_globals.units), sizeof(run_units_t), MPI_BYTE, 0, run_globals.mpi_comm);
}
}

0 comments on commit d23bbb2

Please sign in to comment.