Skip to content

Add A+ cohort#23

Open
pletzer wants to merge 13 commits into
phase3from
aplus
Open

Add A+ cohort#23
pletzer wants to merge 13 commits into
phase3from
aplus

Conversation

@pletzer

@pletzer pletzer commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

This requires a recent version of seapodym-parallel, one that has the aPlusCohort passed to the constructor

@pletzer
pletzer requested review from LucasBnnn and innasenina July 9, 2026 01:05
@pletzer

pletzer commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

This version adds support for A+ using graph-based scheduling. A+ is folded directly into the same SeapodymCohortDependencyAnalyzer task graph that already governs every other, normal cohort.

There is an A+ cohort for each time step. The A+ cohort IDs come after those of normal cohorts (no longer using negative IDs). So IDs for A+ run from na + nt - 1, na + nt, .... na + 2*nt - 2 (na = is the number of age groups, not counting A+).

Each A+ cohort has two dependencies: on A+'s own previous step and on normal "graduates" at the previous step.

All of this is dispatched by the same TaskStepManager/TaskStepWorker pair used for everything else; A+ tasks are just
another branch inside the existing taskFunction. No dedicated MPI rank, no extra communicator split, no custom message protocol — correctness follows directly from the dependency graph's existing "don't dispatch a task until every dependency is in the completed set" logic, a mechanism that was already in use and already exercised long before A+ existed.

@pletzer

pletzer commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

The previous results can be obtained by running seapodym_cohort with argument -no-aplus.

@pletzer

pletzer commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

For reference, below are the checksums for the phase3 and plus branches:

(base) apletzer@dhcp-163-7-130-140 density_skj_fat % mpiexec -n 2 ../../bin/seapodym_cohort_phase3 -s skj_fat_10_short_inna.xml
[0] Amount of data to be sent from workers to manager numData = 21792 numAgeGroups = 10 numTimeSteps = 2 numChunks = 20
[Manager] shutting down worker 1
[0] Checksum = 1884340.03929 time manager = 0.19969 sec
[1] Timings calc/overhead/worker init/cohort init/comm: 0.141/ 0.003/ 0.013/ 0.031/ 0.000
[1] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.000/0.000/0.000/0.025/0.003/0.001/0.000/0.002 s ; 0.023/0.000/0.037/2.480/3.482/0.854/0.029/2.474 ms over 1 inits
[1] Time IO/Put/Send/Idle: 13.098/0.265/0.000/0.284 ms
(base) apletzer@dhcp-163-7-130-140 density_skj_fat %
(base) apletzer@dhcp-163-7-130-140 density_skj_fat % mpiexec -n 10 ../../bin/seapodym_cohort_aplus -s skj_fat_10_short_inna.xml -no-aplus
[0] Amount of data to be sent from workers to manager numData = 21792 numAgeGroups = 10 numTimeSteps = 2 numChunks = 20 aPlus = off
[Manager] shutting down worker 1
[Manager] shutting down worker 2
[Manager] shutting down worker 3
[Manager] shutting down worker 4
[Manager] shutting down worker 5
[Manager] shutting down worker 6
[Manager] shutting down worker 7
[Manager] shutting down worker 8
[Manager] shutting down worker 9
[0] Checksum = 1884340.03929 (normal = 1884340.03929, A+ = 0.00000000e+00) time manager = 0.16374 sec
...

@pletzer

pletzer commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Below are the output for the largest case (100 cohorts). Execution time (phase3): 52s; (aplus): 45s

