Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amrex::ParmParse::dumpTable shows duplicate values #4087

Open
ax3l opened this issue Aug 16, 2024 · 4 comments
Open

amrex::ParmParse::dumpTable shows duplicate values #4087

ax3l opened this issue Aug 16, 2024 · 4 comments
Assignees
Labels

Comments

@ax3l
Copy link
Member

ax3l commented Aug 16, 2024

@JustinRayAngus discovered that since recently, the function amrex::ParmParse::dumpTable starts to plot values multiple times, likely because they were changed. The old values should not be shown.

Used in WarpX and ImpactX to plot the ultimately used inputs, e.g. here:
https://github.com/ECP-WarpX/WarpX/blob/24.08/Source/ablastr/utils/UsedInputsFile.cpp

@WeiqunZhang
Copy link
Member

The "issue" here is mainly a conscious choice of WarpX. WarpX processes many ParmParse parameters using Parser first and then explicitly uses add or addarr to add the post-processed values to ParmParse.

I tested with 24.07, which does not have the recent ParmParse changes. It has the same "issue". The only difference is in the old way the entries were not sorted so it was harder to notice.

@WeiqunZhang
Copy link
Member

For example,

$ git grep -n "pp.*add" Source/
Source/Diagnostics/BTD_Plotfile_Header_Impl.H:263:    /** Append particle info of the newly added box, namely,
Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp:33:    pp_diag_name.add("openpmd_backend", openpmd_backend);
Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp:68:    pp_rd_name.add("openpmd_backend", m_openpmd_backend);
Source/EmbeddedBoundary/WarpXInitEB.cpp:104:            pp_eb2.add("geom_type", geom_type); // use all_regular by default
Source/FieldSolver/FiniteDifferenceSolver/HybridPICSolveE.cpp:423:    // modified if such support wants to be added
Source/Initialization/WarpXAMReXInit.cpp:49:            pp_amr.add("blocking_factor", 1);
Source/Parallelization/WarpXComm.cpp:1051:    // overlapping points among boxes. Using the mask, we can add the
Source/Particles/PhysicalParticleContainer.cpp:392:    pp_species_name.queryarr("addIntegerAttributes", m_user_int_attribs);
Source/Particles/PhysicalParticleContainer.cpp:407:    pp_species_name.queryarr("addRealAttributes", m_user_real_attribs);
Source/Utils/WarpXUtil.cpp:55:        a_pp.addarr(input_str, input_array);
Source/Utils/WarpXUtil.cpp:93:    pp_geometry.addarr("prob_lo", prob_lo);
Source/Utils/WarpXUtil.cpp:94:    pp_geometry.addarr("prob_hi", prob_hi);
Source/Utils/WarpXUtil.cpp:222:    pp_geometry.addarr("prob_lo", prob_lo);
Source/Utils/WarpXUtil.cpp:223:    pp_geometry.addarr("prob_hi", prob_hi);
Source/Utils/WarpXUtil.cpp:225:      pp_warpx.addarr("fine_tag_lo", fine_tag_lo);
Source/Utils/WarpXUtil.cpp:226:      pp_warpx.addarr("fine_tag_hi", fine_tag_hi);
Source/Utils/WarpXUtil.cpp:229:    pp_slice.addarr("dom_lo",slice_lo);
Source/Utils/WarpXUtil.cpp:230:    pp_slice.addarr("dom_hi",slice_hi);
Source/Utils/WarpXUtil.cpp:311:        dims_error.append("inputs file does not declare 'geometry.dims'. Please add 'geometry.dims = ");
Source/Utils/WarpXUtil.cpp:362:    pp_amr.addarr("blocking_factor_x", blocking_factor_x);
Source/Utils/WarpXUtil.cpp:363:    pp_amr.addarr("max_grid_size_x", max_grid_size_x);
Source/Utils/WarpXUtil.cpp:386:    pp_amr.addarr("blocking_factor_y", bf);
Source/Utils/WarpXUtil.cpp:401:    pp_amr.addarr("max_grid_size_y", mg);
Source/Utils/WarpXUtil.cpp:498:    pp_geometry.addarr("is_periodic", geom_periodicity);
Source/WarpX.cpp:1037:            pp_vismf.add("usesingleread", use_single_read);
Source/WarpX.cpp:1038:            pp_vismf.add("usesinglewrite", use_single_write);
Source/WarpX.cpp:1045:            pp_particles.add("particles_nfiles", particle_io_nfiles);

@WeiqunZhang
Copy link
Member

For example, with 24.07, max_grid_size appears twice at lines 2 and 126. So it's hard to notice.

$ grep -n "max_grid_size" warpx_used_inputs
2:amr.max_grid_size = 64
126:amr.max_grid_size = 64

With the current versions, it appears at lines 6 and 7.

$ grep -n "max_grid_size" warpx_used_inputs
6:amr.max_grid_size = 64
7:amr.max_grid_size = 64

@ax3l
Copy link
Member Author

ax3l commented Aug 21, 2024

Haha, so the current version is actually stable/reproducible, showing the latest used value last.

Yes, adding an option to remove overwritten values would be a good idea to avoid confusion for codes that want this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants