SlideShare a Scribd company logo
1 of 51
1
Chapter 9
Distributed Shared Memory
2
Distributed Shared Memory
Making the main memory of a cluster of computers look as though
it is a single memory with a single address space.
Then can use shared memory programming techniques.
3
DSM System
Still need messages or mechanisms to get data to processor, but
these are hidden from the programmer:
4
Advantages of DSM
• System scalable
• Hides the message passing - do not explicitly specific sending
messages between processes
• Can us simple extensions to sequential programming
• Can handle complex and large data bases without replication
or sending the data to processes
5
Disadvantages of DSM
• May incur a performance penalty
• Must provide for protection against simultaneous access to
shared data (locks, etc.)
• Little programmer control over actual messages being generated
• Performance of irregular problems in particular may be difficult
6
Methods of Achieving DSM
• Hardware
Special network interfaces and cache coherence circuits
• Software
Modifying the OS kernel
Adding a software layer between the operating system
and the application - most convenient way for teaching
purposes
7
Software DSM Implementation
• Page based - Using the system’s virtual memory
• Shared variable approach- Using routines to access
shared variables
• Object based- Shared data within collection of objects.
Access to shared data through object oriented discipline
(ideally)
8
Software Page Based DSM
Implementation
9
Some Software DSM Systems
• Treadmarks
Page based DSM system
Apparently not now available
• JIAJIA
C based
Obtained at UNC-Charlotte but required significant
modifications for our system (in message-passing
calls)
• Adsmith object based
C++ library routines
We have this installed on our cluster - chosen for teaching
10
Consistency Models
• Strict Consistency - Processors sees most recent update,
i.e. read returns the most recent wrote to location.
• Sequential Consistency - Result of any execution same as
an interleaving of individual programs.
• Relaxed Consistency- Delay making write visible to reduce
messages.
• Weak consistency - programmer must use synchronization
operations to enforce sequential consistency when
necessary.
• Release Consistency - programmer must use specific
synchronization operators, acquire and release.
• Lazy Release Consistency - update only done at time of
acquire.
11
Strict Consistency
Every write immediately visible
Disadvantages: number of messages, latency, maybe unnecessary.
12
Consistency Models used on DSM Systems
Release Consistency
An extension of weak consistency in which the synchronization
operations have been specified:
• acquire operation - used before a shared variable or variables
are to be read.
• release operation - used after the shared variable or variables
have been altered (written) and allows another process to
access to the variable(s)
Typically acquire is done with a lock operation and release by an
unlock operation (although not necessarily).
13
Release Consistency
14
Lazy Release Consistency
Advantages: Fewer messages
15
Adsmith
16
Adsmith
• User-level libraries that create distributed shared memory system
on a cluster.
• Object based DSM - memory seen as a collection of objects that
can be shared among processes on different processors.
• Written in C++
• Built on top of pvm
• Freely available - installed on UNCC cluster
User writes application programs in C or C++ and calls Adsmith
routines for creation of shared data and control of its access.
17
Adsmith Routines
These notes are based upon material in Adsmith User
Interface document.
18
Initialization/Termination
Explicit initialization/termination of Adsmith not necessary.
19
Process
To start a new process or processes:
adsm_spawn(filename, count)
Example
adsm_spawn(“prog1”,10);
starts 10 copies of prog1 (10 processes). Must use Adsmith
routine to start a new process. Also version of adsm_spawn() with
similar parameters to pvm_spawn().
20
Process “join”
adsmith_wait();
will cause the process to wait for all its child processes (processes
it created) to terminate.
Versions available to wait for specific processes to terminate,
using pvm tid to identify processes. Then would need to use the
pvm form of adsmith() that returns the tids of child processes.
21
Access to shared data (objects)
Adsmith uses “release consistency.” Programmer explicitly needs
to control competing read/write access from different processes.
Three types of access in Adsmith, differentiated by the use of the
shared data:
• Ordinary Accesses - For regular assignment statements
accessing shared variables.
• Synchronization Accesses - Competing accesses used for
synchronization purposes.
• Non-Synchronization Accesses - Competing accesses, not
used for synchronization.
22
Ordinary Accesses - Basic read/write actions
Before read, do:
adsm_refresh()
to get most recent value - an “acquire/load.” After write, do:
adsm_flush()
to store result - “store”
Example
int *x; //shared variable
.
.
adsm_refresh(x);
a = *x + b;
23
Synchronization accesses
To control competing accesses:
• Semaphores
• Mutex’s (Mutual exclusion variables)
• Barriers.
available. All require an identifier to be specified as all three
class instances are shared between processes.
24
Semaphore routines
Four routines:
wait()
signal()
set()
get().
class AdsmSemaphore {
public:
AdsmSemaphore( char *identifier, int init = 1 );
void wait();
void signal();
void set( int value);
void get();
};
25
Mutual exclusion variables – Mutex
Two routines
lock
unlock()
class AdsmMutex {
public:
AdsmMutex( char *identifier );
void lock();
void unlock();
};
26
Example
int *sum;
AdsmMutex x(“mutex”);
x.lock();
adsm_refresh(sum);
*sum += partial_sum;
adsm_flush(sum);
x.unlock();
27
Barrier Routines
One barrier routine
barrier()
class AdsmBarrier {
public:
AdsmBarrier( char *identifier );
void barrier( int count);
};
28
Example
AdsmBarrier barrier1(“sample”);
.
.
barrier1.barrier(procno);
29
Non-synchronization Accesses
For competing accesses that are not for synchronization:
adsm_refresh_now( void *ptr );
And
adsm_flush_now( void *ptr );
refresh and flush take place on home location (rather
than locally) and immediately.
30
Features to Improve Performance
Routines that can be used to overlap messages or reduce
number of messages:
• Prefetch
• Bulk Transfer
• Combined routines for critical sections
31
Prefetch
adsm_prefetch( void *ptr )
used before adsm_refresh() to get data as early as possible.
Non-blocking so that can continue with other work prior to
issuing refresh.
32
Bulk Transfer
Combines consecutive messages to reduce number. Can apply
only to “aggregating”:
adsm_malloc( AdsmBulkType *type );
adsm_prefetch( AdsmBulkType *type )
adsm_refresh( AdsmBulkType *type )
adsm_flush( AdsmBulkType *type )
where AdsmBulkType is defined as:
enum AdsmBulkType {
adsmBulkBegin,
AdsmBulkEnd
}
Use parameters AdsmBulkBegin and AdsmBulkEnd in pairs to
“aggregate” actions.
Easy to add afterwards to improve performance.
33
Example
adsm_refresh(AdsmBulkBegin);
adsm_refresh(x);
adsm_refresh(y);
adsm_refresh(z);
adsm_refresh(AdsmBulkEnd);
34
Routines to improve performance of
critical sections
Called “Atomic Accesses” in Adsmith.
adsm_atomic_begin()
adsm_atomic_end()
Replaces two routines and reduces number of messages.
35
Sending an expression to be executed
on home process
Can reduce number of messages. Called “Active Access” in
Adsmith. Achieved with:
adsm_atomic(void *ptr, char *expression);
where the expression is written as [type] expression.
Object pointed by ptr is the only variable allowed in the expression
(and indicated in this expression with the symbol @).
36
Collect Access
Efficient routines for shared objects used as an accumulator:
void adsm_collect_begin(void *ptr, int num);
void adsm_collect_end(void *ptr);
where num is the number of processes involved in the access, and *ptr
points to the shared accumulator
Example
(from page 10 of Adsmith User Interface document):
int partial_sum = ... ; // calculate the partial sum
adsm_collect_begin(sum,nproc);
sum+=partial_sum; //add partial sum
adsm_collect_end(sum); //total; sum is returned
37
Other Features
Pointers
Can be shared but need to use adsmith address translation
routines to convert local address to a globally recognizable
address and back to an local address:
To translates local address to global address (an int)
int adsm_gid(void *ptr);
To translates global address back to local address for use by
requesting process
void *adsm_attach(int gid);
38
Message passing
Can use PVM routines in same program but must use
adsm_spawn() to create processes (not pvm_spawn().
Message tags MAXINT-6 to MAXINT used by Adsmith.
39
Information Retrieval Routines
For getting host ids (zero to number of hosts -1) or process id (zero to
number of processes -1):
int adsm_hostno(int procno = -1);
- Returns host id where process specified by process number
procno resides. (If procno not specified, returns host id of calling
process).
int adsm_procno();
-Returns process id of calling process.
int adsm_procno2tid(int procno);
-Translates process id to corresponding PVM task id.
int adsm_tid2procno(int tid)
translates PVM task id to corresponding process id.
40
DSM Implementation Projects
Using underlying message-passing software
• Easy to do
• Can sit on top of message-passing software such as MPI.
41
Issues in Implementing a DSM
System
• Managing shared data - reader/writer policies
• Timing issues - relaxing read/write orders
42
Reader/Writer Policies
• Single reader/single writer policy - simple to do with
centralized servers
• Multiple reader/single writer policy - again quite simple
to do
• Multiple reader/multiple writer policy - tricky
43
Simple DSM system using a
centralized server
44
Simple DSM system using multiple servers
45
Simple DSM system using multiple
servers and multiple reader policy
46
Shared Data with Overlapping
Regions A New Concept Developed at
UNC-Charlotte
Based upon earlier work on so-called over-lapping
connectivity interconnection networks
A large family of scalable interconnection networks devised –
all have characteristic of overlapping domains that nodes can
Interconnect
Many applications require communication to logically nearby
processors
47
Overlapping Regions
48
Symmetrical Multiprocessor System with
Overlapping Data Regions
49
Static and Dynamic Overlapping
Groups
• Static - defined prior to program execution – add
routines for declaring and specifying these groups
• Dynamic - shared variable migration during program
execution
50
Shared Variable Migration between Data
Regions
51
DSM Projects
• Write a DSM system in C++ using MPI for the underlying
message-passing and process communication.
• Write a DSM system in Java using MPI for the underlying
message-passing and process communication.
• (More advanced) One of the fundamental disadvantages of
software DSM system is the lack of control over the
underlying message passing. Provide parameters in a DSM
routine to be able to control the message-passing. Write
routines that allow communication and computation to be
overlapped.

More Related Content

Similar to slides9.ppt

Aman 16 os sheduling algorithm methods.pptx
Aman 16 os sheduling algorithm methods.pptxAman 16 os sheduling algorithm methods.pptx
Aman 16 os sheduling algorithm methods.pptxvikramkagitapu
 
distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxlencho3d
 
Distributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using OpenshmemDistributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using OpenshmemIJERA Editor
 
Distributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using OpenshmemDistributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using OpenshmemIJERA Editor
 
Firewalld : A New Interface to Your Netfilter Stack
Firewalld : A New Interface to Your Netfilter StackFirewalld : A New Interface to Your Netfilter Stack
Firewalld : A New Interface to Your Netfilter StackMahmoud Shiri Varamini
 
5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptxMohamedBilal73
 
Parallel Processing Presentation2
Parallel Processing Presentation2Parallel Processing Presentation2
Parallel Processing Presentation2daniyalqureshi712
 
How to access the Netapp cluster mode 8.2 through CLI (command mode)
How to access the Netapp cluster mode 8.2 through CLI (command mode)How to access the Netapp cluster mode 8.2 through CLI (command mode)
How to access the Netapp cluster mode 8.2 through CLI (command mode)Saroj Sahu
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationMani Deepak Choudhry
 
Programming using MPI and OpenMP
Programming using MPI and OpenMPProgramming using MPI and OpenMP
Programming using MPI and OpenMPDivya Tiwari
 
Project of deamon process
Project of deamon processProject of deamon process
Project of deamon processAbubakr Cheema
 
MYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxMYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxArjayBalberan1
 

Similar to slides9.ppt (20)

Aman 16 os sheduling algorithm methods.pptx
Aman 16 os sheduling algorithm methods.pptxAman 16 os sheduling algorithm methods.pptx
Aman 16 os sheduling algorithm methods.pptx
 
cpu-affinity
cpu-affinitycpu-affinity
cpu-affinity
 
distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptx
 
Backtrack Manual Part6
Backtrack Manual Part6Backtrack Manual Part6
Backtrack Manual Part6
 
Distributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using OpenshmemDistributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using Openshmem
 
Distributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using OpenshmemDistributed Shared Memory – A Survey and Implementation Using Openshmem
Distributed Shared Memory – A Survey and Implementation Using Openshmem
 
Firewalld : A New Interface to Your Netfilter Stack
Firewalld : A New Interface to Your Netfilter StackFirewalld : A New Interface to Your Netfilter Stack
Firewalld : A New Interface to Your Netfilter Stack
 
5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx
 
Open shmem
Open shmemOpen shmem
Open shmem
 
Real time operating systems
Real time operating systemsReal time operating systems
Real time operating systems
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
Creating templates
Creating templatesCreating templates
Creating templates
 
Open MPI 2
Open MPI 2Open MPI 2
Open MPI 2
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
 
Parallel Processing Presentation2
Parallel Processing Presentation2Parallel Processing Presentation2
Parallel Processing Presentation2
 
How to access the Netapp cluster mode 8.2 through CLI (command mode)
How to access the Netapp cluster mode 8.2 through CLI (command mode)How to access the Netapp cluster mode 8.2 through CLI (command mode)
How to access the Netapp cluster mode 8.2 through CLI (command mode)
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
Programming using MPI and OpenMP
Programming using MPI and OpenMPProgramming using MPI and OpenMP
Programming using MPI and OpenMP
 
Project of deamon process
Project of deamon processProject of deamon process
Project of deamon process
 
MYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxMYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptx
 

More from nazimsattar

Pr.SE2.361101659.pptx
Pr.SE2.361101659.pptxPr.SE2.361101659.pptx
Pr.SE2.361101659.pptxnazimsattar
 
vehiculr networks.ppt
vehiculr networks.pptvehiculr networks.ppt
vehiculr networks.pptnazimsattar
 
ad-hoc 16 4 2018.ppt
ad-hoc 16 4 2018.pptad-hoc 16 4 2018.ppt
ad-hoc 16 4 2018.pptnazimsattar
 
Cellular Wireless Networks p1 chap 2.pptx
Cellular Wireless Networks p1 chap 2.pptxCellular Wireless Networks p1 chap 2.pptx
Cellular Wireless Networks p1 chap 2.pptxnazimsattar
 
Cellular Wireless Networks part2.pptx
Cellular Wireless Networks part2.pptxCellular Wireless Networks part2.pptx
Cellular Wireless Networks part2.pptxnazimsattar
 
parallel programming.ppt
parallel programming.pptparallel programming.ppt
parallel programming.pptnazimsattar
 

More from nazimsattar (20)

Pr.SE2.361101659.pptx
Pr.SE2.361101659.pptxPr.SE2.361101659.pptx
Pr.SE2.361101659.pptx
 
ch10.ppt
ch10.pptch10.ppt
ch10.ppt
 
vehiculr networks.ppt
vehiculr networks.pptvehiculr networks.ppt
vehiculr networks.ppt
 
ad-hoc 16 4 2018.ppt
ad-hoc 16 4 2018.pptad-hoc 16 4 2018.ppt
ad-hoc 16 4 2018.ppt
 
Cellular Wireless Networks p1 chap 2.pptx
Cellular Wireless Networks p1 chap 2.pptxCellular Wireless Networks p1 chap 2.pptx
Cellular Wireless Networks p1 chap 2.pptx
 
Cellular Wireless Networks part2.pptx
Cellular Wireless Networks part2.pptxCellular Wireless Networks part2.pptx
Cellular Wireless Networks part2.pptx
 
slides11.ppt
slides11.pptslides11.ppt
slides11.ppt
 
types of DS.ppt
types of DS.ppttypes of DS.ppt
types of DS.ppt
 
parallel programming.ppt
parallel programming.pptparallel programming.ppt
parallel programming.ppt
 
slides10.ppt
slides10.pptslides10.ppt
slides10.ppt
 
slides8.ppt
slides8.pptslides8.ppt
slides8.ppt
 
slides7.ppt
slides7.pptslides7.ppt
slides7.ppt
 
slides6.ppt
slides6.pptslides6.ppt
slides6.ppt
 
slides5.ppt
slides5.pptslides5.ppt
slides5.ppt
 
slides4.ppt
slides4.pptslides4.ppt
slides4.ppt
 
slides2.ppt
slides2.pptslides2.ppt
slides2.ppt
 
chap2.ppt
chap2.pptchap2.ppt
chap2.ppt
 
351101835.pptx
351101835.pptx351101835.pptx
351101835.pptx
 
351101042.ppt
351101042.ppt351101042.ppt
351101042.ppt
 
331103344.ppt
331103344.ppt331103344.ppt
331103344.ppt
 

Recently uploaded

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

slides9.ppt

  • 2. 2 Distributed Shared Memory Making the main memory of a cluster of computers look as though it is a single memory with a single address space. Then can use shared memory programming techniques.
  • 3. 3 DSM System Still need messages or mechanisms to get data to processor, but these are hidden from the programmer:
  • 4. 4 Advantages of DSM • System scalable • Hides the message passing - do not explicitly specific sending messages between processes • Can us simple extensions to sequential programming • Can handle complex and large data bases without replication or sending the data to processes
  • 5. 5 Disadvantages of DSM • May incur a performance penalty • Must provide for protection against simultaneous access to shared data (locks, etc.) • Little programmer control over actual messages being generated • Performance of irregular problems in particular may be difficult
  • 6. 6 Methods of Achieving DSM • Hardware Special network interfaces and cache coherence circuits • Software Modifying the OS kernel Adding a software layer between the operating system and the application - most convenient way for teaching purposes
  • 7. 7 Software DSM Implementation • Page based - Using the system’s virtual memory • Shared variable approach- Using routines to access shared variables • Object based- Shared data within collection of objects. Access to shared data through object oriented discipline (ideally)
  • 8. 8 Software Page Based DSM Implementation
  • 9. 9 Some Software DSM Systems • Treadmarks Page based DSM system Apparently not now available • JIAJIA C based Obtained at UNC-Charlotte but required significant modifications for our system (in message-passing calls) • Adsmith object based C++ library routines We have this installed on our cluster - chosen for teaching
  • 10. 10 Consistency Models • Strict Consistency - Processors sees most recent update, i.e. read returns the most recent wrote to location. • Sequential Consistency - Result of any execution same as an interleaving of individual programs. • Relaxed Consistency- Delay making write visible to reduce messages. • Weak consistency - programmer must use synchronization operations to enforce sequential consistency when necessary. • Release Consistency - programmer must use specific synchronization operators, acquire and release. • Lazy Release Consistency - update only done at time of acquire.
  • 11. 11 Strict Consistency Every write immediately visible Disadvantages: number of messages, latency, maybe unnecessary.
  • 12. 12 Consistency Models used on DSM Systems Release Consistency An extension of weak consistency in which the synchronization operations have been specified: • acquire operation - used before a shared variable or variables are to be read. • release operation - used after the shared variable or variables have been altered (written) and allows another process to access to the variable(s) Typically acquire is done with a lock operation and release by an unlock operation (although not necessarily).
  • 16. 16 Adsmith • User-level libraries that create distributed shared memory system on a cluster. • Object based DSM - memory seen as a collection of objects that can be shared among processes on different processors. • Written in C++ • Built on top of pvm • Freely available - installed on UNCC cluster User writes application programs in C or C++ and calls Adsmith routines for creation of shared data and control of its access.
  • 17. 17 Adsmith Routines These notes are based upon material in Adsmith User Interface document.
  • 19. 19 Process To start a new process or processes: adsm_spawn(filename, count) Example adsm_spawn(“prog1”,10); starts 10 copies of prog1 (10 processes). Must use Adsmith routine to start a new process. Also version of adsm_spawn() with similar parameters to pvm_spawn().
  • 20. 20 Process “join” adsmith_wait(); will cause the process to wait for all its child processes (processes it created) to terminate. Versions available to wait for specific processes to terminate, using pvm tid to identify processes. Then would need to use the pvm form of adsmith() that returns the tids of child processes.
  • 21. 21 Access to shared data (objects) Adsmith uses “release consistency.” Programmer explicitly needs to control competing read/write access from different processes. Three types of access in Adsmith, differentiated by the use of the shared data: • Ordinary Accesses - For regular assignment statements accessing shared variables. • Synchronization Accesses - Competing accesses used for synchronization purposes. • Non-Synchronization Accesses - Competing accesses, not used for synchronization.
  • 22. 22 Ordinary Accesses - Basic read/write actions Before read, do: adsm_refresh() to get most recent value - an “acquire/load.” After write, do: adsm_flush() to store result - “store” Example int *x; //shared variable . . adsm_refresh(x); a = *x + b;
  • 23. 23 Synchronization accesses To control competing accesses: • Semaphores • Mutex’s (Mutual exclusion variables) • Barriers. available. All require an identifier to be specified as all three class instances are shared between processes.
  • 24. 24 Semaphore routines Four routines: wait() signal() set() get(). class AdsmSemaphore { public: AdsmSemaphore( char *identifier, int init = 1 ); void wait(); void signal(); void set( int value); void get(); };
  • 25. 25 Mutual exclusion variables – Mutex Two routines lock unlock() class AdsmMutex { public: AdsmMutex( char *identifier ); void lock(); void unlock(); };
  • 27. 27 Barrier Routines One barrier routine barrier() class AdsmBarrier { public: AdsmBarrier( char *identifier ); void barrier( int count); };
  • 29. 29 Non-synchronization Accesses For competing accesses that are not for synchronization: adsm_refresh_now( void *ptr ); And adsm_flush_now( void *ptr ); refresh and flush take place on home location (rather than locally) and immediately.
  • 30. 30 Features to Improve Performance Routines that can be used to overlap messages or reduce number of messages: • Prefetch • Bulk Transfer • Combined routines for critical sections
  • 31. 31 Prefetch adsm_prefetch( void *ptr ) used before adsm_refresh() to get data as early as possible. Non-blocking so that can continue with other work prior to issuing refresh.
  • 32. 32 Bulk Transfer Combines consecutive messages to reduce number. Can apply only to “aggregating”: adsm_malloc( AdsmBulkType *type ); adsm_prefetch( AdsmBulkType *type ) adsm_refresh( AdsmBulkType *type ) adsm_flush( AdsmBulkType *type ) where AdsmBulkType is defined as: enum AdsmBulkType { adsmBulkBegin, AdsmBulkEnd } Use parameters AdsmBulkBegin and AdsmBulkEnd in pairs to “aggregate” actions. Easy to add afterwards to improve performance.
  • 34. 34 Routines to improve performance of critical sections Called “Atomic Accesses” in Adsmith. adsm_atomic_begin() adsm_atomic_end() Replaces two routines and reduces number of messages.
  • 35. 35 Sending an expression to be executed on home process Can reduce number of messages. Called “Active Access” in Adsmith. Achieved with: adsm_atomic(void *ptr, char *expression); where the expression is written as [type] expression. Object pointed by ptr is the only variable allowed in the expression (and indicated in this expression with the symbol @).
  • 36. 36 Collect Access Efficient routines for shared objects used as an accumulator: void adsm_collect_begin(void *ptr, int num); void adsm_collect_end(void *ptr); where num is the number of processes involved in the access, and *ptr points to the shared accumulator Example (from page 10 of Adsmith User Interface document): int partial_sum = ... ; // calculate the partial sum adsm_collect_begin(sum,nproc); sum+=partial_sum; //add partial sum adsm_collect_end(sum); //total; sum is returned
  • 37. 37 Other Features Pointers Can be shared but need to use adsmith address translation routines to convert local address to a globally recognizable address and back to an local address: To translates local address to global address (an int) int adsm_gid(void *ptr); To translates global address back to local address for use by requesting process void *adsm_attach(int gid);
  • 38. 38 Message passing Can use PVM routines in same program but must use adsm_spawn() to create processes (not pvm_spawn(). Message tags MAXINT-6 to MAXINT used by Adsmith.
  • 39. 39 Information Retrieval Routines For getting host ids (zero to number of hosts -1) or process id (zero to number of processes -1): int adsm_hostno(int procno = -1); - Returns host id where process specified by process number procno resides. (If procno not specified, returns host id of calling process). int adsm_procno(); -Returns process id of calling process. int adsm_procno2tid(int procno); -Translates process id to corresponding PVM task id. int adsm_tid2procno(int tid) translates PVM task id to corresponding process id.
  • 40. 40 DSM Implementation Projects Using underlying message-passing software • Easy to do • Can sit on top of message-passing software such as MPI.
  • 41. 41 Issues in Implementing a DSM System • Managing shared data - reader/writer policies • Timing issues - relaxing read/write orders
  • 42. 42 Reader/Writer Policies • Single reader/single writer policy - simple to do with centralized servers • Multiple reader/single writer policy - again quite simple to do • Multiple reader/multiple writer policy - tricky
  • 43. 43 Simple DSM system using a centralized server
  • 44. 44 Simple DSM system using multiple servers
  • 45. 45 Simple DSM system using multiple servers and multiple reader policy
  • 46. 46 Shared Data with Overlapping Regions A New Concept Developed at UNC-Charlotte Based upon earlier work on so-called over-lapping connectivity interconnection networks A large family of scalable interconnection networks devised – all have characteristic of overlapping domains that nodes can Interconnect Many applications require communication to logically nearby processors
  • 48. 48 Symmetrical Multiprocessor System with Overlapping Data Regions
  • 49. 49 Static and Dynamic Overlapping Groups • Static - defined prior to program execution – add routines for declaring and specifying these groups • Dynamic - shared variable migration during program execution
  • 50. 50 Shared Variable Migration between Data Regions
  • 51. 51 DSM Projects • Write a DSM system in C++ using MPI for the underlying message-passing and process communication. • Write a DSM system in Java using MPI for the underlying message-passing and process communication. • (More advanced) One of the fundamental disadvantages of software DSM system is the lack of control over the underlying message passing. Provide parameters in a DSM routine to be able to control the message-passing. Write routines that allow communication and computation to be overlapped.