How lowgroundmikean/monte-carlo-integration-on-heart-4.2 works
This repository is an MPI research program for estimating the area of a planar heart and comparing whole-box sampling with vertical, horizontal, and 2-D stratification. Its main workflow runs experiments that emit per-stream CSV measurements, then analyzes those measurements into error, variance-reduction, and scaling summaries; a separate report generator also consumes the raw CSV. The C implementation is largely monolithic, so its sampling, geometry, RNG, and reduction responsibilities are shown as layers of the same source file. Analysis and report-generation links follow the README; unsampled job-launch and packaging machinery is omitted.
Main entry points: heart_mc.c MPI experiment driver · results_2451063.csv Per-stream measurements · analyze.py CSV analysis · build_reportp42.py PDF report generator
Components 14
Monte Carlo simulation
- MPI experiment driver
heart_mc.c - Stratum assignment
heart_mc.c - Point sampling
heart_mc.c - Heart membership test
heart_mc.c - Random stream generator
heart_mc.c - Stream initialization
heart_mc.c - MPI estimate reduction
heart_mc.c - CSV row output
heart_mc.c
Measurement data
- Per-stream measurements
results_2451063.csv
Results analysis
- CSV analysis
analyze.py - Tables and plot data
analyze.py
Research report
- PDF report generator
build_reportp42.py - Project report
Michael Guerrero-AMS 530-4.2 Paper.pdf
Other components
- Experiment operator
Connections 14
- Experiment operator → MPI experiment driver: launches
README.md - MPI experiment driver → Stratum assignment: assigns regions
heart_mc.c - MPI experiment driver → Stream initialization: initializes streams
heart_mc.c - Stream initialization → Random stream generator: seeds with SplitMix64
heart_mc.c - MPI experiment driver → Point sampling: draws points
heart_mc.c - Point sampling → Random stream generator: gets random values
heart_mc.c - Point sampling → Heart membership test: tests membership
heart_mc.c - MPI experiment driver → MPI estimate reduction: reduces estimates
heart_mc.c - MPI estimate reduction → CSV row output: returns total
heart_mc.c - CSV row output → Per-stream measurements: writes rows
heart_mc.c - Per-stream measurements → CSV analysis: loads measurements
analyze.py - CSV analysis → Tables and plot data: generates summaries
analyze.py - Per-stream measurements → PDF report generator: reads measurements
README.md - PDF report generator → Project report: generates PDF
README.md