Compile the program

Use the compiler "wrappers" to compile codes on Hopper: use ftn for Fortran, cc for C, and CC for C++.

% ftn -o helloWorld helloWorld.f90

Create a Batch Script

Open a file called my_batch_script with a text editor like vi or emacs and paste in the contents below. (Use the "view source" button that will appear in the upper right hand corner of the batch script example when you move your cursor there.) The batch script is used to tell the Hopper system to reserve compute node resources for your job and how it should launch your application on the compute nodes it has reserved.

Contents of file:my_batch_script

Submit Your Job to the Queue

The qsub command is used on the login nodes to submit your batch script so your job will run on the Hopper compute nodes.

% qsub my_batch_script

A jobid will be returned, such as 15674.sdb

Monitor Your Job in the Queue

After you submit your job, the system scheduler will check to see if there are compute nodes available to run the job. If there are compute nodes available, your job will start running. If there are not, your job will wait in the queue until there are enough resources to run your application. You can monitor your position in the queue using several different commands, such as:

hopper% qshopper% qstat -u usernamehopper% showq

Examine Your Job's Output

When your job has completed you should see a file called my_job.o[jobid]