Skip to Main Content

How to run GDL programs on maya

Introduction

On this page we’ll see how to run a GDL program on the cluster. GDL stands for “GNU Data Language”, and is an open source alternative to IDL. Before proceeding, make sure you’ve read the How To Run tutorial.

A simple Hello World script

The following Hello World program demonstrates how to run a GDL program on maya

; sayhello.pro
pro sayhello,what
  print,'HELLO ',what
end

Download: ../code/sayhello-gdl/sayhello.pro

We’ll also make a main program:

; main.pro
pro main
  sayhello,'WORLD'
end

Download: ../code/sayhello-gdl/main.pro

The job is very quick, so we can run it interactively on the front-end node to make sure things are working

[araim1@maya-usr1 sayhello-gdl]$ gdl
GDL - GNU Data Language, Version 0.9
For basic information type HELP,/INFO
'GDL_STARTUP'/'IDL_STARTUP' environment variables both not set.
No startup file read.
GDL> main
% Compiled module: MAIN.
% Compiled module: SAYHELLO.
HELLO WORLD
GDL>
*** ctrl-d to quit ***
[araim1@maya-usr1 sayhello-gdl]$

We’ll create a batch script to run the program on a compute node

#!/bin/bash
#SBATCH --job-name=sayhello
#SBATCH --output=slurm.out
#SBATCH --error=slurm.err
#SBATCH --partition=develop

echo "main" | gdl

Download: ../code/sayhello-gdl/run.slurm

Now we can submit our job to the scheduler

[araim1@maya-usr1 sayhello-gdl]$ sbatch run.slurm
[araim1@maya-usr1 sayhello-gdl]$

Eventually the job will complete. When it does, it will create slurm.out and slurm.err files with the following output:

[araim1@maya-usr1 sayhello-gdl]$ cat slurm.err
[araim1@maya-usr1 sayhello-gdl]$ cat slurm.out
% Compiled module: MAIN.
% Compiled module: SAYHELLO.
HELLO WORLD
[araim1@maya-usr1 sayhello-gdl]$