Skip to content

Commit

Permalink
measure locked tets
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Sep 27, 2021
1 parent 232ed20 commit ba56d11
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/ref_validation_test.c
Expand Up @@ -97,6 +97,43 @@ int main(int argc, char *argv[]) {
RSS(ref_mpi_start(argc, argv), "start");
RSS(ref_mpi_create(&ref_mpi), "create");

RXS(ref_args_find(argc, argv, "--unlock", &pos), REF_NOT_FOUND, "arg search");
if (REF_EMPTY != pos) {
REF_GRID ref_grid;
REF_INT hits, four;
REF_CELL ref_cell;
REF_INT cell, nodes[REF_CELL_MAX_SIZE_PER], cell_node;
REIS(3, argc, " ref_validation_test --unlock grid.extension");
if (ref_mpi_para(ref_mpi)) {
if (ref_mpi_once(ref_mpi)) printf("part %s\n", argv[2]);
RSS(ref_part_by_extension(&ref_grid, ref_mpi, argv[2]), "part");
ref_mpi_stopwatch_stop(ref_mpi, "part");
} else {
if (ref_mpi_once(ref_mpi)) printf("import %s\n", argv[2]);
RSS(ref_import_by_extension(&ref_grid, ref_mpi, argv[2]), "import");
ref_mpi_stopwatch_stop(ref_mpi, "import");
}
four = 0;
ref_cell = ref_grid_tet(ref_grid);
each_ref_cell_valid_cell_with_nodes(ref_cell, cell, nodes) {
hits = 0;
each_ref_cell_cell_node(ref_cell, cell_node) {
if (!ref_cell_node_empty(ref_grid_tri(ref_grid), nodes[cell_node]))
hits++;
}
if (4 == hits) four++;
}
hits = four;
RSS(ref_mpi_sum(ref_mpi, &hits, &four, 1, REF_INT_TYPE), "sum");
RSS(ref_mpi_bcast(ref_mpi, &four, 1, REF_INT_TYPE), "bcast");
if (ref_mpi_once(ref_mpi)) printf("locked tets %d\n", four);

RSS(ref_grid_free(ref_grid), "free");
RSS(ref_mpi_free(ref_mpi), "free");
RSS(ref_mpi_stop(), "stop");
return 0;
}

RXS(ref_args_find(argc, argv, "--const", &pos), REF_NOT_FOUND, "arg search");
if (REF_EMPTY != pos) {
REF_GRID ref_grid;
Expand Down

0 comments on commit ba56d11

Please sign in to comment.