CRAM → FASTQ conversion: efficiency & cost comparison
All 4 approaches convert the same CRAM inputs to paired
FASTQ (12 array tasks each). Metrics from the Slurm accounting database; cost
from the SIT job-cost API.
Summary
| Metric | Approach A - 8 CPU / 100 GB requested | Approach B - 6 CPU / 6 GB requested | Approach C - 3 CPU / 3 GB requested | Approach D - 4 CPU / 4 GB requested |
|---|
| Array tasks | 12 | 12 | 12 | 12 |
| CPUs requested | 8 | 6 | 3 | 4 |
| CPU efficiency (mean) | 12.5% | 68.0% | 92.6% | 88.6% |
| Effective CPUs used | 1.0 | 4.1 | 2.8 | 3.5 |
| Memory requested | 97.7 GB | 6.0 GB | 3.0 GB | 4.0 GB |
| Max RSS (mean) | 90.1 GB | 6.0 GB | 3.0 GB | 4.0 GB |
| Memory efficiency (mean) | 92% | 100% | 100% | 100% |
| Wall time (mean) | 02:15:33 | 00:05:28 | 00:07:40 | 00:05:58 |
| Total cost | 4.96 | 0.0708 | 0.0496 | 0.0515 |
What the numbers show
- Approach A requests 8 CPUs but reaches only 12% CPU efficiency — effectively 1.0 core(s). It runs single-threaded, so the other allocated cores sit idle while it also pins ~90 GB RAM for the whole run.
- Approach B reaches 68% efficiency across 6 CPUs (~4.1 cores) with 6 GB, finishing in 00:05:28 (mean) at a cost of 0.0708.
- Approach C reaches 93% efficiency across 3 CPUs (~2.8 cores) with 3 GB, finishing in 00:07:40 (mean) at a cost of 0.0496.
- Approach D reaches 89% efficiency across 4 CPUs (~3.5 cores) with 4 GB, finishing in 00:05:58 (mean) at a cost of 0.0515.
- The leanest approach, Approach C, costs 100x less than Approach A (0.0496 vs 4.96) for identical output, using 33x less memory and 18x less wall time. Because the gap is per-sample, it grows in absolute terms with bigger datasets.
Cost vs speed
| Metric | Approach B | Approach D | Approach C |
|---|
| Wall time (mean) | 00:05:28 | 00:05:58 | 00:07:40 |
| Cost per sample | 0.0059 | 0.0043 | 0.0041 |
| Cores used | 6 | 4 | 3 |
| Core-hours per sample | 0.548 | 0.398 | 0.383 |
| Samples per 100 core-hours | 183 | 251 | 261 |
- Approach B has the fastest per-sample turnaround (00:05:28) — prefer it when single-sample latency matters (e.g. one urgent sample).
- Approach C is the cheapest per sample (0.0041) and packs the most work into a core budget (261 samples per 100 core-hours) — best for large batches where total cost dominates.
- Approach D is the best all-rounder: within ~4% of Approach C's cost but ~22% faster (00:05:58 vs 00:07:40).
- See Notes for how each approach threads samtools fastq.
Notes
- Approach A runs samtools fastq without -@ (single-threaded), so the 8 requested cores cannot be used — hence ~1/8 CPU efficiency.
- Approach B threads samtools fastq with -@ (SLURM_CPUS_PER_TASK - 1): one worker per allocated core, minus one for overhead.
- Approach C overprovisions samtools fastq threads with -@ (SLURM_CPUS_PER_TASK * 2 - 1), about twice the allocated cores, so the CPUs stay busy through I/O waits — this is why efficiency stays high at a lower core count.
- Approach D overprovisions samtools fastq threads with -@ (SLURM_CPUS_PER_TASK * 2 - 1), about twice the allocated cores, so the CPUs stay busy through I/O waits — this is why efficiency stays high at a lower core count.
Scaling projection
Per-sample cost and wasted compute are essentially fixed (each CRAM is similar), so the differences scale linearly with cohort size.
| Samples | Approach A - 8 CPU / 100 GB requested cost | Approach B - 6 CPU / 6 GB requested cost | Approach C - 3 CPU / 3 GB requested cost | Approach D - 4 CPU / 4 GB requested cost | Idle CPU-hours (Approach A) |
|---|
| 12 (this run) | 4.96 | 0.0708 | 0.0496 | 0.0515 | 190 |
| 100 | 41.34 | 0.5901 | 0.4130 | 0.4290 | 1,582 |
| 1,000 | 413.45 | 5.90 | 4.13 | 4.29 | 15,823 |
| 10,000 | 4,134.48 | 59.01 | 41.30 | 42.90 | 158,232 |
- A 1,000-sample cohort would cost ~413 with Approach A versus ~4 with the leanest Approach C (~100x more, ~409 wasted), while Approach A alone burns ~15,823 CPU-hours on idle cores that never do any work.
- A 10,000-sample cohort would cost ~4,134 with Approach A versus ~41 with the leanest Approach C (~100x more, ~4,093 wasted), while Approach A alone burns ~158,232 CPU-hours on idle cores that never do any work.
Approach A - 8 CPU / 100 GB requested — per task
| JobID | ReqMem | NCPUS | MaxRSS | CPU efficiency | Elapsed | Cost |
|---|
| 26657078_1 | 97.7 GB | 8 | 97.7 GB | 12% | 02:37:11 | 0.4794 |
| 26657078_2 | 97.7 GB | 8 | 97.7 GB | 12% | 02:36:03 | 0.4759 |
| 26657078_3 | 97.7 GB | 8 | 58.7 GB | 12% | 02:11:37 | 0.4014 |
| 26657078_4 | 97.7 GB | 8 | 97.7 GB | 13% | 02:30:09 | 0.4579 |
| 26657078_5 | 97.7 GB | 8 | 46.6 GB | 13% | 02:27:13 | 0.4490 |
| 26657078_6 | 97.7 GB | 8 | 97.7 GB | 12% | 02:21:09 | 0.4305 |
| 26657078_7 | 97.7 GB | 8 | 97.7 GB | 12% | 02:11:45 | 0.4018 |
| 26657078_8 | 97.7 GB | 8 | 97.7 GB | 13% | 02:19:38 | 0.4259 |
| 26657078_9 | 97.7 GB | 8 | 97.7 GB | 13% | 01:42:02 | 0.3112 |
| 26657078_10 | 97.7 GB | 8 | 97.7 GB | 13% | 02:05:40 | 0.3833 |
| 26657078_11 | 97.7 GB | 8 | 97.7 GB | 13% | 02:20:15 | 0.4277 |
| 26657078_12 | 97.7 GB | 8 | 97.7 GB | 13% | 01:44:05 | 0.3174 |
Approach B - 6 CPU / 6 GB requested — per task
| JobID | ReqMem | NCPUS | MaxRSS | CPU efficiency | Elapsed | Cost |
|---|
| 26665963_1 | 6.0 GB | 6 | 6.0 GB | 76% | 00:05:31 | 0.0059 |
| 26665963_2 | 6.0 GB | 6 | 6.0 GB | 71% | 00:05:38 | 0.0061 |
| 26665963_3 | 6.0 GB | 6 | 6.0 GB | 65% | 00:05:15 | 0.0057 |
| 26665963_4 | 6.0 GB | 6 | 6.0 GB | 70% | 00:05:37 | 0.0060 |
| 26665963_5 | 6.0 GB | 6 | 6.0 GB | 67% | 00:06:06 | 0.0066 |
| 26665963_6 | 6.0 GB | 6 | 6.0 GB | 70% | 00:05:03 | 0.0054 |
| 26665963_7 | 6.0 GB | 6 | 6.0 GB | 64% | 00:05:40 | 0.0061 |
| 26665963_8 | 6.0 GB | 6 | 6.0 GB | 66% | 00:06:17 | 0.0068 |
| 26665963_9 | 6.0 GB | 6 | 6.0 GB | 74% | 00:03:56 | 0.0042 |
| 26665963_10 | 6.0 GB | 6 | 6.0 GB | 71% | 00:05:12 | 0.0056 |
| 26665963_11 | 6.0 GB | 6 | 6.0 GB | 61% | 00:06:54 | 0.0074 |
| 26665963_12 | 6.0 GB | 6 | 6.0 GB | 63% | 00:04:36 | 0.0050 |
Approach C - 3 CPU / 3 GB requested — per task
| JobID | ReqMem | NCPUS | MaxRSS | CPU efficiency | Elapsed | Cost |
|---|
| 26677984_1 | 3.0 GB | 3 | 3.0 GB | 94% | 00:08:11 | 0.0044 |
| 26677984_2 | 3.0 GB | 3 | 3.0 GB | 94% | 00:08:12 | 0.0044 |
| 26677984_3 | 3.0 GB | 3 | 3.0 GB | 95% | 00:07:05 | 0.0038 |
| 26677984_4 | 3.0 GB | 3 | 3.0 GB | 92% | 00:08:18 | 0.0045 |
| 26677984_5 | 3.0 GB | 3 | 3.0 GB | 92% | 00:08:21 | 0.0045 |
| 26677984_6 | 3.0 GB | 3 | 3.0 GB | 88% | 00:07:56 | 0.0043 |
| 26677984_7 | 3.0 GB | 3 | 3.0 GB | 90% | 00:07:57 | 0.0043 |
| 26677984_8 | 3.0 GB | 3 | 3.0 GB | 95% | 00:07:57 | 0.0043 |
| 26677984_9 | 3.0 GB | 3 | 3.0 GB | 93% | 00:06:18 | 0.0034 |
| 26677984_10 | 3.0 GB | 3 | 3.0 GB | 90% | 00:07:50 | 0.0042 |
| 26677984_11 | 3.0 GB | 3 | 3.0 GB | 94% | 00:08:00 | 0.0043 |
| 26677984_12 | 3.0 GB | 3 | 3.0 GB | 95% | 00:05:57 | 0.0032 |
Approach D - 4 CPU / 4 GB requested — per task
| JobID | ReqMem | NCPUS | MaxRSS | CPU efficiency | Elapsed | Cost |
|---|
| 26678922_1 | 4.0 GB | 4 | 4.0 GB | 87% | 00:06:43 | 0.0048 |
| 26678922_2 | 4.0 GB | 4 | 4.0 GB | 92% | 00:06:12 | 0.0045 |
| 26678922_3 | 4.0 GB | 4 | 4.0 GB | 87% | 00:05:51 | 0.0042 |
| 26678922_4 | 4.0 GB | 4 | 4.0 GB | 90% | 00:06:21 | 0.0046 |
| 26678922_5 | 4.0 GB | 4 | 4.0 GB | 92% | 00:06:15 | 0.0045 |
| 26678922_6 | 4.0 GB | 4 | 4.0 GB | 92% | 00:05:38 | 0.0040 |
| 26678922_7 | 4.0 GB | 4 | 4.0 GB | 88% | 00:05:52 | 0.0042 |
| 26678922_8 | 4.0 GB | 4 | 4.0 GB | 85% | 00:06:48 | 0.0049 |
| 26678922_9 | 4.0 GB | 4 | 4.0 GB | 87% | 00:05:02 | 0.0036 |
| 26678922_10 | 4.0 GB | 4 | 4.0 GB | 92% | 00:05:28 | 0.0039 |
| 26678922_11 | 4.0 GB | 4 | 4.0 GB | 91% | 00:06:04 | 0.0044 |
| 26678922_12 | 4.0 GB | 4 | 4.0 GB | 81% | 00:05:28 | 0.0039 |