Skip to content

Commit 129e3d7

Browse files
committed
phase 1.5.2 with 4k step warmup up
1 parent e930b22 commit 129e3d7

10 files changed

Lines changed: 818 additions & 13 deletions

File tree

docs/HPC_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ watch -n 10 "ls -1 results_JOBID | wc -l"
4848
4949
# Fetching the results once the job is done
5050
51-
scp -r kanagnostopoul@snellius.surf.nl:~/CSS_Project/results/phase3_18744380/ ./results/
51+
scp -r kanagnostopoul@snellius.surf.nl:~/CSS_Project/results/phase1_18777691/ ./results/
5252
```
5353

5454
The jobscript template can be found in ```run_analysis.sh``` (default rome paritition).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2026-01-27 17:58:08,406 [INFO] ============================================================
2+
2026-01-27 17:58:08,406 [INFO] PREDATOR-PREY HYDRA EFFECT EXPERIMENTS
3+
2026-01-27 17:58:08,406 [INFO] ============================================================
4+
2026-01-27 17:58:08,406 [INFO] Phases: [1]
5+
2026-01-27 17:58:08,406 [INFO] Output: results/phase1_18777691
6+
2026-01-27 17:58:08,406 [INFO] Cores: 128
7+
2026-01-27 17:58:08,406 [INFO] Numba: ENABLED
8+
2026-01-27 17:58:08,407 [INFO]
9+
2026-01-27 17:58:08,407 [INFO] ============================================================
10+
2026-01-27 17:58:08,407 [INFO] PHASE 1
11+
2026-01-27 17:58:08,407 [INFO] ============================================================
12+
2026-01-27 17:58:08,407 [INFO] Estimated: 9,000 sims, ~8.3h on 128 cores (~1058 core-hours)
13+
2026-01-27 17:58:08,407 [INFO] Dry run - skipping execution
14+
2026-01-27 17:58:08,407 [INFO]
15+
2026-01-27 17:58:08,407 [INFO] ============================================================
16+
2026-01-27 17:58:08,407 [INFO] EXPERIMENTS COMPLETE
17+
2026-01-27 17:58:08,407 [INFO] ============================================================
18+
2026-01-27 17:58:09,408 [INFO] ============================================================
19+
2026-01-27 17:58:09,408 [INFO] PREDATOR-PREY HYDRA EFFECT EXPERIMENTS
20+
2026-01-27 17:58:09,408 [INFO] ============================================================
21+
2026-01-27 17:58:09,408 [INFO] Phases: [1]
22+
2026-01-27 17:58:09,408 [INFO] Output: results/phase1_18777691
23+
2026-01-27 17:58:09,408 [INFO] Cores: 128
24+
2026-01-27 17:58:09,408 [INFO] Numba: ENABLED
25+
2026-01-27 17:58:09,408 [INFO]
26+
2026-01-27 17:58:09,408 [INFO] ============================================================
27+
2026-01-27 17:58:09,408 [INFO] PHASE 1
28+
2026-01-27 17:58:09,408 [INFO] ============================================================
29+
2026-01-27 17:58:09,408 [INFO] Estimated: 9,000 sims, ~8.3h on 128 cores (~1058 core-hours)
30+
2026-01-27 17:58:10,150 [INFO] Phase 1: 600 simulations
31+
2026-01-27 17:58:10,151 [INFO] Grid: 20 prey_death values × 30 reps (prey_birth=0.2)
32+
2026-01-27 18:15:49,810 [INFO] Phase 1 complete. Results: results/phase1_18777691/phase1_results.jsonl
33+
2026-01-27 18:15:49,850 [INFO] Phase 1 runtime: 17.7 minutes
34+
2026-01-27 18:15:49,850 [INFO]
35+
2026-01-27 18:15:49,850 [INFO] ============================================================
36+
2026-01-27 18:15:49,850 [INFO] EXPERIMENTS COMPLETE
37+
2026-01-27 18:15:49,850 [INFO] ============================================================
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"grid_size": 1000,
3+
"densities": [
4+
0.3,
5+
0.15
6+
],
7+
"grid_sizes": [
8+
50,
9+
100,
10+
250,
11+
500,
12+
1000,
13+
2500
14+
],
15+
"prey_birth": 0.2,
16+
"prey_death": 0.05,
17+
"predator_birth": 0.8,
18+
"predator_death": 0.05,
19+
"critical_prey_birth": 0.2,
20+
"critical_prey_death": 0.947,
21+
"prey_death_range": [
22+
0.09,
23+
0.12
24+
],
25+
"n_prey_birth": 15,
26+
"n_prey_death": 20,
27+
"predator_birth_values": [
28+
0.15,
29+
0.2,
30+
0.25,
31+
0.3
32+
],
33+
"predator_death_values": [
34+
0.05,
35+
0.1,
36+
0.15,
37+
0.2
38+
],
39+
"prey_death_offsets": [
40+
-0.02,
41+
-0.01,
42+
0.0,
43+
0.01,
44+
0.02
45+
],
46+
"n_replicates": 30,
47+
"warmup_steps": 4000,
48+
"measurement_steps": 1000,
49+
"with_evolution": false,
50+
"evolve_sd": 0.1,
51+
"evolve_min": 0.0,
52+
"evolve_max": 0.1,
53+
"sensitivity_sd_values": [
54+
0.02,
55+
0.05,
56+
0.1,
57+
0.15,
58+
0.2
59+
],
60+
"synchronous": false,
61+
"directed_hunting": false,
62+
"directed_hunting_values": [
63+
false,
64+
true
65+
],
66+
"save_timeseries": false,
67+
"timeseries_subsample": 10,
68+
"collect_pcf": false,
69+
"pcf_sample_rate": 0.2,
70+
"pcf_max_distance": 20.0,
71+
"pcf_n_bins": 20,
72+
"min_density_for_analysis": 0.002,
73+
"perturbation_magnitude": 0.1,
74+
"n_jobs": 128
75+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"phase": 1,
3+
"description": "Parameter sweep for critical point",
4+
"n_sims": 600,
5+
"timestamp": "2026-01-27 18:15:49",
6+
"config": {
7+
"grid_size": 1000,
8+
"densities": [
9+
0.3,
10+
0.15
11+
],
12+
"grid_sizes": [
13+
50,
14+
100,
15+
250,
16+
500,
17+
1000,
18+
2500
19+
],
20+
"prey_birth": 0.2,
21+
"prey_death": 0.05,
22+
"predator_birth": 0.8,
23+
"predator_death": 0.05,
24+
"critical_prey_birth": 0.2,
25+
"critical_prey_death": 0.947,
26+
"prey_death_range": [
27+
0.09,
28+
0.12
29+
],
30+
"n_prey_birth": 15,
31+
"n_prey_death": 20,
32+
"predator_birth_values": [
33+
0.15,
34+
0.2,
35+
0.25,
36+
0.3
37+
],
38+
"predator_death_values": [
39+
0.05,
40+
0.1,
41+
0.15,
42+
0.2
43+
],
44+
"prey_death_offsets": [
45+
-0.02,
46+
-0.01,
47+
0.0,
48+
0.01,
49+
0.02
50+
],
51+
"n_replicates": 30,
52+
"warmup_steps": 4000,
53+
"measurement_steps": 1000,
54+
"with_evolution": false,
55+
"evolve_sd": 0.1,
56+
"evolve_min": 0.0,
57+
"evolve_max": 0.1,
58+
"sensitivity_sd_values": [
59+
0.02,
60+
0.05,
61+
0.1,
62+
0.15,
63+
0.2
64+
],
65+
"synchronous": false,
66+
"directed_hunting": false,
67+
"directed_hunting_values": [
68+
false,
69+
true
70+
],
71+
"save_timeseries": false,
72+
"timeseries_subsample": 10,
73+
"collect_pcf": false,
74+
"pcf_sample_rate": 0.2,
75+
"pcf_max_distance": 20.0,
76+
"pcf_n_bins": 20,
77+
"min_density_for_analysis": 0.002,
78+
"perturbation_magnitude": 0.1,
79+
"n_jobs": 128
80+
}
81+
}

hpc_data/phase1.5.2_18777691/phase1_results.jsonl

Lines changed: 600 additions & 0 deletions
Large diffs are not rendered by default.

scripts/experiments.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -646,29 +646,36 @@ def run_phase5(cfg: Config, output_dir: Path, logger: logging.Logger) -> List[Di
646646
return all_results
647647

648648

649-
650-
def run_phase4(cfg: Config, output_dir: Path, logger: logging.Logger) -> List[Dict]:
649+
def run_phase6(cfg: Config, output_dir: Path, logger: logging.Logger) -> List[Dict]:
651650
"""
652-
Phase 4: Global Sensitivity Analysis.
651+
Phase 6: Model Extensions - Directed Hunting Comparison.
652+
653+
Same 4D sweep as Phase 4, but with directed_hunting=True.
653654
Vary: prey_birth, prey_death, predator_birth, predator_death
654655
Range: 0-1 (11 values each)
655656
Reps: 10
656657
Grid size: 250
658+
659+
Compare results with Phase 4 to assess impact of directed hunting on:
660+
- Critical point location
661+
- Hydra effect persistence
662+
- SOC signatures
657663
"""
658664
from joblib import Parallel, delayed
659665
import itertools
660666

661667
warmup_numba_kernels(cfg.grid_size, directed_hunting=cfg.directed_hunting)
662668

663-
# Define the global sweep values
669+
# Define the global sweep values (same as Phase 4)
664670
sweep_values = np.linspace(0.0, 1.0, 11)
665671

666672
# Logging
667-
logger.info(f"Phase 4: Full 4D Parameter Sweep")
673+
logger.info(f"Phase 6: Full 4D Parameter Sweep (Directed Hunting)")
668674
logger.info(f" Parameters: prey_birth, prey_death, pred_birth, pred_death")
669675
logger.info(f" Range: 0.0 to 1.0 (11 steps)")
670676
logger.info(f" Grid Size: {cfg.grid_size}")
671677
logger.info(f" Replicates: {cfg.n_replicates}")
678+
logger.info(f" Directed Hunting: {cfg.directed_hunting}")
672679

673680
param_grid = itertools.product(sweep_values, repeat=4)
674681

@@ -677,11 +684,13 @@ def run_phase4(cfg: Config, output_dir: Path, logger: logging.Logger) -> List[Di
677684
for pb, pd, pred_b, pred_d in param_grid:
678685
for rep in range(cfg.n_replicates):
679686
# Create params dict for unique seed generation
687+
# Include phase identifier to ensure different seeds from Phase 4
680688
params_id = {
681689
"pb": pb,
682690
"pd": pd,
683691
"pred_b": pred_b,
684692
"pred_d": pred_d,
693+
"phase": 6,
685694
"rep": rep
686695
}
687696
seed = generate_unique_seed(params_id, rep)
@@ -700,34 +709,37 @@ def run_phase4(cfg: Config, output_dir: Path, logger: logging.Logger) -> List[Di
700709
))
701710

702711
logger.info(f" Total simulations: {len(jobs):,}")
703-
output_jsonl = output_dir / "phase4_results.jsonl"
712+
713+
output_jsonl = output_dir / "phase6_results.jsonl"
704714
all_results = []
705715

706716
with open(output_jsonl, "w", encoding="utf-8") as f:
707717
executor = Parallel(n_jobs=cfg.n_jobs, return_as="generator")
708718
tasks = (delayed(run_single_simulation)(*job) for job in jobs)
709719

710720
# tqdm shows progress for the massive job list
711-
for result in tqdm(executor(tasks), total=len(jobs), desc="Phase 4 (4D Sweep)"):
721+
for result in tqdm(executor(tasks), total=len(jobs), desc="Phase 6 (4D Sweep + Directed)"):
712722
f.write(json.dumps(result, default=str) + "\n")
713723
f.flush()
714724
all_results.append(result)
715725

716-
# 4. Save Metadata
726+
# Save Metadata
717727
meta = {
718-
"phase": 4,
719-
"description": "Global 4D Sensitivity Analysis",
728+
"phase": 6,
729+
"description": "Global 4D Sensitivity Analysis with Directed Hunting",
720730
"sweep_values": sweep_values.tolist(),
721731
"parameters_varied": ["prey_birth", "prey_death", "predator_birth", "predator_death"],
732+
"directed_hunting": cfg.directed_hunting,
722733
"n_sims": len(all_results),
723734
"timestamp": time.strftime("%Y-%m-%d %H:%M:%S"),
724735
"config": asdict(cfg),
725736
}
726-
with open(output_dir / "phase4_metadata.json", "w") as f:
737+
with open(output_dir / "phase6_metadata.json", "w") as f:
727738
json.dump(meta, f, indent=2, default=str)
728739

729-
logger.info(f"Phase 4 complete. Results: {output_jsonl}")
740+
logger.info(f"Phase 6 complete. Results: {output_jsonl}")
730741
return all_results
742+
731743
# =============================================================================
732744
# Main:
733745
# =============================================================================

0 commit comments

Comments
 (0)