HOME

TheInfoList



OR:

In computer science, a parallel random-access machine (parallel RAM or PRAM) is a
shared-memory In computer science, shared memory is random-access memory, memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies. Shared memory is an efficient means of pass ...
abstract machine. As its name indicates, the PRAM is intended as the parallel-computing analogy to the random-access machine (RAM) (not to be confused with random-access memory). In the same way that the RAM is used by sequential-algorithm designers to model algorithmic performance (such as time complexity), the PRAM is used by parallel-algorithm designers to model parallel algorithmic performance (such as time complexity, where the number of processors assumed is typically also stated). Similar to the way in which the RAM model neglects practical issues, such as access time to cache memory versus main memory, the PRAM model neglects such issues as
synchronization Synchronization is the coordination of events to operate a system in unison. For example, the conductor of an orchestra keeps the orchestra synchronized or ''in time''. Systems that operate with all parts in synchrony are said to be synchronou ...
and communication, but provides any (problem-size-dependent) number of processors. Algorithm cost, for instance, is estimated using two parameters O(time) and O(time × processor_number).


Read/write conflicts

Read/write conflicts, commonly termed interlocking in accessing the same shared memory location simultaneously are resolved by one of the following strategies: #Exclusive read exclusive write (EREW)—every memory cell can be read or written to by only one processor at a time #Concurrent read exclusive write (CREW)—multiple processors can read a memory cell but only one can write at a time #Exclusive read concurrent write (ERCW)—never considered #Concurrent read concurrent write (CRCW)—multiple processors can read and write. A CRCW PRAM is sometimes called a concurrent random-access machine. Here, E and C stand for 'exclusive' and 'concurrent' respectively. The read causes no discrepancies while the concurrent write is further defined as: ::''Common''—all processors write the same value; otherwise is illegal ::''Arbitrary''—only one arbitrary attempt is successful, others retire ::''Priority''—processor rank indicates who gets to write ::Another kind of '' array reduction'' operation like SUM, Logical AND or MAX. Several simplifying assumptions are made while considering the development of algorithms for PRAM. They are: # There is no limit on the number of processors in the machine. # Any memory location is uniformly accessible from any processor. # There is no limit on the amount of shared memory in the system. # Resource contention is absent. # The programs written on these machines are, in general, of type SIMD. These kinds of algorithms are useful for understanding the exploitation of concurrency, dividing the original problem into similar sub-problems and solving them in parallel. The introduction of the formal 'P-RAM' model in Wyllie's 1979 thesisWyllie, James C
The Complexity of Parallel Computations
PhD Thesis, Dept. of Computer Science, Cornell University
had the aim of quantifying analysis of parallel algorithms in a way analogous to the Turing Machine. The analysis focused on a MIMD model of programming using a CREW model but showed that many variants, including implementing a CRCW model and implementing on an SIMD machine, were possible with only constant overhead.


Implementation

PRAM algorithms cannot be parallelized with the combination of
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
and
dynamic random-access memory Dynamic random-access memory (dynamic RAM or DRAM) is a type of random-access semiconductor memory that stores each bit of data in a memory cell, usually consisting of a tiny capacitor and a transistor, both typically based on metal-oxide ...
(DRAM) because DRAM does not allow concurrent access to a single bank (not even different addresses in the bank); but they can be implemented in hardware or read/write to the internal static random-access memory (SRAM) blocks of a
field-programmable gate array A field-programmable gate array (FPGA) is an integrated circuit designed to be configured by a customer or a designer after manufacturinghence the term '' field-programmable''. The FPGA configuration is generally specified using a hardware d ...
(FPGA), it can be done using a CRCW algorithm. However, the test for practical relevance of PRAM (or RAM) algorithms depends on whether their cost model provides an effective abstraction of some computer; the structure of that computer can be quite different than the abstract model. The knowledge of the layers of software and hardware that need to be inserted is beyond the scope of this article. But, articles such as demonstrate how a PRAM-like abstraction can be supported by the explicit multi-threading (XMT) paradigm and articles such as demonstrate that a PRAM algorithm for the maximum flow problem can provide strong speedups relative to the fastest serial program for the same problem. The article demonstrated that PRAM algorithms as-is can achieve competitive performance even without any additional effort to cast them as multi-threaded programs on XMT.


Example code

This is an example of SystemVerilog code which finds the maximum value in the array in only 2 clock cycles. It compares all the combinations of the elements in the array at the first clock, and merges the result at the second clock. It uses CRCW memory; m <= 1 and maxNo <= data /code> are written concurrently. The concurrency causes no conflicts because the algorithm guarantees that the same value is written to the same memory. This code can be run on
FPGA A field-programmable gate array (FPGA) is an integrated circuit designed to be configured by a customer or a designer after manufacturinghence the term '' field-programmable''. The FPGA configuration is generally specified using a hardware de ...
hardware. module FindMax #(parameter int len = 8) (input bit clock, resetN, input bit :0data en output bit :0maxNo); typedef enum bit :0 State; State state; bit m en int i, j; always_ff @(posedge clock, negedge resetN) begin if (!resetN) begin for (i = 0; i < len; i++) m <= 0; state <= COMPARE; end else begin case (state) COMPARE: begin for (i = 0; i < len; i++) begin for (j = 0; j < len; j++) begin if (data < data m <= 1; end end state <= MERGE; end MERGE: begin for (i = 0; i < len; i++) begin if (m

0) maxNo <= data end state <= DONE; end endcase end end endmodule


See also

* Analysis of PRAM algorithms * Flynn's taxonomy * Lock-free and wait-free algorithms * Random-access machine * Parallel programming model * XMTC * Parallel external memory (Model)


References

* * * * * * * *


External links


Saarland University's prototype PRAM

University Of Maryland's PRAM-On-Chip prototype
This prototype seeks to put many parallel processors and the fabric for inter-connecting them on a single chip
XMTC: PRAM-like Programming - Software release
{{Authority control Models of computation Analysis of parallel algorithms