Imported from SakshamDiwan/DistributedPanGA (
src/AGENTS.md). Install upstream withnpx skills add SakshamDiwan/DistributedPanGA --skill src. Copyright stays with the author.
src/ — implementation
Full symbol-level map: docs/agent/architecture.md. Constraints summary:
root AGENTS.md.
Layering, innermost first: constants.h → record/tables/pack/work_split
→ extract → sort → dsort (MPI) → kmer_adapter → contig_assignment →
fastga_pipeline → drivers (pga-*.c).
- One driver per phase;
pga-mpi-merge.cis the final one and defines the FastGA externs (NTHREADS,FREQ,IBYTE,NCONTS,RankForPair, …) thatfastga_pipeline.cdeclaresextern. Adding an extern means updating every driver that links the pipeline (pga-merge.ctoo). fastga_pipeline.cis lifted FastGA code, kept close to upstream on purpose. Match its brace and indentation style there rather than the surrounding code, and keep edits minimal so it stays diffable against FastGA.kmer_adapter.hstructs are cast toKmer_Stream/Post_List. Field order and widths are load-bearing — never reorder, insert, or change a type.#include "constants.h"definesKMER 40, which collides with the runtimeint KMERin the merge drivers;pga-mpi-merge.c#undef KMERafter its includes. Preserve that if you add includes.- Buffers get
+1byte formsd_sort's sentinel;Get_Contig_Piececallers passbuf+1for itsbuffer[-1]sentinel. Both are easy to lose in a refactor and fail silently. sort_recordshardcodes 4 threads; the merge drivers hardcodeNTHREADS=1andFREQ=10. No env var overrides these.- Errors in MPI code paths call
MPI_Abortwith a distinct code (2 = local sort check, 3 = boundary check). Keep codes distinct.
Headers are not Makefile prerequisites — after editing any .h here, rebuild
with make -B or the binary will be stale. See docs/agent/build.md.