Method for providing synchronized data cache operation for processors in a parallel processing system, and parallel processing system implementing the method

Abstract: Apparatus and method for insuring data cache content integrity among parallel processors. Each processor has a data cache to store intermediate calculations. The data cache of each processor is synchronized with each other through the use of synchronization intervals. During entry of a synchronization interval, modified data variables contained in an individual cache are written back to a shared memory. The unmodified data contained in a data cache is flushed from memory. During exiting of a sychronization interval, data variables which were not modified since entry into the synchronization interval are also flushed. By retaining modified data cache values in the individual processors which computed the modified values, unnecessary access to shared memory is avoided.

Description: FIELD OF THE INVENTION The present invention relates to a method and a system as claimed in the preamble of Claims 1, respectively 3. Parallel processing techniques have improved the ultimate speed for executing a computer program. The program is compiled into individual execution sequences for each of a plurality of computer processors. Variables calculated by one processor are necessarily shared with the other processors to execute the different segments of the computer program. Synchronization may be using barriers and channels. In such a system, the program contains the identity of certain portions of a program beyond which an individual processor may not execute, until assurances are obtained that other processors have used previously computed variables by a processor which reaches a barrier. During execution, a processor will determine from a register, common to all processors, whether or not the barrier bit has been set. When all processors have set their respective barrier bits, they may continue beyond the barrier. Similarly, a channel may be used to identify to other processors when a given processor has reached a certain stage of execution. Writing to a common channel register permits other processors to inspect the register and determine when the other parallel processors has reached the predefined stage. The shared variables which are computed by individual processors are in a shared memory connected to each processor through a shared memory bus. This allows other processors to access a computed variable for executing other segments of the program. By employing the barrier and channel structures, synchronization is realized between processors such that one processor may not change the value of a variable until another processor has read the old value of the variable. During execution a processor may use a computed variable several times within a particular segment of the program. Thus, it is advantageous to provide data caching at each processor in order that reference to the shared memory will not be required every time a shared variable computation is needed by the same processor which produced that shared variable. The system must make sure that processors are synchronized and that data caches are periodically flushed to avoid retaining an old value for a shared variable, in light of a newly written variable in the shared memory. Further, it is necessary to make certain that the computed shared value stored in the cache is written to the shared memory to be certain that all processors will operate from a common updated shared variable value. Under these conditions data caching will result in fewer accesses to the shared memory. A method according to the above has been described in D1: CYTRON et al., Automatic Management of Programmable Caches (extended abstract) Proc. International Conference on Parallel Processing, Vol. II (1988), Pennsylvania State University, US, p. 229-238. It is a specific object of this invention to provide a local data cache for each processor which reduces the necessity to access a shared variable memory, whilst in particular improving data management also upon exiting a synchronization interval. Now therefore, according to one of its aspects, the invention is characterized according to the characterizing part of Claim 1. The invention also relates to a processing system for practising the invention as claimed in claim 3. Further advantageous aspects of the invention are recited in the dependent Claim. BRIEF DESCRIPTION OF THE FIGURES Figure 1 is a block diagram illustrating a multiprocessor parallel processing computer. Figure 2 is an illustration of the architecture of a processor for the multiprocessing system of Figure 1. Figure 3 illustrates the programming steps for each of processors 12 and 14 to provide execution of a program code using shared variables. Figure 4 illustrates the operation of the data cache of processor 12 in executing the code of Figure 3. DESCRIPTION OF THE PREFERRED EMBODIMENT Figure 1 illustrates a rudimentary parallel processing scheme, wherein three processors, 12, 14, 15, are shown to execute a program 9. A compiler 11 provides segments of a compiled program to each of the processors 12, 14 and 15 for execution. The processors 12, 14 and 15 are synchronized via barrier instructions compiled within the program. The barrier instructions will be used to halt execution of a processor when synchronization is needed between each of the processors 12, 14 and 15. The barriers require that certain values calculated for a given variable be available to be read by other processors which may need the variable for execution of their assigned program segment. The barriers may be fuzzy barriers which permit the processor to execute a number of restricted instructions which do not require synchronization with other processors. Associated with each of the processors 12, 14 and 15 is a data cache 20, 21 and 22, capable of holding the values of shared variables computed by a respective processor. As in other parallel processing schemes, a shared memory 13 is provided which is written at appropriate intervals of execution of each of the processors 12, 14 and 15 with new values for a shared value. Not illustrated in the Figure associated with processors 12 and 14 are registers for storing fixed data values such as I, W and Z, which do not change for a given execution, or which are not needed by any of the other processors. The quantities will be discussed with respect to Figure 3. For clarity, only few details have been given. In particular, the processors/caches are connected to shared memory 13 via a bus 16; moreover, they are interconnected by a processor synchronization support mechanism symbolized by 10. Figure 2 illustrates in greater detail the organization of each of the processors 12, 14 and 15, including a channel register 18 and a barrier flag register of barrier logic circuit 22. A barrier flag register not shown is associated with each of the processors and includes a dedicated bit position corresponding to each of the processors 12, 14 and 15. When a processor has reached a barrier, as determined from internal programming statements, a valid flag is inserted in its respective dedicated bit position for each flag register of the barrier logic circuit 22 of each of the processors 12, 14 and 15. A channel register 18 is shown which provides an indication of the status of execution for a given processor, and adjacent processors. Thus, by making inquiry to the channel register, it is possible to ascertain whether or not certain computations by adjacent processors have been completed. In parallel processing systems using barrier synchronization, the channel register 18 offers another indication of the position where a parallel processor is in its execution sequence. Normally, when another processor has executed a certain statement in its program segment, a flag is posted in the channel register 18, identifying the fact that the processor has proceeded through the statement producing the flag. Thus, the channel register may be another means for identifying synchronization intervals for the respective processors. The control unit 25 provides the requisite signalling and data transfer among devices of Figure 2. Moreover, the Figure shows ALU 23, register file 24 and cache 20 interconnected by data paths heavily drawn, and control paths, somewhat lighther. The effects of executing code with parallel processors, and the advantages derived from using a data cache at each of the processors may be illustratede through a simple example. If the following piece of code is to be executed in two parallel processors, Figure 3 will illustrate the general processor execution sequence Processor 12 will be used to calculate new values for the vector A, and processor 14 will calculate new values for the vector B. Since the new value of B[I] requires the use of the older B vector calculations, it is necessary to synchronize the processors in order that the earlier B vector calculations are available to processor 12 before they are rewritten with newer calculated B values by processor 14. Variables W and Z are invariant within the loop and thus the register file 24 of each of the processors 12 and 14 may be preloaded with these values. The index value of I is independently computed in each processor. Register file 24 will maintain the current and previous values of the index variable I. Initially, the index values are set to 1 and 0, and at the end of each iteration, the value of I is copied to register 24. It is then incremented by 1. The pseudo code convention used to implement the foregoing loops for calculating A and B may be summarized as follows: MOV Ra, Rb Copy the contents of Ra into Rb Ld X, Rd Load content of memory location specified by X into register Rd ADD Ra, B, Rd Put the sum of Ra and B (either a register content or a constant) into Rd MUL Ra, C, Rd As in ADD but use the product instead of the sum ST Rs, X Store contents of register Rs into memory location specified by X CMP X,Y Set condition codes based on comparing X and Y BLT LAB Branch to LAB if the conditions indicate a "less than" result. Figure 3 illustrates the pseudo codes comprising the program segment for each of processors 12 and 14. Also illustrated in Figure 3 are the effects of a barrier provided in the software for each of processors 12 and 14. As is clear from the basic lines of code which are to be calculated, the value of B[R1] is loaded in register R4 by processor 14 and used in the calculation of A[R1] by processor 12. Processor 14 will store a new value of B[R1] at a portion of the program shown as instruction ST. The barrier, shown by the highlighted portions for the code in processors 12 and 14 will prevent the storage of a new value in R5 for B[R1] until the processor 12 has loaded B[R1] in its first pass through the loop. The processor 14 may be halted if processor 12 has not entered the barrier, the beginning instruction of which is LD A[R1], R5. During this time, using fuzzy barrier synchronization, the processor 14 may execute other tasks which need not be synchronized to the execution of processor 12 in the context of what is shown in the program of Figure 3. Of course, the two processors may cooperate in the execution of another program, but this will not influence the sequence of instructions that is qualitatively shown in Figure 3. Now, once processor 12 has progressed to the barrier, a flag will be set in barrier registers of the barrier registers of the barrier logic 22 of each of the processors, identifying that processor 12 has reached this barrier. Processor 14, if having reached the instruction ST R5, B[R1], will have placed a flag in the barrier register of barrier logic 22 as well, indicating that it has reached the barrier. Execution will resume through the barriers when the flags in the barrier register of barrier logic 22 have all been set to 1, indicating each processor is now free to change the value which the other processors may have needed for executing their segment of the program. In executing the code as shown in Figure 3, using two parallel processors 12 and 14, the operation of the data cache may be explained with reference to Figure 4, where three barriers are shown and control over the data cache as processor 1 executes its segment of the program. Prior to entering the first barrier, processor 12 would have data contained in register R4 which is the value of B[1], and in R3, the value for W. Upon entering the barrier, the value of B[1] will be a read value from the memory, which was not modified. The index value I is read from register R1. Since no values were modified by the processor, no further action needs to be taken until after the barrier is entered. Once having entered the barrier, the previous value of B[1] remains in 41. The processor will compute values for A[1] and retain the initial value of B[1]. The stored instruction ST, shown in Figure 3 for processor 12, will result in a modified copy of A[1] being provided. This modified value of A[1] is identified with an asterisk *. Before the processor 12 can exit the barrier region, any entries in its cache which have not been modified should be invalidated. Modified entries can be left as valid. Thus, just after exiting the barrier, the values for A[0] and B[1] are invalidated and flushed from the data cache 20, while the cache entry associated with A[1] is left unchanged. The invalidated and deleted data will therefore not be misread if another processor has since updated that shared value and written a new value into the shared memory location. Once the barrier region has been exited, the retained value of A[1] is supplemented by a newly read value B[2] from the shared memory in data cache 20. Before entering a barrier region 2, data in the cache which has been modified since being read, i.e., A[1]*, must be written back into the shared memory to permit other processors access to the newly calculated value. At this time, the value is retained in cache, and an indication that it has been written back to memory is provided in the cache. (This indication is represented by the absence of asterisk *). The value of B[2] having been read from the shared memory is also retained after entering the barrier region. Once entering the barrier region in 45, the values of A[1] and B[2] are retained during the fuzzy barrier period. During the fuzzy barrier period, a new value for A[2] is calculated in 46. Upon exiting the second barrier, the unmodified data including A[1] and B[2] are deleted from the cache memory, retaining only the previously modified value of A[2]. The programming execution continues in 48 with a new value B[3] being calculated. Using the foregoing rules, entry into the third barrier commences only after writing the new modified A[2] back to the shared memory, and providing an indication in the data cache 20 that it has been written back to the shared memory in 49 by deleting asterisk *. Thus, it can be seen that by retaining modified values of shared data values in the processor which had computed the modified value, unnecessary references to the shared memory are avoided. Additionally, the use of the barrier synchronization to delete unmodified values of a shared variable avoids the consequence of retaining and using an old data value which may have been updated and written to shared memory locations by another processor. Although barrier synchronization provides a convenient opportunity to control cache flushing and writing to shared memory, other synchronization may be implemented. For instance, reading and writing to channels provides a convenient measure of the relative position of each processor in parallel execution, and therefore permits control of the cache to flush unneeded data values and write to the shared memory. Thus, there is described with respect to one embodiment a technique for implementing local data cache operations for processors in a prallel processing system. Those skilled in the art will recognize yet other embodiments of the invention described more particularly by the Claims which follow.

