SLURM to Open Cluster Scheduler / Gridware Cluster Scheduler Migration Guide (2025-08-04)

Updated 2025-08-18

Migrating to Open Cluster Scheduler (OCS) or Gridware Cluster Scheduler (GCS) is straightforward and provides significant advantages for HPC environments. The schedulers offer sophisticated job prioritization algorithms, exceptional scalability, and robust open source foundations. Most importantly, they maintain SGE CLI/API compatibility for existing workflows while adding modern scheduler capabilities.

Broad Platform Support

OCS and GCS support an extensive range of platforms, making migration feasible regardless of your current infrastructure. From legacy CentOS 7 installations to the latest Ubuntu releases, both schedulers provide consistent functionality. Architecture support spans AMD64 and ARM64, with options for RISC-V and PowerPC, ensuring compatibility across diverse hardware environments including traditional x86 clusters, ARM-based systems, and emerging RISC-V platforms.

Command Migration Reference

Basic Commands

Function SLURM OCS/GCS Notes
Submit job sbatch script.sh qsub script.sh Direct replacement
Delete job scancel 12345 qdel 12345 Direct replacement
Job status squeue -u user qstat -u user Familiar SGE syntax
Job details scontrol show job 12345 qstat -j 12345 Detailed per-job diagnostics
Interactive job srun --pty bash qrsh -cwd -V bash Recommended parity flags; add resources, e.g. -pe smp 4 -l h_vmem=4G
Hold job scontrol hold 12345 qhold 12345 Direct equivalent
Release job scontrol release 12345 qrls 12345 Direct equivalent
Cluster status sinfo qhost Summary view; for full attributes use qhost -F or qconf -se
Queue list scontrol show partition qconf -sql Simpler command
Node details scontrol show node node01 qhost -h node01 For full host config use qconf -se node01
Host config scontrol show node node01 qconf -se node01 Full host config (complexes, load sensors, consumables)
Accounting sacct -j 12345 qacct -j 12345 Post-mortem from accounting file; for live info use qstat -j or ARCo if configured

Job Script Conversion

SLURM Directive OCS/GCS Equivalent Example
#SBATCH #$ Script directive marker
--job-name=test -N test Job naming
--output=job.out -o job.out Standard output
--error=job.err -e job.err Standard error
--time=24:00:00 -l h_rt=24:00:00 Runtime limit
--nodes=2 -pe mpi 48 Slots via PE; node count shaped by PE allocation_rule or per-host slot limits
--ntasks=48 -pe mpi 48 Task/slot count
--cpus-per-task=4 -pe smp 4 OpenMP/multi-threaded per-task CPUs
--mem=4000 -l h_vmem=4G Per-task hard memory limit
--partition=compute -q compute.q Queue selection
--account=project1 -P project1 Project assignment
--array=1-100 -t 1-100 Job arrays
--mail-type=ALL -m bea Email notifications
--mail-user=user@domain -M user@domain Email address
--gres=gpu:2 -l gpu=2 GPU request (requires configured gpu complex)

Environment Variables Migration

SLURM Variable OCS/GCS Variable Purpose
$SLURM_JOB_ID $JOB_ID Unique job identifier
$SLURM_JOB_NAME $JOB_NAME Job name
$SLURM_NTASKS $NSLOTS Number of allocated slots/cores
$SLURM_JOB_NODELIST $PE_HOSTFILE Path to host/slot file; use cat "$PE_HOSTFILE"
$SLURM_ARRAY_TASK_ID $SGE_TASK_ID Array job task ID
$SLURM_SUBMIT_DIR $SGE_O_WORKDIR Submission directory
$SLURM_JOB_PARTITION $QUEUE Queue instance (e.g., compute.q@node01)
$SLURM_JOB_USER $USER Job owner (runtime user)
$SLURM_ARRAY_JOB_ID $JOB_ID Array parent job ID
$SLURM_SUBMIT_HOST $SGE_O_HOST Submission host
$SLURM_CPUS_PER_TASK (no direct) Use -pe smp N and $NSLOTS within a single-task job
(submitter) $SGE_O_LOGNAME Submitting user login name

Job Script Examples

Serial Job Migration

SLURM Script

#!/bin/bash
#SBATCH --job-name=serial_job
#SBATCH --output=job.out
#SBATCH --error=job.err
#SBATCH --time=1:00:00
#SBATCH --mem=2000
#SBATCH --ntasks=1

./my_application

OCS/GCS Script

