coa presentation5

17
Multi Processor Architecture

Upload: rickypatel151

Post on 07-Jul-2015

91 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Coa presentation5

Multi Processor Architecture

Page 2: Coa presentation5

Industry Demands More Processing Power For• Drug Design• To simulate engineering model• To general complex graphics in computer application• To process large amount of historical data and predict future trend• To predict financial and economical trends

Limitations of Single Processor Machine• Clock speed can not be increase further.• In Digital circuit maximum signal speed is as much as light speed.• More speed generate more heat.

Page 3: Coa presentation5

Multiprocessor SystemA multiprocessor system is an interconnection of two or more CPUs with memory and input output equipment.

Multiprocessor System

A multiprocessor system is an interconnection of two or more CPUs with memory and input output equipment.

Support concurrent operations.

Multicomputer System

A multicomputer system consists of several autonomous computers interconnected with other by means of communication lines.

Support concurrent operations.

A multiprocessor system is controlled by one operating system that providesinteraction between processors and all the components of the system cooperate in thesolution of a problem.

Page 4: Coa presentation5

Multiprocessor System Benefits

Reliability

Multiprocessing improves the reliability of the system so that a failure or error in onepart has a limited effect on the rest of the system. If a fault causes one processor tofail, a second processor can be assigned to perform the functions of the disabledprocessor.

Improved System Performance

The system derives its high performance from the fact that computations can proceed in parallel in one of two ways.

1. Multiple independent jobs can be made to operate in parallel.2. A single job can be partitioned into multiple parallel tasks.

Page 5: Coa presentation5

Memory Organization in MultiprocessorsMultiprocessors are classified by the way their memory is organized.

Shared Memory / Tightly Coupled MultiprocessorA multiprocessor system with common shared memory is classified as a shared memory or tightly coupled multiprocessor.

Tightly Coupled System

Page 6: Coa presentation5

Loosely Coupled SystemIn loosely coupled system, each processor element has its own private local memory. The processors are tied together and communicate with one another through a message passing scheme.

Loosely Coupled System

Page 7: Coa presentation5

Inter processor Communication and SynchronizationInter processor CommunicationCommunication refers to the exchange of data between different processors. Processors in amultiprocessor system must be provided with a facility for communicating with each other. Acommunication path can be established through common input-output channels. In a sharedmemory multiprocessor system, the most common procedure is to set aside a portion ofmemory that is accessible to all processors. The primary use of the common memory is to actas a message center similar to mailbox, where each processor can leave messages for otherprocessors.

P1 P2 P3

Shared Memory

Data for other processors

Page 8: Coa presentation5

Race conditionWhen two processes try to access shared data simultaneously, it will leave data in abnormalcondition this situation is known as race condition.

Balance=5000

P1 P2

Read BalanceBalance=Balace-1000Write Balance

Read BalanceBalance=Balace-2000Write Balance

Page 9: Coa presentation5

Mutual Exclusion with a Semaphore(Synchronization)A properly functioning multiprocessor system must provide a mechanism that will guaranteeorderly access to shared memory and other shared resources. This is necessary to protectdata from being changed simultaneously by tow or more processors. This mechanism hasbeen termed mutual exclusion.

Mutual exclusion must be provided in a multiprocessor system to enable one processor toexclude or lock out access to a shared resource by other processors when it is in a criticalsection. A critical section is a program sequence that, once begun, must complete executionbefore another processor accesses the same shared resource.

A binary variable called a semaphore is often used to indicate whether or not a processor isexecuting a critical section. A semaphore is a software controlled flag that is stored in amemory location that all processors can access. When the semaphore is equal to 1, it meansthat a processor is executing a critical program, so that the shared memory is not available toother processors. When the semaphore is equal to 0, the shared memory is available to anyrequesting processor.

Page 10: Coa presentation5

Balance=5000

P1 P2

Read BalanceBalance=Balace-1000Write Balance

Read BalanceBalance=Balace-2000Write Balance

critical section

semaphore

Page 11: Coa presentation5

What is Cache?

Cache Memory : “A computer memory with very short access time used for storage of frequently used instructions or data” – webster.com

Cache memory function:• an extremely fast memory that is built into a computer’s central processing unit (CPU),

or located next to it on a separate chip.• The CPU uses cache memory to store instructions that are repeatedly required to run

programs.• When the processor needs to read from or write to a location in main memory, it first

checks whether a copy of that data is in the cache

Page 12: Coa presentation5

Cache in multiprocessor system issues

Issue 1Since all the processors share the same address space, it is possible for more than one processor to cache an address at the same time.(coherence issue)

Issue 2If one processor updates the data item without informing the other processor, inconsistencymay result and cause incorrect execution.(consistency issue)

Page 13: Coa presentation5

Cache Coherence Problem

X=52

X=52

P1

X=52

P2

X=52

P3

Step 1 Processor P1 reads XStep 2 Processor P2 reads X

Step 3 Processor P3 reads X

Main Memory

Cache Memory

Processors

Page 14: Coa presentation5

X=120

X=120

P1

X=52

P2

X=52

P3

Step 4 Processor P1 writes 120 to X. With write- through policy updated in memory.Step 5 Processor P2 read X from cache. Inconsistent Value.

Step 6 Processor P3 read X from cache. Inconsistent Value.

Unacceptable: leads to incorrect program execution.

Cache Memory

Processors

Main Memory

Page 15: Coa presentation5

Solution to Cache Coherence Problem

Solution 1 A simple scheme is to disallow private caches for each processors and have a shared cachememory associated with main memory. Every data access is made to the shared cache. Thismethod violates the principle of closeness of CPU to cache and increases the average memoryaccess time.

Solution 2 Allow only non shared and read only data to be stored in caches. This method introduces extrasoftware overhead that may degrade performance.

Solution 3Bus snooping protocols : Used in bus-based systems where all the processors observe memory transactions and take proper action to invalidate or update the local cache content if needed.

Page 16: Coa presentation5

Parallel Processing Concepts

Parallel processing is the simultaneous execution of the same task, split into subtasks, onmultiple processors in order to obtain results faster. The idea is based on the fact that theprocess of solving a problem can usually be divided into smaller tasks, which may be solvedout simultaneously with some coordination mechanisms.

In order to explain what is meant by parallelism inherent in the solution of a problem, let usdiscuss an example of submission of electricity bills. Suppose there are 10000 residents in alocality and they are supposed to submit their electricity bills in one office.Let us assume the steps to submit the bill are as follows:

1) Go to the appropriate counter to take the form to submit the bill. 2) Submit the filled form along with cash. 3) Get the receipt of submitted bill.

Page 17: Coa presentation5

Assume that there is only one counter with just single office person performing all the tasksof giving application forms, accepting the forms, counting the cash, returning the cash if theneed be, and giving the receipts.This situation is an example of sequential execution. Let us the approximate time taken by various of events be as follows:

Giving application form = 5 seconds Accepting filled application form and counting the cash and returning, if required = 5mnts, i.e., 5 ×60= 300 sec. Giving receipts = 5 seconds. Total time taken in processing one bill = 5+300+5 = 310 seconds.

Now, if we have 3 persons sitting at three different counters with i) One person giving the bill submission form ii) One person accepting the cash and returning,if necessary and iii) One person giving the receipt.

The time required to process one bill will be 300 seconds because the first and third activitywill overlap with the second activity which takes 300 sec. whereas the first and last activitytake only 10 secs each. This is an example of a parallel processing method as here 3 personswork in parallel. As three persons work in the same time, it is called temporal parallelism.However, this is a poor example of parallelism in the sense that one of the actions i.e., thesecond action takes 30 times of the time taken by each of the other.