Skip to content

Commit

Permalink
consistent ref_grid_mpi(ref_grid) ref_node
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Mar 28, 2022
1 parent cd33b6d commit 4c85852
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/ref_recon_test.c
Expand Up @@ -83,17 +83,16 @@ int main(int argc, char *argv[]) {
ref_mpi_stopwatch_stop(ref_grid_mpi(ref_grid), "field import");
REIS(3, ldim, "expected [p,vol,phi]");

ref_malloc_init(limeff, ref_node_max(ref_grid_node(ref_grid)), REF_DBL,
0.0);
ref_malloc(p, ref_node_max(ref_grid_node(ref_grid)), REF_DBL);
ref_malloc(grad, 3 * ref_node_max(ref_grid_node(ref_grid)), REF_DBL);
each_ref_node_valid_node(ref_grid_node(ref_grid), node) {
ref_malloc_init(limeff, ref_node_max(ref_node), REF_DBL, 0.0);
ref_malloc(p, ref_node_max(ref_node), REF_DBL);
ref_malloc(grad, 3 * ref_node_max(ref_node), REF_DBL);
each_ref_node_valid_node(ref_node, node) {
p[node] = field[ip + ldim * node];
}
RSS(ref_recon_gradient(ref_grid, p, grad, reconstruction), "grad");
ref_mpi_stopwatch_stop(ref_mpi, "kexact grad");
ref_mpi_stopwatch_stop(ref_grid_mpi(ref_grid), "kexact grad");
RSS(ref_edge_create(&ref_edge, ref_grid), "create");
ref_mpi_stopwatch_stop(ref_mpi, "create edges");
ref_mpi_stopwatch_stop(ref_grid_mpi(ref_grid), "create edges");
each_ref_edge(ref_edge, edge) {
REF_DBL qunlim, qlim;
REF_DBL r[3];
Expand Down Expand Up @@ -125,15 +124,17 @@ int main(int argc, char *argv[]) {
limeff[node] = 0.0;
}
}
ref_mpi_stopwatch_stop(ref_mpi, "limiter effect");
ref_mpi_stopwatch_stop(ref_grid_mpi(ref_grid), "limiter effect");
RSS(ref_gather_scalar_by_extension(ref_grid, 1, limeff, NULL,
"ref_recon_limiter_effect.plt"),
"export lim eff plt");
ref_mpi_stopwatch_stop(ref_mpi, "ref_recon_limiter_effect.plt");
ref_mpi_stopwatch_stop(ref_grid_mpi(ref_grid),
"ref_recon_limiter_effect.plt");
RSS(ref_gather_scalar_by_extension(ref_grid, 1, limeff, NULL,
"ref_recon_limiter_effect.solb"),
"export lim eff solb");
ref_mpi_stopwatch_stop(ref_mpi, "ref_recon_limiter_effect.solb");
ref_mpi_stopwatch_stop(ref_grid_mpi(ref_grid),
"ref_recon_limiter_effect.solb");
RSS(ref_edge_free(ref_edge), "free");
ref_free(grad);
ref_free(p);
Expand All @@ -143,6 +144,7 @@ int main(int argc, char *argv[]) {
RSS(ref_mpi_stop(), "stop");
return 0;
}

if (argc == 3) {
REF_GRID ref_grid;
REF_DBL *function, *derivatives, *scalar, *grad;
Expand Down

0 comments on commit 4c85852

Please sign in to comment.