Carnegie Mellon Parralel Computing Notes on Lecture 6

15 418 spring 2014 variants of send and receive

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 14 Message passing solver Note similar structure to shared address space solver, but now communication is explicit in message sends and receives Send and receive ghost rows Perform computation All threads send local mydiff to thread 0 Thread 0 evaluates termination predicate sends result back to all other threads Example pseudocode from: Culler, Singh, and Gupta CMU 15-418, Spring 2014 Notes on message passing example ▪ Computation - Array indexing is relative to local address space (not global grid coordinates) ▪ Communication: - Performed through messages Communicate entire rows at a time (not individual elements) ▪ Synchronization: - Performed through sends and receives Think of how to implement mutual exclusion, barriers, ags using messages ▪ For convenience: message passing libraries often include higher-level primitives (implemented using send and receive) Alternative solution using reduce/broadcast constructs CMU 15-418, Spring 2014 Variants of send and receive messages Send/Recv Synchronous Asynchronous Blocking async Non-blocking async ▪ Synchronous: - SEND: call returns when sender receives acknowledgement message data resides in address space of receiver RECV: call returns when data from message copied into address space of receiver and acknowledgement sent back to sender Sender: Receiver: Call SEND(foo) Copy data from sender’s address space buffer ‘foo’ into network buffer Send message Call RECV(bar) Receive ack SEND() returns Receive message...
View Full Document

This document was uploaded on 03/19/2014 for the course CMP 15-418 at Carnegie Mellon.

Ask a homework question - tutors are online