• Aucun résultat trouvé

The GL YPNIR Language

Dans le document • THE I C IV (Page 107-117)

f'NST' Instruct

B. The GL YPNIR Language

1. Introduction

GLYPNIR is a language designed for programming the Illiac IV computer.

Initial design was begun in early 1968, and a compiler has been availa-ble since early 1969. In view of the increasing interest in Illiac IV and in parallel computation in general, this discussion is presented in order to acquaint the reader with GLYPNIR. It will discuss some design goals and sketch pertinent features of the language while omitting as much detail as possible (cf. (13), (14), (17), (18)). It is not claimed that GLYPNIR contains essentially new features which cannot be found elsewhere. Rather, this language is a selection and adapta-tion of features particularly useful for programming a parallel array type computer. The goal has been to produce a useful, reliable, and efficient programming tool with a high probability of success.

Primary memory consists of 128K 64-bit words divided into 64 2K word modules. Thus, primary memory may be viewed as a two-dimensional structure where each word can be addressed by a pair (a, B) where B specifies a memory module and a specifies an address within that module.

A group of 64 words, each in a different module but each having the same address w1thin its module, is called a super word or sword (see Figure 4.2). Each PE is connected to one 2K module and can directly access only its own module. Thus, the PEs can collectively access a sword.

Additionally, since each PE has its own index registers, it can index its own module independently of the others. Thus the PEs can collective-ly access 64 words, one word from each module but with each word at a different address. Any such group of 64 words from distinct modules is called a slice. (Thus a sword is a slice but not vice versa.) Access to other modules must be done through the PE interconnection logic (routing network). Secondary memory c~nsists of special head-per-track disk units with an I/O rate of .5 X 10 bits/second (each of two chan-nels) and an average latency of 20 milliseconds. The Illiac IV is super-vised by a control computer, currently a PDP-10. .

This section is based on "GLYPNIR-A Programming Language for Illiac lV", by D.H. Lawrie, T. Layman, D. Baer and J.M. Randal, Communications of the ACM, Volume 18 Number 3, March 1975, page 157.

94

It was apparent very early that a language was needed which (1) hides the machine architecture from the users, and (2) results in effi-cient1 object code. It was felt that, given limited resources and the requirement for a high probability of succes, GLYPNIR could not attempt to provide both of the above.2 Since most of the users were contempla-ting large production codes requiring high efficiency and could afford more programming effort, it was decided to provide an efficient language which would be a considerable improvement in terms of programming effort over assembly language, but which would not compromise efficiency by hiding the machine architecture.

PEe.

Word

~ Sword __ ~:WAl

o 63

Figure 4.2 word, sword and slice

IBy efficient is meant that the code generated by the compiler runs lIalmostli as fast as the same program written directly in assembly language.

2A separate language was underway which could satisfy at least (1) above. See (1).

2. Variabl • •

In order to use a machine efficiently, variable types must be pro-vided in the language which represent those entities which the machine recognizes. Traditionally, this has meant providing real (floating), integer (fixed), Boolean (logical), and sometimes other types. In logical variables declared as follows:

BOOLEAN B, TESTRESULT

BOOLEAN VECTOR BUFFERFULL (10)

Boolean variables represent 64 separate true/false values. For example, assume X and Yare REAL swords as declared above. Then the

GLYPNIR defines a multivalued Boolean result to be TRUE if and only if all elements of the result are. true. It is FALSE if and only if all the elements are false. Otherwise, fheresult is mixed. Boolean quantifiers SOME and EVERY are available for use in Boolean expressions.

For example, SOME B is TRUE if some element of B is true, and EVERY B is FALSE if some element of B is false.

I

10 II

2 ~

z[q z[l]

Z[2]

' '

-Z[9~

I I ... D

Figure 4.3 Diagonal slice

3. Starage Cantral and/or partial word designators. For example, partial word designators used in the expression

Pointers, Structures, and Dynamic Storage Allocation

GLYPNIR included facilities which allow creation and modification of user defined data structures. These facilities include dynamic alloca-tion of storage blocks and the ability to declar~ the manipulate pointers (machine addresses) and fields within these blocks. Perhaps

98

the easiest way to demonstrate these capabilities is to describe how similar facilities would be used in a conventional (nonparallel) language and then describe the extensions made for Illiac IV.

POINTER FIELD PFA(2,0,64), PFB(3,O,64);

INTEGER FIELD INT(O,lO,10);

100 Programming

The shaded area in Figure 4.4 represents the field which would be referenced by any of the following expressions:

P(2).(M)INT or P(1) .-PFB.·(M) INT or P(1).PFA.PFA (M)INT

In GLYPNIR the above ideas are extended as follows:

1. There are two kinds of pointers: (a) pointers which can point anywhere in memory; and (b) pointers which can point only within a given memory module.

2. Pointer variables can represent either a single pointer or a sword of pointers.

3. There are several kinds of allocation and deal location state-ments allowing allocation/deallocation of blocks of words or blocks of swords.

Experience has shown that these facilities are useful even in numer-ically oriented applications. For example, they are used to allow packing of low precision data, I/O can be performed directly from data areas (without intermediate buffering), and complex relation-ships between data items can be maintained via pointer link rather than physical movement of the data.

p[6J

I - - - i

pet]

I - - - i

P[2J

~--... '\

o o

2 2

Figure 4.4 Example of pointer structure

I

~

Control statements resemble those of FORTRAN and ALGOL except they have been extended to facilitate control of parallel calculations. Ex-amples are given below where (BE) is a Boolean expression, and (S) is a control independent parallel code streams (semaphores, etc.) and we would be providing a capability clearly not supported by the

102 Programming re-quired to control independent parallel code streams (semaphores, etc.) and would be providi~g a capability clearly not supported

diagonal) part of Z to be set to zero:

FOR 1= 0 STEP 1 UNTIL 13 DO Z(I)+ 0

The statements "00 (S) UNTIL (BE)" and "WHILE (BE) DO (S)" cause the indicated statement (S) to be repeated UNTIL or WHILE a Boolean condition is satisfied. For example, assume X is a sword containing real values> O. Then the following statement would decrement each element of X by 1 until it is s 0:

WH I LE X > 0 DO X + X - 1 or DO X +- X - 1 UNTI LX> 0

Note that the UNTIL statement iterates until the Boolean expression is FALSE, and the WHILE statement iterates while the Boolean ex-pression is TRUE.

104, Programming 8. Example

At this point an example might be helpful. Suppose the memory has a sword C of elements and the program must compute a new sword X, the value of whose elements are the square roots of the corresponding' ele-ments of C; i.e., X· = ICi' 0 ~ i 5 63. It could of course use the built-in function SQRT(C) which would return the required sword. In-stead let it use the it~rative formula Xj

=

~(Xj + Cj/Xj) where it will stop iterating when ((Xj)2 - Cj) < E. In FORTRAN wrlte this as follows:

DO 10 J = 1. N

9 IF (ABS((X(J)*X(J) - C(J))/C(J)).LE.EPSILN) GO TO 10

X(J) = (X(J) + C(J)/X(J))*.5 GO TO 9

10 CONTINUE

In GLYPNIR write this as follows where X and Care PE variables (swords):

L:IF ABS((X*X-C)/C) UPSILON THEN

Dans le document • THE I C IV (Page 107-117)

Documents relatifs