Prerequisites
You should complete the CCS module before starting this lab.
Overview
What is Cluster CoNTroller?
Cluster CoNTroller is a job scheduler that distributes jobs to a cluster of workstations and/or to nodes of a multi-processor machine. The scheduler decides when and how a batch job is run based on preferences set up by the user and system administrator(s). You can communicate with Cluster CoNTroller using a few simple commands.
How Cluster CoNTroller Works
Jobs are submitted to the batch system via a script file. When a job is submitted, it is held in the queue until the scheduler can allocate the required resources to run the job. If the job is a batch job, then the script is executed immediately after resources have been allocated. For interactive jobs, watch the job status by using ccq, then log onto the requested nodes and execute your programs. You cannot specify which nodes to run on; Cluster CoNTroller chooses appropriate nodes.
Why Use a Batch Scheduler?
By using Cluster CoNTroller, we can control the load on the batch nodes so that we get the best overall system throughput by minimizing situations where some nodes might be idle while other nodes are heavily loaded. Users are granted exclusive access to the nodes allocated to their job to eliminate contention for resources and enhance performance.
References
CCS Batch Script Examples: Submitting a batch job requires the creation of a .bat file to provide Cluster CoNTroller the information it needs to run your job.
CCS Keywords: A .bat file is a script file containing keyword statements that give the batch scheduler information about your job. The batch scheduler recognizes keyword statements because they are always preceded by REM CCS. Because these lines begin with REM they are treated as comments and ignored by the DOS shell.
CCS Commands: CCS Commands are used to submit and remove jobs as well as query resources and queues.
Exercise
Step by Step Example for Submitting a Job
- Do this first step the first time you use the cluster:
- You will need a cluster account. See the Allocations page for more information, or contact User Accounts at allocations@tc.cornell.edu.
- Connect to a login node and change your password with ccpasswd. If you have used any other method to change your password, register your password with the batch system by issuing ccpasswd -r. Please review the Password Policy.
- Copy all lab files found in
- H:\VWlabs\CCS\Lab1\
to your home directory (or subdirectory) on H:, e.g.
- copy H:\VWlabs\CCS\Lab1\* H:\Users\your_userid\
The C program is cprog.c, the executable is cprog.exe, and the .bat file is cprog.bat.
The program adds and subtracts.
- Review the cprog.bat file to be sure you understand what it does.
Edit cprog.bat to substitute your_userid in all locations, and add subdirectories if needed. Save the file.
- Log on to a login node. Move to the directory where cprog.bat is located.
- Submit your job to Cluster CoNTroller with the command:
- ccsubmit cprog.bat
You should get a response similar to: Your batch file is submitted. Your Job Id: 789
- Check the status of your job with the ccq command:
- ccq
Since you cannot specify when a batch job runs or when interactive nodes become available, you should periodically check the status of the job with ccq.
Solution
When your job has finished executing, check your output. cprog.stderr should be empty, and cprog.stdout should look like this:
342.320000 + 98.200000 = 440.520000
3 - 8 = -5
Cleanup
Running this tutorial will leave the following files in your folder:
cprog.exe
cprog.bat
cprog.c
cprog.stdout
cprog.stderr