t8_time_new_refine.c - DLR-AMR/t8code GitHub Wiki

t8_time_new_refine

Overview

The t8_time_new_refine.c benchmark measures the time taken to perform refinement and coarsening operations on adaptive meshes using t8code's capabilities. This benchmark is useful for assessing the scalability and efficiency of t8code's AMR algorithms.


Execution

Run the benchmark using MPI:

mpirun -np <num_processes> ./t8_time_new_refine

Replace <num_processes> with the desired number of MPI processes.


Command-Line Options

To see all options:

./t8_time_new_refine -h
Option Description Default
-s, --slevel Initial refinement level (minimum level, start level) 0
-e, --elevel Final refinement level (should be >= start level, else set to start level) 0
-d, --dim Dimension of the mesh: 2 for 2D (triangles), 3 for 3D (tetrahedra) 2
-r, --refine Run and time refinement & coarsening from slevel to elevel (default ON, unless -n is set) ON
-n, --new Time the creation of a new forest at slevel (default OFF, enable with this switch) OFF

Example Usage

mpirun -np 4 ./t8_time_new_refine -s 2 -e 5 -d 3

This runs the benchmark in 3D, from refinement level 2 to 5, with 4 MPI processes.


What the Program Does

  • Refine & Coarsen (--refine): For each level from slevel to elevel, the program creates a mesh, refines it up to elevel, then coarsens it back down, measuring the time taken for each operation.
  • New Forest (--new): Creates a brand-new mesh (forest) at slevel and measures how long it takes.

You can run either or both of these timing benchmarks by passing the appropriate switches.


Output

At the end, the program prints timing statistics (in seconds) for:

  • Adapt: refinement/coarsening cycles.
  • New: new mesh creation.

If an invalid combination of options is provided (like -e less than -s), or if the dimension is not 2 or 3, the program prints a usage message and exits.


Interpretation

  • "New" time: how long it takes to construct a forest (mesh) at a given level from scratch.
  • "Adapt" time: cumulative time for adapting (refining up and coarsening down) between the start and end levels.
  • By running with different process counts and mesh sizes, you can study t8code's performance and scalability.

Troubleshooting

  • If the program does not start or reports missing libraries, check your t8code build and MPI setup.
  • Ensure you are using the correct path to the executable.
  • Pass -h to see usage.