(base) apletzer@dhcp-163-7-130-140 density_skj_fat % mpiexec -n 10 ../../bin/seapodym_cohort_phase3 -s skj_Fat.xml
[0] Amount of data to be sent from workers to manager numData = 21792 numAgeGroups = 50 numTimeSteps = 480 numChunks = 24000
[Manager] shutting down worker 1
[Manager] shutting down worker 2
[Manager] shutting down worker 3
[Manager] shutting down worker 4
[Manager] shutting down worker 5
[Manager] shutting down worker 6
[Manager] shutting down worker 7
[Manager] shutting down worker 8
[Manager] shutting down worker 9
[5] Timings calc/overhead/worker init/cohort init/comm: 49.604/ 0.662/ 0.351/ 0.407/ 0.006
[5] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.047/0.000/0.016/0.144/0.236/0.145/0.004/0.023 s ; 0.874/0.001/0.292/2.874/4.371/2.684/0.070/0.429 ms over 54 inits
[5] Time IO/Put/Send/Idle: 1343.957/13054.024/0.000/3.556 ms
[2] Timings calc/overhead/worker init/cohort init/comm: 49.611/ 0.680/ 0.270/ 0.401/ 0.005
[2] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.047/0.000/0.015/0.140/0.233/0.143/0.005/0.022 s ; 0.876/0.001/0.278/2.804/4.320/2.639/0.097/0.409 ms over 54 inits
[2] Time IO/Put/Send/Idle: 1425.522/12909.736/0.000/4.165 ms
[6] Timings calc/overhead/worker init/cohort init/comm: 49.579/ 0.678/ 0.306/ 0.389/ 0.006
[6] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.045/0.000/0.013/0.136/0.227/0.143/0.004/0.021 s ; 0.844/0.001/0.238/2.713/4.276/2.702/0.068/0.404 ms over 53 inits
[6] Time IO/Put/Send/Idle: 1388.911/12868.719/0.000/4.173 ms
[8] Timings calc/overhead/worker init/cohort init/comm: 49.566/ 0.668/ 0.262/ 0.396/ 0.006
[8] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.046/0.000/0.016/0.132/0.237/0.149/0.004/0.022 s ; 0.859/0.001/0.306/2.644/4.479/2.817/0.071/0.406 ms over 53 inits
[8] Time IO/Put/Send/Idle: 1432.934/12867.844/0.000/3.117 ms
[1] Timings calc/overhead/worker init/cohort init/comm: 49.589/ 0.656/ 0.346/ 0.398/ 0.006
[1] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.041/0.000/0.013/0.146/0.225/0.145/0.004/0.022 s ; 0.782/0.004/0.239/2.922/4.247/2.729/0.067/0.408 ms over 53 inits
[1] Time IO/Put/Send/Idle: 1348.648/13013.833/0.000/10.196 ms
[3] Timings calc/overhead/worker init/cohort init/comm: 49.534/ 0.673/ 0.248/ 0.461/ 0.006
[3] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.051/0.000/0.014/0.168/0.258/0.164/0.004/0.023 s ; 0.967/0.001/0.268/3.359/4.862/3.100/0.069/0.437 ms over 53 inits
[3] Time IO/Put/Send/Idle: 1447.221/13045.923/0.000/3.505 ms
[7] Timings calc/overhead/worker init/cohort init/comm: 49.534/ 0.683/ 0.369/ 0.424/ 0.006
[7] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.045/0.000/0.013/0.166/0.231/0.147/0.004/0.021 s ; 0.843/0.001/0.247/3.318/4.353/2.774/0.073/0.396 ms over 53 inits
[7] Time IO/Put/Send/Idle: 1325.722/12898.139/0.000/5.400 ms
[9] Timings calc/overhead/worker init/cohort init/comm: 49.584/ 0.676/ 0.357/ 0.414/ 0.005
[9] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.051/0.000/0.016/0.137/0.250/0.156/0.004/0.023 s ; 0.949/0.001/0.289/2.745/4.630/2.887/0.065/0.417 ms over 54 inits
[9] Time IO/Put/Send/Idle: 1338.116/12897.973/0.000/6.459 ms
[4] Timings calc/overhead/worker init/cohort init/comm: 49.592/ 0.666/ 0.259/ 0.384/ 0.006
[4] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.042/0.000/0.012/0.143/0.215/0.136/0.004/0.021 s ; 0.814/0.001/0.226/2.852/4.141/2.617/0.068/0.396 ms over 52 inits
[4] Time IO/Put/Send/Idle: 1436.540/12792.835/0.000/4.340 ms
[0] Checksum = 657797994.04916 time manager = 51.71939 sec
(base) apletzer@dhcp-163-7-130-140 density_skj_fat %
(base) apletzer@dhcp-163-7-130-140 density_skj_fat %
(base) apletzer@dhcp-163-7-130-140 density_skj_fat %
(base) apletzer@dhcp-163-7-130-140 density_skj_fat %
(base) apletzer@dhcp-163-7-130-140 density_skj_fat % mpiexec -n 10 ../../bin/seapodym_cohort_aplus -s skj_Fat.xml -no-aplus
[0] Amount of data to be sent from workers to manager numData = 21792 numAgeGroups = 50 numTimeSteps = 480 numChunks = 24000 aPlus = off
[Manager] shutting down worker 1
[Manager] shutting down worker 2
[Manager] shutting down worker 3
[Manager] shutting down worker 4
[Manager] shutting down worker 5
[Manager] shutting down worker 6
[Manager] shutting down worker 7
[Manager] shutting down worker 8
[Manager] shutting down worker 9
[9] Timings calc/overhead/worker init/cohort init/comm: 42.299/ 0.709/ 0.397/ 0.413/ 0.007
[9] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.043/0.000/0.015/0.153/0.234/0.148/0.004/0.023 s ; 0.810/0.001/0.286/3.066/4.424/2.795/0.078/0.428 ms over 53 inits
[9] Time IO/Put/Send/Idle: 1573.545/2572.220/0.000/5.499 ms
[8] Timings calc/overhead/worker init/cohort init/comm: 42.234/ 0.725/ 0.399/ 0.409/ 0.005
[8] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.042/0.000/0.014/0.141/0.243/0.157/0.004/0.024 s ; 0.785/0.001/0.259/2.828/4.495/2.911/0.070/0.443 ms over 54 inits
[8] Time IO/Put/Send/Idle: 1573.120/2620.722/0.000/7.526 ms
[5] Timings calc/overhead/worker init/cohort init/comm: 42.206/ 0.719/ 0.396/ 0.451/ 0.006
[5] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.052/0.000/0.014/0.179/0.243/0.147/0.004/0.024 s ; 0.983/0.001/0.270/3.588/4.591/2.777/0.074/0.461 ms over 53 inits
[5] Time IO/Put/Send/Idle: 1575.443/2590.345/0.000/4.627 ms
[1] Timings calc/overhead/worker init/cohort init/comm: 42.214/ 0.719/ 0.398/ 0.429/ 0.005
[1] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.046/0.000/0.019/0.161/0.239/0.144/0.004/0.025 s ; 0.869/0.001/0.354/3.228/4.513/2.724/0.070/0.468 ms over 53 inits
[1] Time IO/Put/Send/Idle: 1572.747/2515.766/0.000/10.188 ms
[3] Timings calc/overhead/worker init/cohort init/comm: 42.258/ 0.712/ 0.398/ 0.447/ 0.007
[3] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.045/0.000/0.013/0.187/0.233/0.145/0.004/0.024 s ; 0.847/0.001/0.249/3.738/4.388/2.744/0.067/0.455 ms over 53 inits
[3] Time IO/Put/Send/Idle: 1572.801/2587.218/0.000/3.817 ms
[4] Timings calc/overhead/worker init/cohort init/comm: 42.252/ 0.738/ 0.396/ 0.451/ 0.007
[4] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.045/0.000/0.013/0.188/0.237/0.150/0.004/0.023 s ; 0.842/0.001/0.239/3.770/4.467/2.834/0.083/0.442 ms over 53 inits
[4] Time IO/Put/Send/Idle: 1576.070/2607.595/0.000/4.058 ms
[2] Timings calc/overhead/worker init/cohort init/comm: 42.217/ 0.717/ 0.399/ 0.421/ 0.007
[2] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.041/0.000/0.013/0.159/0.237/0.155/0.004/0.023 s ; 0.779/0.001/0.251/3.179/4.470/2.919/0.069/0.427 ms over 53 inits
[2] Time IO/Put/Send/Idle: 1572.253/2513.825/0.000/9.691 ms
[7] Timings calc/overhead/worker init/cohort init/comm: 42.295/ 0.709/ 0.395/ 0.390/ 0.005
[7] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.043/0.000/0.012/0.145/0.222/0.140/0.004/0.022 s ; 0.808/0.001/0.229/2.891/4.181/2.633/0.067/0.419 ms over 53 inits
[7] Time IO/Put/Send/Idle: 1576.070/2584.497/0.000/7.211 ms
[6] Timings calc/overhead/worker init/cohort init/comm: 42.243/ 0.717/ 0.400/ 0.431/ 0.005
[6] InitCohort comm/flush/copy/init_restart,init_spawning/spawning/getdata/xreset (tot, per-init ms): 0.050/0.000/0.018/0.141/0.262/0.165/0.004/0.024 s ; 0.922/0.001/0.329/2.829/4.856/3.051/0.077/0.449 ms over 54 inits
[6] Time IO/Put/Send/Idle: 1571.607/2563.932/0.000/4.426 ms
[0] Checksum = 657797994.04916 (normal = 657797994.04916, A+ = 0.00000000e+00) time manager = 44.70874 sec
(base) apletzer@dhcp-163-7-130-140 density_skj_fat %

@pletzer pletzer mentioned this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants