How hballington12/pbt works
Project type and purpose
• This is a scientific, HPC‐oriented command-line application (“PBT”) written primarily in Fortran 90, with optional C support for mesh triangulation.
• It computes light scattering (near‐field via geometric optics and far‐field via vector diffraction) for arbitrarily shaped particles.
• It provides both sequential and MPI‐parallel implementations for orientation averaging, plus optional OpenMP threading.
File structure
• Top level
• README.md, LICENSE, .gitignore: project meta-data
• apertures.dat, examples/: sample input data
• cache/: checkpointing mechanism (intermediate saves)
• template/: shell scripts for job submission (MPI, sequential, looping)
• src/
• main_seq.f90 & main_mpi.f90: two entry points
• modules (*.f90): domain logic split into bvh_mod, beam_loop_mod, diff_mod, input_mod, outputs_mod, types_mod, mpi_mod/pbt_mpi_mod, pbt_seq_mod
• subdirectories
– mpi/ & seq/: Makefiles and wrapper code for each build target
– tri/: C code (“Triangle”) for automatic mesh triangulation
– test/: unit-test harness with sample files
• Build scripts
• Makefiles under src/seq, src/mpi, src/tri, src/test—govern sequential, MPI, triangulation, and test builds
Key insights from README
• Core pipeline: parse CLI flags → generate/read particle geometry → (optional) triangulate mesh → compute near-field (geometric optics + parent grouping) → compute far-field (vector diffraction) → write outputs.
• MPI version handles orientation averaging by distributing particle rotations across ranks.
• OpenMP can be enabled within modules (e.g., diffraction loops).
• Caches intermediate beam trees for restart/resume.