How milanfusco/mcframework works
mcframework is a Python Monte Carlo simulation library. Its principal workflow is to define or register a simulation, run it with a selected execution strategy, and receive structured results with statistical summaries. The graph also preserves the built-in simulation domains, convergence validation, benchmarking, and profiling capabilities. Several backend and analytics internals are represented at their module paths; unsampled implementation details are not inferred.
Main entry points: simulation.py Simulation Runner · torch.py Torch Backend Selector · core.py Simulation Registry · torch_base.py Torch Shared Utilities
Components 20
Simulation API
- Simulation Registry
src/mcframework/core.py - Simulation Runner
src/mcframework/simulation.py - Simulation Result
src/mcframework/core.py
Simulation Domains
- Pi Estimation
src/mcframework/sims/pi.py - Black-Scholes Options
src/mcframework/sims/black_scholes.py - Portfolio Simulation
src/mcframework/sims/portfolio.py
Execution Backends
- Backend Protocol
src/mcframework/backends/base.py - Sequential Backend
src/mcframework/backends/sequential.py - Thread and Process
src/mcframework/backends/parallel.py - Torch Backend Selector
src/mcframework/backends/torch.py - Torch Shared Utilities
src/mcframework/backends/torch_base.py - Torch CPU
src/mcframework/backends/torch_cpu.py - Torch CUDA
src/mcframework/backends/torch_cuda.py - Torch MPS
src/mcframework/backends/torch_mps.py
Analytics and Tools
- Statistics Engine
src/mcframework/stats_engine.py - Critical Values
src/mcframework/utils.py - Convergence Validation
src/mcframework/validation.py - Backend Benchmarking
src/mcframework/benchmark.py - Torch Profiling
src/mcframework/profiling.py
Other components
- Python User
Connections 27
- Python User → Simulation Registry: registers
README.md - Python User → Simulation Runner: runs
README.md - Simulation Registry → Simulation Runner: runs simulation
src/mcframework/core.py - Simulation Registry → Simulation Result: stores results
src/mcframework/core.py - Simulation Runner → Simulation Result: returns
README.md - Simulation Runner → Sequential Backend: dispatches
src/mcframework/simulation.py - Simulation Runner → Thread and Process: dispatches
src/mcframework/simulation.py - Simulation Runner → Torch Backend Selector: dispatches
src/mcframework/simulation.py - Sequential Backend → Backend Protocol: implements
src/mcframework/backends/__init__.py - Thread and Process → Backend Protocol: implements
src/mcframework/backends/__init__.py - Torch Backend Selector → Torch CPU: selects device
src/mcframework/backends/torch.py - Torch Backend Selector → Torch CUDA: selects device
src/mcframework/backends/torch.py - Torch Backend Selector → Torch MPS: selects device
src/mcframework/backends/torch.py - Torch CPU → Torch Shared Utilities: uses utilities
src/mcframework/backends/torch_cpu.py - Torch CUDA → Torch Shared Utilities: uses utilities
src/mcframework/backends/torch_cuda.py - Torch MPS → Torch Shared Utilities: uses utilities
src/mcframework/backends/torch_mps.py - Simulation Runner → Statistics Engine: computes metrics
src/mcframework/simulation.py - Statistics Engine → Critical Values: uses critical values
src/mcframework/stats_engine.py - Simulation Runner → Convergence Validation: validates convergence
src/mcframework/validation.py - Python User → Convergence Validation: requests validation
README.md - Python User → Backend Benchmarking: requests benchmarks
README.md - Backend Benchmarking → Simulation Runner: runs workloads
- Python User → Torch Profiling: profiles execution
README.md - Torch Profiling → Torch Backend Selector: wraps backend
src/mcframework/profiling.py - Simulation Runner → Pi Estimation: runs simulation
README.md - Simulation Runner → Black-Scholes Options: runs simulation
README.md - Simulation Runner → Portfolio Simulation: runs simulation
README.md