Skip to content

Commit 6dbcb66

Browse files
committed
phase 2 shell script added
1 parent df52a58 commit 6dbcb66

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

hpc/run_phase4.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
#SBATCH --job-name=pp_phase4
3+
#SBATCH --partition=rome
4+
#SBATCH --nodes=1
5+
#SBATCH --ntasks=1
6+
#SBATCH --cpus-per-task=64
7+
#SBATCH --time=04:00:00
8+
#SBATCH --mem=64G
9+
#SBATCH --output=/home/kanagnostopoul/CSS_Project/pp_phase4_%j.out
10+
#SBATCH --error=/home/kanagnostopoul/CSS_Project/pp_phase4_%j.err
11+
12+
# =============================================================================
13+
# PP Hydra Effect - Phase 4: Global Sensitivity Analysis
14+
# =============================================================================
15+
#
16+
# PHASE 4: Full 4D Parameter Sweep (Global Sensitivity)
17+
# - Parameters: prey_birth, prey_death, pred_birth, pred_death
18+
# - Sweep: 0.0 to 1.0 (11 values each) = 14,641 combinations
19+
# - Replicates: 10 per combination
20+
# - Total Simulations: ~146,410
21+
# - Grid Size: 250x250
22+
#
23+
# SUBMIT: sbatch run_phase4.sh
24+
# MONITOR: squeue -u $USER
25+
# CANCEL: scancel <job_id>
26+
#
27+
# =============================================================================
28+
29+
cd /home/kanagnostopoul/CSS_Project || exit 1
30+
31+
echo "========================================"
32+
echo "PP Hydra Effect - Phase 4"
33+
echo "========================================"
34+
echo "Job ID: $SLURM_JOB_ID"
35+
echo "Node: $(hostname)"
36+
echo "CPUs: $SLURM_CPUS_PER_TASK"
37+
echo "Start: $(date)"
38+
echo "Working dir: $(pwd)"
39+
echo "========================================"
40+
41+
# -----------------------------------------------------------------------------
42+
# Environment Setup
43+
# -----------------------------------------------------------------------------
44+
source ~/snellius_venv/bin/activate
45+
46+
# Prevent numpy/scipy from spawning extra threads (joblib handles parallelism)
47+
export OMP_NUM_THREADS=1
48+
export OPENBLAS_NUM_THREADS=1
49+
export MKL_NUM_THREADS=1
50+
export NUMEXPR_NUM_THREADS=1
51+
52+
# -----------------------------------------------------------------------------
53+
# Run Phase 4
54+
# -----------------------------------------------------------------------------
55+
OUTPUT_DIR="results/phase4_${SLURM_JOB_ID}"
56+
mkdir -p $OUTPUT_DIR
57+
58+
echo ""
59+
echo "Output directory: $OUTPUT_DIR"
60+
echo ""
61+
62+
# Dry run first to verify setup and runtime estimate
63+
echo "Dry run check:"
64+
python3 -u scripts/experiments.py \
65+
--phase 4 \
66+
--output $OUTPUT_DIR \
67+
--cores $SLURM_CPUS_PER_TASK \
68+
--dry-run
69+
70+
echo ""
71+
echo "Starting Phase 4 (4D Sweep)..."
72+
echo ""
73+
74+
# Run phase 4
75+
python3 -u scripts/experiments.py \
76+
--phase 4 \
77+
--output $OUTPUT_DIR \
78+
--cores $SLURM_CPUS_PER_TASK
79+
80+
# -----------------------------------------------------------------------------
81+
# Completion
82+
# -----------------------------------------------------------------------------
83+
echo ""
84+
echo "========================================"
85+
echo "Phase 4 Complete"
86+
echo "========================================"
87+
echo "End time: $(date)"
88+
echo "Results in: $OUTPUT_DIR/"
89+
echo ""
90+
echo "Output files:"
91+
ls -lh $OUTPUT_DIR/
92+
echo ""
93+
echo "Next steps:"
94+
echo " 1. Download phase4_results.jsonl"
95+
echo " 2. Perform Global Sensitivity Analysis (Sobol Indices)"
96+
echo " 3. Identify parameter dominance for extinction events"
97+
echo " 4. Plot parameter heatmaps for predator/prey survival"
98+
echo "========================================"

0 commit comments

Comments
 (0)