The Distributed Array Processor (DAP)

%externalintegerfn DDAP(%integer ACT, ADR) ACT is an activity number and ADR is the address of a record DAP of format DAPF: %recordformat DAPF(%integer CONF, INSTAT, STATUS, ADVIOL, COB, COL, NDPC, IT, IC, DOLOG1, DOLOG2, ILOG1, ILOG2, SECONDS, KBYTES, VADDR, BATCH LIMIT, INTER LIMIT, SPOOLR BATCH LIMIT, %string(6)SOLE USER1, SOLE USER2) ACT = 0 Called by DSTOP if DAP STATE is not zero to tidy up ACT = 1 DAP store of DAP_KBYTES is claimed. If the call is successful, DAP_VADDR is set to the virtual address by which the claimed DAP store may be referenced. Spec for Allocate call to Supervisor. Service number 31 (decimal). DACT = 1 Allocate P_P1 blocks of DAP store. Reply: P_P1 = 0 OK and P_P2 = logical DAP no<<16 ! physical DAP SMAC number P_P3 = number of first block allocated P_P4 = number of blocks allocated. 1 No DAP in configuration 2 insufficient contiguous DAP blocks available 3 DAP closing 4 process already has some DAP. ACT = 2 Any DAP store that has been claimed is released. DACT = 2 De-allocate DAP (i.e. whole of allocated DAP store). P_P1 = logical DAP no<<16 ! physical DAP SMAC number P_P2 = number of first block allocated P_P3 = number of blocks allocated. Reply: P_P1 = 0 OK, 1 fail ACT = 3 DAP start. Spec for Supervisor Start DAP service (DSNO = 31 decimal DACT = 4) P_P1 = DATUM rel to start DAP program datum (displacement in of DAP store words of the first word of the DAP program block relative to the base of the DAP store). P_P2 = LIMIT rel to DATUM DAP program limit (displacement in words of the last plane of the program block relative to DATUM). P_P3 = COB rel to DATUM Code base (words from DATUM). P_P4 = COL rel to DATUM Code limit (word address of first word of last plane of code area relative to DATUM). P_P5 = NDPC rel to COB Program counter (word address relative to COB) P_P6 = IC Instruction counter For further information about these DAP registers see DAP/TN/6 Section 4.3 On return from the DAP START request, the record P is set up as follows. The SACT field tells whether DAP execution was aborted by the DDAP STOP procedure. Even if DDAP STOP was called, the execution may have already terminated due to some program condition (e.g. stop instruction executed). Or the DAP START request may have been queued by the supervisor, i.e. execution has not yet started. Thus the SACT field will be set as follows. SACT = 4 the DAP was not in fact started. (A STOP request was received before the preceeding START request was actually scheduled). The record P contains the same information as was given in the START request. P_P1 = 1 DAP not claimed, 2 DAP closing SACT = 3 the DAP WAS running. The record P contains information necessary (e.g. NDPC) for a re-start, if required, as below. P_P1 has the following packed-up data: bits 0 - 7 bottom byte of INSTAT bits 8 - 23 bits 8 -23 of ADVIOL bits 24 - 31 bits 24 - 31 of STATUS P_P2 has NDPC P_P3 has the following packed-up data: bits 0 - 16 bits 15 - 31 of DLOG1 bits 17 - 31 bits 17 - 31 of DLOG2 P_P4 has IC P_P5 has the following packed-up data: bits 0 - 11 bits 16 - 23 of DOLOG1 bits 12 - 31 the failing instruction P_P6 has the following packed-up data: bits 0 - 11 bits 20 - 31 of DOLOG2 bits 12 - 31 the instruction which was executed prior to the failing instruction. ACT = 4 DAP stop. This activity is intended to be called on the signal stack following an Int:A frm the user. (Otherwise it's not easy to see why it should be relevant, as not both the user process and the DAP MCU should be running simulataneously). A DAP STOP message is sent to Supervisor (no reply, at least not to the calling service). What happens is: If the DAP was running for "this user", then a reply is given to the START DAP request, and the user finds that the HOST FORCED STOP bit is set in STATUS. If the DAP was not running for "this user", but the user has a "claim" request queued, then Supervisor gives a special reply to the claim request (SRCE=X'1F0005', P_P1=-1), and we interpret this and pass the reply back to the user. If neither of the above things are the case (and this could arise when the user does an Int:A such that the DAP STOP request goes to Supervisor before the claim request was queued, because the DDAP routine has been interrupted after setting the STATE to SUPVR TOLD but before the claim request was PONned), then Supervisor ignores the DAP STOP message. ACT = 5 DAP related data. The following fields are set in the 'DAP' record: DAP_CONF to Current ClaimQ limit (DIRCOM_CLAIMQ LIMIT) DAP_SECONDS to H_DAPSECS DAP_BATCH LIMIT to DIRCOM_DAP BATCH LIMIT DAP_INTER LIMIT to DIRCOM_DAP INTER LIMIT DAP_SOLE USER to DIRCOM_DAP SOLE USER DAP_SPOOLR BATCH LIMIT either to DAP_BATCH LIMIT or, if DAP not available for (any) batch job, 0 ACT = 6 Give users currently having Claim requests queued (or currently using DAP). ADR points to a %STRING(6) %ARRAY A(1:20), initially set to all zeroes by the caller. Director stuffs in the usernames (procnos obtained from Supervisor) - first username is RUNNING in the DAP and subsequent ones have Claim requests queued. ! New entries to DDAP (August 1983) ACT = 7 ADR points to a record format: (%string(31) TO USER, FROM USER, TO FILE, FROM FILE, %integer TO FSYS, FROM FSYS, DAP PAGE NO, TO FILE PAGE, FROM FILE PAGE, NO OF PAGES, IDENT) Causes transfers of NO OF PAGES of data from FROM FILE PAGE to DAP PAGE NO (if FROM FILE PAGE non-zero) and/or from DAP PAGE NO to TO FILE PAGE (if TO FILE PAGE non-zero) FROM FILE PAGE and TO FILE PAGE describe pages within the files FROMUSER.FROMFILE on FROMFSYS and TOUSER.TOFILE on TO FSYS respectively. If FROM FILE PAGE is minus one then no transfer takes place FROM the file. If TO FILE PAGE is minus one then no transfer takes place TO the file. BOTH may not be minus one. DAP PAGE NO is the start-page-number of the required DAP page within the DAP block. The IDENT field is set to a number identifying the transfer request. Idents are bit settings, so that several may be ORed together to represent several idents. ACT = 8 ADR points to the same record format described above. The IDENTS field should be set with IDENTs supplied from the ACT=7 call, to indicate one or more transfers. The EMAS process suspends until the transfers represented by the given IDENTS are complete. -------------------------------------------------------------------------------- Programming notes. These entries may be called only from the ROUTINE which is given in the call of DDAP. (This routine is called when a X'F7Fxxxxx' DAP stop instruction is executed). On return from this routine, DAP execution resumes at the next DAP instruction (except for ACT=9). But in all cases, return MUST BE MADE, so that DDAP can "collect all replies to oustanding page in/out requests. The integerfunction given as the parameter to DDAP should be specified: %integerfn UROUTINE(%integer ILOG1, ILOG2, NDPC) Any non-zero result given by further calls of DDAP from UROUTINE should be given as the result from UROUTINE. This will disable further DAP execution. Thus giving a non-zero result is a way (THE way) of aborting the DAP run at this point. The parameters handed are (obviously) ILOG1, ILOG2, and DAP PC. -------------------------------------------------------------------------------- Estimated timings Transfer speed (after seek and rotational delay) is 5 msecs/page. Average latency is 7.5 msecs. Seek time is 10 to 60 msecs. One-eighth of the DAP is 256 Kbytes or 64 pages. These will in practice appear as two contiguous blocks of 32 pages with no seek or latency within the 32-page transfers. Transfer time for 32 pages will therefore be 35 + 7.5 + 32*5 msecs = 202.5 msecs and for 64 pages on the same disc 505 msecs at best. We must double this for the swap, giving 1.01 secs. And we must also allow for disc contention and for channel (DFC) contention, resulting from other users' presence. At worst this might involve a further factor of four for channel contention and four for disc contention. At best, perhaps two and two (say for night or weekend usage). We might expect a one-eighth DAP swap, therefore, to take from 5 to 18 seconds. In an empty machine, we might get down to two seconds. Remember we have to wake up and page in the EMAS process itself, as well as getting the actual transfers done. -------------------------------------------------------------------------------- DAP related error numbers: 62 ClaimQ limit would be exceeded 63 DAP not claimed at START 64 DAP Claim de-queued (as a result of a DAP STOP request to Supervisor) 67 Not claimed at Release 71 No time left 72 DAP not started 73 DAP not available 74 Not enough contiguous DAP blocks 75 DAP closing 76 User already has DAP 90 Max already allocated 92 Interactive use not allowed Commentary on COM_DAP STATE: 0 No DAP (allocated as store if DAP exists) 1 DAP free and idle (ready to be claimed as DAP) 2 Claimed by some user. 3 DAP running. 16 DAP is available as store, but will become DAP if someone does an Allocate. 17 DAP is free and idle (after user de-allocate) and is going to revert to being store, after a short timeout.