DEV Community

Linux_guy
Linux_guy

Posted on

1

Grid Engine Commands

QSTAT Command

  • To check the status of the jobs we use the qstat command
qstat

# to get information about specific job
qstat -j <job-id>

# to get the full information of the resources
qstat -f 

# to get the full details of all the jobs running
qstat -F

# To get the filter for a queue we use
qstat -q queue_list

# to filter by queue state 
qstat -qs {a|c|d|o|s|u|A|C|D|E|S}

# to filter jobs by users
qstat -u <userid>

# to show all user's job
qstat -u \*

Enter fullscreen mode Exit fullscreen mode

QSUB

  • To submit a batch job we use the qsub command
# Example 1: to submit a simple bash job
qsub <script_path>

# Example 2: To submit an advanced batch job we use
qsub -cwd -S /bin/bash -i /data/example.in -o /results/example.out -j y example.sh arg1 arg2
# Options explained:
# -cwd: job will be executed from the same directory
# -S: bash shell will be assigned to interpret the submitted job
# -i: this file will be used as an input
# -o: this file will be used to show output
# -j y: this will merge the error into the same as the output file

# Example 3: advanced script
qsub -N example3 -P project_test -p -28 -l a=lx-amd64 example.sh
# Options explained:
# -N: this will be submitted by the given name, instead of the script name
# -P: this job will be submitted to project_test
# -p: this will assign lower priority to the given job than normal priority
# -l: this will request for amd64 resource on the scheduler

# Example 4: to submit a binary job
qsub -b y firefox

Enter fullscreen mode Exit fullscreen mode

Job Submission Script

#!/bin/bash

#$ -N example3
#$ -P "project-name"
#$ -o test.out -e error.err
#$ -l mem=6G
#$ -l cpu=2

# command to be executed
echo "just a test"
Enter fullscreen mode Exit fullscreen mode

QDEL

  • qdel is used to delete a job in the queue
# Force delete a job in the queue
qdel -f <job-id>

# to delete specific tasks of a job
qdel <job-id> -t <task-range>

# to delete all the jobs from a specific user, only possible for managers
qdel -u <user-list> "*"
Enter fullscreen mode Exit fullscreen mode

How to check for the list of the nodes

  • To check the list of the current nodes we use the qhost command
qhost

# To check the jobs running under the specific hosts we use
qhost -q -j
Enter fullscreen mode Exit fullscreen mode

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (3)

Collapse
 
jimmymcbride profile image
Jimmy McBride β€’

What is grid engine and all these qcommands for? is it a hosting platform or something like that? Along the lines of teraform or something similar?

Collapse
 
nerdflash28 profile image
Linux_guy β€’

hey jimmy, well grid engine is scheduler, which runs upon Linux clusters, it is used to distribute process over multiple nodes.

it's a part of HPC : High performance Computing

as I'm working as a Cloud HPC Engineer, so I thought it's worth sharing this knowledge with you guys.

Thanks for showing interest though 😊😊😊

Collapse
 
jimmymcbride profile image
Jimmy McBride β€’

Very nice! Thanks for sharing :)

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❀️