Commit 13616b3b authored by saad.aswad's avatar saad.aswad

[Final] Add SimGrid and scripts

parent 02281e68
......@@ -8,4 +8,26 @@ Implementation of Prefix Sum and Tree-based Reduce using mpi4py.
- OpenMPI (System installed)
## Usage
Run via `run_tests.sh`.
### 1. Parallel Prefix Sum (Problem 1)
```bash
mpiexec -n <NP> python3 src/problem1/prefix_sum.py
```
### 2. Manual Tree Reduce & Benchmark (Problem 2)
```bash
mpiexec -n <NP> python3 src/problem2/benchmark.py
```
### 3. SimGrid Simulation
SimGrid configurations are provided in `simgrid/`.
To run with SimGrid (if SMPI/Python bindings are configured):
```bash
smpirun -platform simgrid/platform.xml -hostfile ... python3 src/problem2/benchmark.py
```
## Running Tests
Execute the helper script:
```bash
bash run_tests.sh
```
#!/bin/bash
set -e
echo "Running Problem 1: Prefix Sum (NP=3)"
mpiexec -n 3 python3 src/problem1/prefix_sum.py
echo "-----------------------------------"
echo "Running Problem 2: Manual Reduce Benchmark (NP=3)"
mpiexec -n 3 python3 src/problem2/benchmark.py
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4.1">
<!-- Actor deployment -->
<process host="node-0" function="python">
<argument value="src/problem2/benchmark.py"/>
</process>
<process host="node-1" function="python">
<argument value="src/problem2/benchmark.py"/>
</process>
<process host="node-2" function="python">
<argument value="src/problem2/benchmark.py"/>
</process>
</platform>
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4.1">
<zone id="AS0" routing="Full">
<!-- Cluster of 3 nodes, 4 cores each -->
<host id="node-0" speed="100Mf" core="4"/>
<host id="node-1" speed="100Mf" core="4"/>
<host id="node-2" speed="100Mf" core="4"/>
<link id="link-0" bandwidth="125MBps" latency="100us"/>
<link id="link-1" bandwidth="125MBps" latency="100us"/>
<link id="link-2" bandwidth="125MBps" latency="100us"/>
<route src="node-0" dst="node-1"><link_ctn id="link-0"/><link_ctn id="link-1"/></route>
<route src="node-1" dst="node-2"><link_ctn id="link-1"/><link_ctn id="link-2"/></route>
<route src="node-0" dst="node-2"><link_ctn id="link-0"/><link_ctn id="link-2"/></route>
</zone>
</platform>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment