Skip to content

Implement SGE (Sun Grid Engine) Job Submission Support #85

Closed

Description

@jeremymanning

Overview

The SGE (Sun Grid Engine) scheduler support is currently incomplete with NotImplementedError placeholders.

Current Status

  • Location: clustrix/executor.py:195
  • Method: _submit_sge_job()
  • Status: Raises NotImplementedError("SGE support not yet implemented")

Requirements

1. Job Submission (_submit_sge_job)

  • Implement SGE job submission using qsub command
  • Handle SGE-specific job configuration parameters
  • Parse job ID from qsub output
  • Store job information in active_jobs

2. Status Checking (_check_job_status)

  • Add SGE case to status checking logic
  • Use qstat command to check job status
  • Map SGE status codes to internal status strings
  • Handle completed/failed job detection

3. Script Generation (_create_sge_script)

  • Location: clustrix/utils.py:407
  • Generate SGE batch scripts with proper directives
  • Support SGE-specific parameters (queues, resources, etc.)
  • Include environment setup and job execution logic

Implementation Details

SGE Directives to Support

#$ -N job_name
#$ -o output_file
#$ -e error_file  
#$ -pe parallel_env slots
#$ -l h_vmem=memory
#$ -l h_rt=walltime
#$ -q queue_name

Status Mapping

  • qw (queued waiting) → "pending"
  • r (running) → "running"
  • s (suspended) → "running"
  • Job not found → check for result files → "completed" or "failed"

Acceptance Criteria

  • _submit_sge_job() successfully submits jobs to SGE
  • _check_job_status() correctly reports SGE job status
  • _create_sge_script() generates valid SGE batch scripts
  • All existing SGE tests pass
  • Add comprehensive SGE integration tests

Related Files

  • clustrix/executor.py - Job submission and status checking
  • clustrix/utils.py - Script generation
  • tests/test_executor.py - Tests expecting SGE functionality
  • tests/test_utils.py - Script generation tests

Labels: enhancement, scheduler-support, sge
Priority: Medium

Source: Content preserved from notes/archive/github_issues_to_create.md during Issue #74 content preservation automation.

Activity

  1. added a commit that references this issue on Aug 24, 2025
  2. jeremymanning commented on Aug 17, 2026

    @jeremymanning
    MemberAuthor

    Closing as completed. The premise of this issue is no longer accurate: SGE support is fully implemented on origin/master.

    This issue states that executor.py:195 raises NotImplementedError for SGE. That is no longer true — there is no NotImplementedError anywhere in the SGE path.

    Verified implementation:

    Component Location
    Job submission (qsub) clustrix/executor_schedulers.py:200-240
    Status polling (qstat -j, with qw/r/Eqw state mapping) clustrix/executor_scheduler_status.py:434-459
    Job script generation (#$ -N/-o/-e/-pe/-l h_vmem) clustrix/utils.py:1233 (_create_sge_script)
    Real-world test tests/real_world/test_sge_job_submission_real.py

    Two caveats carried forward into the new hardening plan rather than left here:

    1. The job-ID parse at executor_schedulers.py:243 is fragile (positional string splitting of qsub output).
    2. test_sge_job_submission_real.py has never been executed against a live SGE cluster in CI — the scheduled real-world workflow has failed on every run. So SGE is implemented and unit-tested, not validated against real hardware.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions