Using the M-grid is quite similar to using the batch queue systems on CSC's other resources. There are, however, some grid specific differences.
"Hello World" on the grid
1. The following are some examples available on Sepeli (also available from the NorduGRID pages). Copy them to your home directory and change to the "hellogrid" directory.
$ cp -r /opt/nordugrid/mgrid-tutorial-examples .
$ cd mgrid-tutorial-examples/hellogrid
2. The directory contains two files:
hellogrid.sh
hellogrid.xrsl
hellogrid.sh is an executable and hellogrid.xrsl is a job description file. You can view the contents of these files, for example, with "cat" command:
$ cat hellogrid.xrsl
3. Issue the following command to sign on to the grid:
$ grid-proxy-init
4. Submit your job with the following command:
$ ngsub -f hellogrid.xrsl
This command asks the grid middleware to search for a free computing resource and it then sends the job there. On successful job submission the command returns a job ID URL which you can use to refer to that job:
Job submitted with jobid gsiftp://sepeli.csc.fi:2811/jobs/<numero>
Running this command can take a few moments. If you would like more information on how the job submission is progressing you can add "-d 1" to the command line.
5. The command "ngstat" will let you see that status of your job:
$ ngstat -a
Job gsiftp://sepeli.csc.fi:2811/jobs/<numero>
Jobname: hellogrid
Status: INLRMS:R
In the above example, the status "INLRMS:R" means that the job is executing on the computing resource's batch system. Some other jobs states are "PREPARING", "INLRMS:Q (queued on the computing resources batch system) and "FINISHED" (Finished and ready for you to retrieve the results).
6. When your job is ready you can move the results to your current directory with the "ngget" command:
ngget hellogrid
This command moves the results to a numbered subdirectory. In this example the output of the executable is available in the file "hello.out".
Runtime Environments
Certain programs are installed on M-grid clusters as Runtime Environments, (abbreviated to RE). A runtime environment can be specified in the job description file so that the middleware will send the job to a machine where the specified runtime environment is available. More detailed information is available on the Runtime Environments Page.