Curriculum previewThis is not your assigned passport. No identity, answers, or completion progress are stored here.How to start your passport
Mission / Euler CPU
02 / 0535 active minutesshared compute

Submit And Control A Tiny Euler CPU Job

You can distinguish login from compute nodes, submit one tiny CPU job with Slurm, inspect it, cancel it, and find its logs without computing on the login node.

Work hereeuler / bash
  1. 1Understand
  2. 2Do
  3. 3Check
  4. 4Submit
Learn firstConcept, example, trap and recovery

Outcome#

You can distinguish login from compute nodes, submit one tiny CPU job with Slurm, inspect it, cancel it, and find its logs without computing on the login node.

Concept#

Euler login nodes are shared control points. Resource-intensive programs belong in Slurm allocations, where CPU, memory, time, logs, and ownership are explicit.

Worked Example#

The job completes on a compute node with one CPU, 1 GiB per CPU, no GPU, a zero exit code, and bounded logs.

A correct example uses these decisions:

  • Where does the actual computation run? On a Slurm-allocated compute node.
  • The job is absent from squeue. What next? Use sacct and inspect the job logs; it may already have finished.

Common Trap#

Running work on the login node, resubmitting because squeue is empty, or losing the job ID before checking sacct.

If Blocked#

For an invalid account, stop and check my_share_info. For a pending job, inspect myjobs -j "$job_id" instead of submitting duplicates. Read the first meaningful error before changing resources. Use the first Euler job lab for recovery.

Useful references:

Understand Before Accepting AI Output#

Personally read the script, record the real job ID, know how to cancel it, and inspect output and accounting. An agent must not submit or enlarge the job.

Do the mission

One bounded attempt

Pass: 100% + every safety item
Action

Submit the provided two-minute, one-CPU script once; capture its job ID; inspect squeue; then inspect its output, sacct, and seff after completion.

Expected

The job completes on a compute node with one CPU, 1 GiB per CPU, no GPU, a zero exit code, and bounded logs.

Run only the commands for your machine

Step 1euler / bash
mkdir -p "$HOME/passport-euler/logs"
cd "$HOME/passport-euler"
cat > first-job.slurm <<'EOF'
#!/usr/bin/env bash
#SBATCH --job-name=passport-cpu
#SBATCH --account=es_fuge
#SBATCH --time=00:02:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1G
#SBATCH --output=logs/%x_%j.out
#SBATCH --error=logs/%x_%j.err

set -euo pipefail
echo "job_id=$SLURM_JOB_ID"
echo "host=$(hostname)"
echo "cpus=$SLURM_CPUS_PER_TASK"
for number in 1 2 3 4 5; do
  printf '%s squared is %s\n' "$number" "$((number * number))"
done
EOF
bash -n first-job.slurm
sed -n '1,80p' first-job.slurm

Expected: The complete bounded script is printed with account es_fuge, one CPU, 1 GiB per CPU, and a two-minute limit.

Step 2euler / bash
cd "$HOME/passport-euler" || exit 1
job_id="$(sbatch --parsable first-job.slurm)"
printf 'Submitted job: %s\n' "$job_id"

Expected: A numeric job ID is printed once.

Step 3euler / bash
squeue -j "$job_id"

Expected: The job is pending/running, or the header alone indicates it already left the queue.

Step 4euler / bash
sacct -X -j "$job_id" --format=JobID,User,Account,State,ExitCode,Elapsed,AllocCPUS,ReqMem,MaxRSS

Expected: The main job is owned by you, uses es_fuge, and eventually shows COMPLETED with exit code 0:0.

Step 5euler / bash
seff "$job_id"

Expected: The report names the same job and shows its CPU and memory use.

Step 6euler / bash
grep -Fx '5 squared is 25' "$HOME/passport-euler/logs/passport-cpu_${job_id}.out"

Expected: Exactly 5 squared is 25 is printed.

01Where does the actual computation run?Safety-critical
02The job is absent from squeue. What next?
Confirm the result you personally observed

These values are processed only by the local launcher. Private paths are not written to the public submission.

Before submitting
Open my real passport first
Preview onlyThis page can be read, but it cannot store or submit an attempt.