Claims: A method for reducing the amount of traffic between a shared memory (13) having common variable data values and each of a plurality of processors in a parallel processing system wherein said plurality of processors (12,14,15) are organized to execute portions of a single compiled program, said program being organized to include synchronization intervals which provide synchronization of processors, said method comprising for each processor: storing computer values of program variables in a local data cache associated with a processor which computed said values; signalling cached data as either valid modified or valid unmodified since a particular past instant in time; prior to entering a synchronization interval, writing said valid modified data entries to said shared memory and changing the status of said valid modified data entries to valid unmodified entries; characterized by upon exiting a synchronization interval, deleting valid unmodified data entries and retaining valid modified entries in said data cache. The method of Claim 1 further comprising during entry of a subsequent synchronization interval, identifying modified data which has been written to said shared memory, and retaining said modified data in cache, whereby said subsequently maintained data is available in cache without requiring a subsequent access to said shared memory. A processing system comprising two or more processors (12,14,15) each having a data cache memory, and furthermore a shared memory interconnected to said processors, for collectively executing a particular single program, each processor having logic means (20,21,22) for indicating whether each other processor had entered a particular synchronization interval, and each processor having read means for reading said shared memory and writing means for writing locally generated data to said shared memory, and signalling means for signalling cached data as either valid modified or valid unmodified since a particular past instant in time; each processor further comprising : synchronization interval entering means for prior to entering said synchronization interval writing any valid modified data to said shared memory while resetting said signalling means to "valid unmodified"; characterized by each processor comprising synchronization interval exiting means for upon exiting said synchronization interval deleting exclusively valid unmodified cached data.

Inventors: WHELAN MICHAEL, WHELAN, MICHAEL
Applicants: KONINKL PHILIPS ELECTRONICS NV, KONINKLIJKE PHILIPS ELECTRONICS N.V.
Application year: 1991
Main classification: G06F12
IPC codes: G06F12, G06F15, G06F9