#!/bin/bash
#$ -N serial_job
#$ -cwd
#$ -V
#$ -o job.out
#$ -e job.err
#$ -l h_rt=1:00:00
#$ -l h_vmem=2G

./my_application

Parallel Job Migration

SLURM Script

#!/bin/bash
#SBATCH --job-name=mpi_job
#SBATCH --nodes=2
#SBATCH --ntasks=48
#SBATCH --time=4:00:00
#SBATCH --partition=compute

mpirun ./parallel_app

OCS/GCS Script

#!/bin/bash
#$ -N mpi_job
#$ -cwd
#$ -V
#$ -pe mpi 48
#$ -l h_rt=4:00:00
#$ -q compute.q
# Optional CPU binding if not defined in the PE:
# $ -binding linear:1

# If your MPI is SGE-aware, it will read $PE_HOSTFILE automatically.
# Otherwise, pass the hostfile explicitly:
mpirun -np "$NSLOTS" --hostfile "$PE_HOSTFILE" ./parallel_app

OpenMP / CPUs-per-task Migration

SLURM Script

#!/bin/bash
#SBATCH --job-name=omp_job
#SBATCH --time=2:00:00
#SBATCH --cpus-per-task=8
#SBATCH --mem=4000

export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

./omp_app

OCS/GCS Script

#!/bin/bash
#$ -N omp_job
#$ -cwd
#$ -V
#$ -pe smp 8
#$ -l h_rt=2:00:00
#$ -l h_vmem=4G

export OMP_NUM_THREADS="$NSLOTS"

./omp_app

Job Array Migration

SLURM Script

#!/bin/bash
#SBATCH --job-name=array_job
#SBATCH --array=1-100
#SBATCH --output=job_%A_%a.out
#SBATCH --time=1:00:00

./process_file "$SLURM_ARRAY_TASK_ID"

OCS/GCS Script

#!/bin/bash
#$ -N array_job
#$ -cwd
#$ -V
#$ -t 1-100
#$ -o job_${JOB_ID}.${SGE_TASK_ID}.out
#$ -l h_rt=1:00:00

./process_file "$SGE_TASK_ID"

Queue Configuration Migration

SLURM Partition OCS/GCS Queue Configuration
Partition name Queue name Use familiar .q suffix
Node assignment Hostgroup More flexible node grouping
Resource limits Queue limits Comprehensive resource control
Priority settings Share tree Hierarchical fair-share
Access control User lists Fine-grained permissions

MPI Integrations

Open Cluster Scheduler and Gridware Cluster Scheduler provide comprehensive, native support for major MPI implementations through both tight and loose integration modes. Tight integration ensures parallel tasks are fully accounted for and resource limits are enforced via qrsh -inherit and PE-aware launchers; loose integration provides flexibility for applications that manage their own task distribution.

Schedulers include ready-to-use parallel environment templates and build scripts for Intel MPI, MPICH, MVAPICH, and Open MPI. Each MPI implementation can be installed and configured using simple qconf commands to add parallel environments to queues. For applications that don't natively support SGE integration, an SSH wrapper is provided that transparently converts SSH calls to qrsh -inherit, enabling tight integration without application modifications.

Complete MPI integration templates, build scripts, and example jobs are available in the official repository. This includes everything needed to deploy and test MPI workloads, from basic parallel environment configuration to advanced checkpointing setups.

Gotchas and Nuances

  • Memory: h_vmem sets a hard per-process limit. mem_free is typically a consumable/availability indicator and may scale with slots depending on complex configuration.
  • Accounting: qacct reports after jobs finish (reads the accounting file). For near-live info, use qstat -j, the accounting file directly, or ARCo if configured.
  • Queue variable: $QUEUE contains the queue instance (queue@host). To get just the queue name, use shell parsing like ${QUEUE%@*}.
  • Node list: There is no direct string nodelist. Use $PE_HOSTFILE (host slots file), $NSLOTS, and if needed count hosts from the file.
  • Environment and working directory: Add -cwd to run in the submission directory and -V if you rely on the submit-time environment.
  • Affinity: Use -binding (e.g., -binding linear:1 or striding) or define binding in the PE to mirror Slurm CPU affinity behavior.
  • Arrays: Use $SGE_TASK_ID. Avoid $TASK_ID as it is not guaranteed across deployments.
  • Nodes vs tasks: -pe requests slots. To emulate a specific nodesĂ—tasks layout, configure the PE's allocation_rule and per-host slot caps accordingly.