TOPS-10: Jobs

TOPS-10 is able to run multiple jobs (processes) per user, and has a flexible set of commands to control them, including the ability to pause a job and resume it on another terminal. It also has a batch job facility. But we'll start with a question on how to run jobs.

Why do I sometimes need to type R command and other times type command?

When you login to TOPS-10, you are in monitor mode - you are actually running shared code that is part of the system kernel. Some simple commands, like RESOURCES, are part of the monitor and can be executed directly. Other commands need to be loaded from disk first. To signal this, you type RUN command if the command is in your directory, or R command if it is a system command. R looks for EXE and SAV files to run in SYS:, so R PIP is the same as RUN SYS:PIP.EXE

A program loaded from disk remains in memory - your core image - even after the program exits. This image is only replaced when you load a new command. As a demonstration, type R PIP to load and run the PIP command. The prompt will change to *. Press Control-C and you will be back at the monitor level with the . prompt. Type RESOURCES and after that has finished, type START - you will find yourself back in PIP again.

One other complication is that the system administrator can declare an alias for some common commands. An example here is the SOS editor, which you can run with just SOS. Behind the scenes, the system does a R SOS for you to load and start SYS:SOS.EXE.

In practice you will remember what to type, but to check if a command is part of the monitor look at the Operating Systems Command Manual chapter 2. If the write up for a command says it "replaces core" then it is a disk loaded command that you either need to start via R or know that there is an alias declared.

Detaching and attaching jobs

You can log in more than one terminal under the same ID, and hence have more than one job running.

It is possible to pause execution of a job on one terminal and pick it up again on another. Let's say you are running this horribly inefficient way to print all prime numbers between 1 and 2 million:

	DO 1 J = 1000000,2000000
	DO 2 K = 2,J-1
	IF ((J/K)*K .EQ. J) GOTO 1
2	CONTINUE
	TYPE 100, J
1	CONTINUE
100	FORMAT(I)
	END

Run this with EXECUTE and press Control-C twice to interrupt it. Then type DETACH to detach the job

.exec primes.for
LINK:	Loading
[LNKXCT PRIMES Execution]

       1000003
       1000033
       1000037
       1000039
       1000081
       1000099^C^C

.det
From job 5

As you are detached, you are also logged out. You could LOGIN again and start a new job if you wished.

But let's start a new terminal. Login as normal and then type ATTACH with the job number from the previous DETACH. Then type CONT to continue execution from where you left off.

.login 100,100
JOB 13 KA603 TTY1
Password: 
[LGNJSP Other jobs same PPN:5,12]
1055	31-Jan-79	Tue

.at 5
From job 13

.cont


       1000117
       1000121
       1000133
...

You can also run jobs in the background - after you press Control-C type CCONT to continue the job in the background before DETACH. However, if the job does terminal input or output it will pause until it is attached to a terminal again.

Job information

You can get an idea of what jobs are running through SYSTAT. Giving a job ID as a parameter shows just one job.

.sys 5
 5   100,100	TTY1	SYSTAT	7+SPY	RN	       5 $

I have not found a way to kill a job that is running apart from attaching to it and then doing a Control-C.

Batch jobs

The closest equivalent to shell scripts is the batch job. Here you can prepare a file with a list of commands and send it for execution via SUBMIT. This places it on the batch job queue (which could also contain jobs submitted via punched cards) and it is run asynchronously. Here we create a new batch file TEST.JOB to run the DIR and SYS commands.

.sos test.job
Input: TEST.JOB
00100	dir
00200	sys
00300	$
*es

[DSKB:TEST.JOB]

.submit test.job

After you submit it you will see some activity on the operator's console when it is started. To see the results, check the line printer output (which is in host file units/printer.txt if you are using the TOPS-10 Quickstart). There will also be a log file created in your directory, by default with the extension .LOG.

.type test.log

13:24:26 BAJOB	BATCON version 13(1071) running TEST sequence 2 in strea
m 1 for DEMONSTRATIO
13:24:26 BAFIL	Input from DSKB3:TEST.JOB[100,100]
13:24:26 BAFIL	Output to  DSKB0:TEST.LOG[100,100]
13:24:26 BASUM	Job parameters
		Time:00:05:00	Unique:YES	Restart:NO
 
13:24:26 MONTR	
13:24:26 MONTR	.LOGIN 100/100
13:24:26 USER	JOB 14 KA603 TTY15
13:24:26 USER	[LGNJSP Other jobs same PPN:5,12,13]
13:24:26 USER	1324	31-Jan-79	Tue
13:24:27 MONTR	
13:24:27 MONTR	.dir
13:24:27 USER	
13:24:27 USER	CTEST	CBL	2  <057>   21-Apr-78
13:24:27 USER	HELLO	MAC	1  <057>   21-Apr-78
...

You can also interleave commands and data for the commands by preceding commands with . and data with *.

Further information

See the Operating Systems Command Manual on Bitsavers for full documentation of TOPS-10 commands. The Beginner's Guide to Multiprocessing Batch may be useful for batch jobs.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.