This section shows the overall picture of preparing and running a CCS batch script (.bat file). A simple, interactive-type job is outlined as an initial example. Subsequent subsections provide details for each step and show how to prepare a more general script for batch-type jobs.
- Prepare your executable (as shown in Compiling and Porting Serial Applications). Move the executable and any necessary data files to your home directory on the fileserver ctcfsrv1 (the H: drive).
- Write a batch script file named filename.bat; put it on H: in your home folder.
Here is a barebones example of a working batch script. Of course there are many other things you might want to do in a batch script; some of those will be covered later. Note that "REM" marks a line as a remark or comment, while "REM CCS ..." denotes a CCS keyword. Therefore the example below contains only four working lines.
REM userid by default or group name
REM CCS account = userid
REM interactive !! If type is set to interactive... !!
REM CCS type = interactive !! Anything after last REM CCS ignored !!
REM number of nodes required
REM CCS nodes = 1
REM number of minutes required (2 hours)
REM CCS minutes = 120
The remainder of the steps should be issued from one of the login nodes.
- Submit the script to the scheduler from a command prompt window.
- ccsubmit filename.bat
- Check the status of your job, the queue, etc using a number of commands that begin with "cc". There will be a full listing in a later section.
- ccq | findstr userid
- Connect to the node assigned. Once your job has begun, you can interactively log onto the node assigned, copy files to the local T: drive, and run the program. Run the program(s) as many times as you wish in the time allotted. Be careful! Your current directory might not be what you think it is. Each compute node has a 40 GB T: drive, files are deleted after 7 days.
- Start | All Programs | Accessories | Communications | Remote Desktop Connection
- Computer:
ctcxxx
- (log on)
- T:
- mkdir userid
- cd userid
- copy H:\users\userid\myjob.exe
- myjob.exe
- Clean up after the job by copying any output files back to H:, deleting files on the T: drive, and ending the job , otherwise you will be charged for the full time requested.
- copy data.out H:\users\userid
- del /S /Q T:\userid
- ccrelease
The reason for copying files to and from T: is that it tends to improve I/O performance and reliability. T: is a local drive on each machine (like C:), whereas H: is a network drive on the remote fileserver. So I/O streams to H: must cross the network. Here is a
further explanation as to why the T: drive should be used for batch jobs.