From 24346b6c8b55156da7604b3096a83a6df69ee2cf Mon Sep 17 00:00:00 2001 From: "Nathan X. Marshak" Date: Fri, 20 Sep 2024 17:50:14 -0600 Subject: [PATCH 1/4] Fix compile error when Reeber is enabled --- Util/reeber/src/reeber.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Util/reeber/src/reeber.cpp b/Util/reeber/src/reeber.cpp index 7e193c868..b758a5c3a 100644 --- a/Util/reeber/src/reeber.cpp +++ b/Util/reeber/src/reeber.cpp @@ -430,7 +430,7 @@ std::vector compute_halos(diy::mpi::communicator& world, new Block(b->fab, b->extra_names_, b->extra_fabs_, local_ref, local_lev, diy_domain, l->bounds(), l->core(), cp.gid(), - new_link, absolute_rho, negate, /*absolute = */ true, cell_volume), + new_link, absolute_rho, negate, /* wrap = */ true, /*absolute = */ true, cell_volume), new_link); //if (debug) fmt::print(std::cerr, "Added block gid = {}\n", cp.gid()); From bdec354ee9dc812125da73c39979d954c33f3288 Mon Sep 17 00:00:00 2001 From: "Nathan X. Marshak" Date: Fri, 18 Oct 2024 17:53:09 -0600 Subject: [PATCH 2/4] Fixed compile of in situ halo finding code. --- Source/IO/Nyx_output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/IO/Nyx_output.cpp b/Source/IO/Nyx_output.cpp index fdc708329..eac9c122a 100644 --- a/Source/IO/Nyx_output.cpp +++ b/Source/IO/Nyx_output.cpp @@ -1086,7 +1086,7 @@ Nyx::updateInSitu () #endif #ifdef REEBER - amrex::Vector& reeber_halos); + amrex::Vector reeber_halos; halo_find(parent->dtLevel(level), reeber_halos); halo_print(reeber_halos); #endif From 5bb2b09db2b4cda1af8a3d300593d3bbba0f64a8 Mon Sep 17 00:00:00 2001 From: "Nathan X. Marshak" Date: Fri, 20 Dec 2024 14:58:20 -0700 Subject: [PATCH 3/4] Use non-owning pointer to avoid double free --- Util/reeber/src/reeber.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Util/reeber/src/reeber.cpp b/Util/reeber/src/reeber.cpp index b758a5c3a..9d0e3cfa8 100644 --- a/Util/reeber/src/reeber.cpp +++ b/Util/reeber/src/reeber.cpp @@ -159,7 +159,7 @@ void prepare_master_reader( int finest_level, const Vector& level_refinements, const amrex::Geometry geom_in, - std::vector>& pointers_to_copied_data) + std::vector& pointers_to_copied_data) { std::vector new_state_vars { "density", "xmom", "ymom", "zmom" }; const size_t density_var_idx = 0; @@ -227,7 +227,10 @@ void prepare_master_reader( gid_to_fab_size[gid] = core_fab_size; pointers_to_copied_data.emplace_back(new Real[core_fab_size]); - Real* core_fab_ptr = pointers_to_copied_data.back().get(); + // Real* core_fab_ptr = pointers_to_copied_data.back().get(); + + // HACK: use raw pointer to avoid double free + Real* core_fab_ptr = pointers_to_copied_data.back(); GridRef core_grid_ref(core_fab_ptr, core_shape, false); @@ -266,7 +269,10 @@ void prepare_master_reader( // reserve memory for dm_density pointers_to_copied_data.emplace_back(new Real[core_fab_size]); - Real* extra_ptr_copy = pointers_to_copied_data.back().get(); + // Real* extra_ptr_copy = pointers_to_copied_data.back().get(); + + // HACK: use raw pointer to avoid double free + Real* extra_ptr_copy = pointers_to_copied_data.back(); extra_pointers.push_back(extra_ptr_copy); // reserve memory for variables in new_state @@ -571,7 +577,8 @@ void Nyx::runReeberAnalysis(Vector& new_state, // store pointers to all dynamically allocated arrays, so that // data will be freed automatically after exiting compute_halos - std::vector> pointers_to_copied_data; + // std::vector> pointers_to_copied_data; + std::vector pointers_to_copied_data; // HACK: avoid double free diy::mpi::communicator world = ParallelDescriptor::Communicator(); From d84b1dfa6464fef1639bbbb616c93fcdc0a1110e Mon Sep 17 00:00:00 2001 From: "Nathan X. Marshak" Date: Fri, 20 Dec 2024 19:23:09 -0500 Subject: [PATCH 4/4] Ascent volume rendering of density, xh --- Exec/LyA/ascent_actions.yaml | 37 ++++++++---------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/Exec/LyA/ascent_actions.yaml b/Exec/LyA/ascent_actions.yaml index 8fbab5703..1b26889bd 100644 --- a/Exec/LyA/ascent_actions.yaml +++ b/Exec/LyA/ascent_actions.yaml @@ -1,35 +1,14 @@ --- -- - action: add_pipelines - pipelines: - slice: - f1: - params: - normal: - x: 0.0 - ? "y" - : 0.0 - z: 1.0 - point: - x: 0.0 - ? "y" - : 0.0 - z: 0.0 - topology: topo - type: exaslice - action: add_extracts extracts: e1: + type: volume + params: + field: xh + filename: xh_pic + e2: + type: volume params: - fields: - - Density - - Xmom - - Ymom - - Zmom - - rho_E - - rho_e - path: the_slice - protocol: blueprint/mesh/hdf5 - pipeline: slice - type: relay + field: density + filename: density_pic