YENRA — SLURM LEARNING EXAMPLE
https://yenra.com/linux-cluster-supercomputer/
September 5, 2026

Purpose: observe resource allocation, independent task ranks, and checked
output. This is not an MPI program or a performance benchmark. Each of four
Python processes sums the squares of its assigned 2,500 integers.

Prerequisites and site adaptation:
1. Use a training allocation approved by your cluster administrator.
2. Extract all files into a directory shared at the same path by the
   allocated compute nodes. Slurm does not automatically transfer these
   Python files. Use LF line endings for learning.sbatch.
3. Ensure python3 is on PATH on the compute nodes. If environment modules
   are needed, insert the site's documented commands after the directives
   and before srun; module names are site-specific.
4. Add the account, partition or QoS directives required by your site.
   Requests must fit site limits. The example asks for two nodes, four
   total tasks, two tasks per node, one CPU per task, 1G memory per node,
   and a two-minute runtime limit. These resources are oversized for the
   tiny calculation, solely to make placement visible.
5. From that directory, run: sbatch learning.sbatch
   Record the returned job ID. Submission does not mean execution finished.
6. Monitor: squeue -j JOBID (substitute the returned ID).
7. After completion, inspect yenra-JOBID.err and the JSON records in
   yenra-JOBID.out. Output rank order is not guaranteed.
8. Check: python3 check_results.py yenra-JOBID.out
   Expected: Verified 4 ranks; sum of squares 1..10000 = 333383335000
9. Where accounting is available, inspect job and step states:
   sacct -j JOBID --format=JobID,State,ExitCode,Elapsed,AllocCPUS

The checker validates ranks, intervals, partial sums and total; it does
not prove placement on two physical hosts. Inspect host fields and the
site's allocation/accounting records for placement evidence.

Verification scope: the Python tasks and checker were executed locally
with four simulated Slurm ranks. Correct, reordered, incomplete, duplicate
and corrupted output cases were checked. Bash syntax was checked. No live
Slurm cluster was available, so scheduling, node placement and site-specific
runtime behavior must be validated on the target training cluster.

Fictional scaling data from the article (not this program):
Nodes:          1       2       4       8
Elapsed min:  120      66      39      30
Speedup:     1.00    1.82    3.08    4.00
Efficiency: 100.0%   90.9%   76.9%   50.0%
Four to eight nodes: elapsed falls 23.1%; allocated node-minutes rise
from 156 to 240 (53.8%). These are not energy or billing measurements.
