Sequoia Hall
Home Academics Research Seminars Consulting Industrial Affiliates People
    
Computing Guide
Our Brochure
Contact Us
Sitemap
Links



13. Running Computer Intensive Jobs

Previous Computing Guide Contents Next

Remember that our server is used by over 300 users. Therefore, substantial jobs should not be run without some modification during peak hours (8am to 6pm).

Routine large jobs must be run as batch jobs. A user should schedule only one batch job at a time. All others will be killed. The procedure is very simple.

Suppose you want to run programs foo1, foo2 and store the outputs in foo1.out and foo2.out respectively. The following shows the procedure.

rgmiller 1% batch <<!
? foo1 2>&1 > foo1.out | mail joe
? foo2 2>&1 > foo2.out | mail joe
? !
job 865634220.b at Fri Jun 6 14:57:00 1997
b rgmiller 2%

Above we tell batch to read all commands until it see an exclamation point. The batch command prompts us with ?. The next two lines basically run the programs and mail the errors if any to joe. Since joe might not be too thrilled to hear of your errors, replace joe above with your userid.

Once you end your commands with an exclamation point, batch will give you a job number, 865634220.b in our case. Retain this for future use.

You can see running processes using the top (table of processes) command.

If you make a mistake, you can cancel your batch job thus.

rgmiller 3% at -r 865634220.b

Note that at -r cancels all your batch jobs.

Please read the man pages for batch and top.

13.1 S-Plus jobs
For running Splus jobs in the background, you have to put your S commands into files, say foo1.q and foo2.q . Be sure to include the quit command q() at the end of foo1.q and foo2.q so that Splus will end the session after executing the commands. Then you can do the following.

rgmiller> batch <<!
? Splus < foo1.q 2>&1 > foo1.out | mail joe
? Splus < foo2.q 2>&1 > foo2.out | mail joe
? !

The above example shows how one can run multiple Splus jobs inside one batch invocation. The commands in foo1.q are run first. Then, when this job finishes, the commands in foo2.q are run and so on. This is the recommended way to run multiple jobs as it ensures that at any one time, only one of your Splus jobs is running.

If you use an invocation of batch each for foo1.q and foo2.q, your jobs run concurrently and violate department guidelines.

Once again, please note that the files containing Splus code must have the q() command at the very end to quit.

Please note that running Splus jobs using

Splus BATCH file.q file.out

is NOT THE SAME as the procedure outlined above since that will give the job the same prority as interactive jobs.

The instructions we have provided will ensure a good response for people working interactively.

13.2 Matlab jobs
For running Matlab jobs in the background, you have to put your Matlab commands into files, say foo1.m and foo2.m . Be sure to end the commands in foo1.m and foo2.m with exit so that matlab will end the session after running the commands. Then you can mimic the instructions above as follows.

rgmiller> batch <<!
? matlab < foo1.m 2>&1 > foo1.out | mail joe
? matlab < foo2.m 2>&1 > foo2.out | mail joe
? !

The above example shows how one can run multiple matlab jobs inside one batch invocation. The commands in foo1.m are run first. Then, when this job finishes, the commands in foo2.m are run and so on. This is the recommended way to run multiple jobs as it ensures that at any one time, only one of your matlab jobs is running.

If you use an invocation of batch each for foo1.m and foo2.m, your jobs run concurrently and violate department guidelines.

Once again, please note that the files containing matlab code must have the exit command at the very end to quit.

13.3 Memory-sucking, disk-grinding, in-your-face jobs
You better send e-mail to action before running any monsters and wait for a reply. Otherwise, they will most likely be nuked.


Previous Computing Guide Contents Next


Contact  | Sitemap  | Directories  | Maps  & Directions  | Giving to Stanford
Copyright 2004Stanford University. All Rights Reserved. Stanford, CA 94305, (650) 723-2300
Terms of Use Copyright Complaints