




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1Distributed Shared Memory2Distributed Shared MemoryMaking 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.3DSM SystemStill need messages or mechanisms to get data to processor, butthese are
2、hidden from the programmer:4Advantages of DSM System scalable Hides the message passing - do not explicitly specific sending messages between processes Can use simple extensions to sequential programming Can handle complex and large data bases without replication or sending the data to processes5Dis
3、advantages 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 difficult6Methods of Achieving DSM HardwareSpec
4、ial network interfaces and cache coherence circuits SoftwareModifying the OS kernelAdding a software layer between the operating system and the application7Software DSM Implementation Page based - Using the systems virtual memory Shared variable approach- Using routines to access shared variables Ob
5、ject based- Shared data within collection of objects. Access to shared data through object oriented discipline (ideally)8Software Page Based DSM Implementation9Some Software DSM Systems TreadmarksPage based DSM systemApparently not now available JIAJIAC basedObtained at UNC-Charlotte but required si
6、gnificantmodifications for system (in message-passing calls) Adsmith object basedC+ library routines10Consistency 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 interleav
7、ing 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 an
8、d release. Lazy Release Consistency - update only done at time of acquire.11Strict ConsistencyEvery write immediately visibleDisadvantages: number of messages, latency, maybe unnecessary.12Consistency Models used on DSM SystemsRelease ConsistencyAn extension of weak consistency in which the synchron
9、izationoperations 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 lo
10、ck operation and release by anunlock operation (although not necessarily).13Release Consistency14Lazy Release ConsistencyAdvantages: Fewer messages15Adsmith16Adsmith User-level libraries that create distributed shared memory system on a cluster. Object based DSM - memory seen as a collection of obje
11、cts 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.17Adsmith Routines18Initializati
12、on/TerminationExplicit initialization/termination of Adsmith not necessary.19Process To start a new process or processes:adsm_spawn(filename, count)Exampleadsm_spawn(“prog1”,10);starts 10 copies of prog1 (10 processes). Must use Adsmith routine to start a new process. Also version of adsm_spawn() wi
13、th similar parameters to pvm_spawn().20Process “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
14、of adsmith() that returns the tids of child processes.21Access 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 theshared data: Ordina
15、ry 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.22Ordinary Accesses - Basic read/write actionsBefore read, do:a
16、dsm_refresh()to get most recent value - an “acquire/load.” After write, do:adsm_flush()to store result - “store”Exampleint *x; /shared variable.adsm_refresh(x);a = *x + b;23Synchronization accessesTo control competing accesses: Semaphores Mutexs (Mutual exclusion variables) Barriers.available. All r
17、equire an identifier to be specified as all three class instances are shared between processes.24Semaphore routinesFour routines:wait()signal()set()get().class AdsmSemaphore public:AdsmSemaphore( char *identifier, int init = 1 );void wait();void signal();void set( int value);void get();25Mutual excl
18、usion variables MutexTwo routineslockunlock()class AdsmMutex public:AdsmMutex( char *identifier );void lock();void unlock();26Exampleint *sum;AdsmMutex x(“mutex”);x.lock();adsm_refresh(sum);*sum += partial_sum;adsm_flush(sum);x.unlock();27Barrier RoutinesOne barrier routinebarrier()class AdsmBarrier
19、 public:AdsmBarrier( char *identifier );void barrier( int count);28ExampleAdsmBarrier barrier1(“sample”);.barrier1.barrier(procno);29Non-synchronization AccessesFor competing accesses that are not for synchronization:adsm_refresh_now( void *ptr );Andadsm_flush_now( void *ptr );refresh and flush take
20、 place on home location (rather than locally) and immediately.30Features to Improve PerformanceRoutines that can be used to overlap messages or reduce number of messages: Prefetch Bulk Transfer Combined routines for critical sections31Prefetchadsm_prefetch( void *ptr )used before adsm_refresh() to g
21、et data as early as possible.Non-blocking so that can continue with other work prior to issuing refresh.32Bulk TransferCombines consecutive messages to reduce number. Can applyonly to “aggregating”:adsm_malloc( AdsmBulkType *type );adsm_prefetch( AdsmBulkType *type )adsm_refresh( AdsmBulkType *type
22、)adsm_flush( AdsmBulkType *type )where AdsmBulkType is defined as:enum AdsmBulkType adsmBulkBegin,AdsmBulkEndUse parameters AdsmBulkBegin and AdsmBulkEnd in pairs to“aggregate” actions.Easy to add afterwards to improve performance.33Exampleadsm_refresh(AdsmBulkBegin);adsm_refresh(x);adsm_refresh(y);
23、adsm_refresh(z);adsm_refresh(AdsmBulkEnd);34Routines to improve performance of critical sectionsCalled “Atomic Accesses” in Adsmith.adsm_atomic_begin()adsm_atomic_end()Replaces two routines and reduces number of messages.35Sending an expression to be executed on home processCan reduce number of mess
24、ages. Called “Active Access” inAdsmith. 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 ).36Collect AccessEfficient routines
25、 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 accumulatorExampleint partial_sum = . ; / calculate the partial sumadsm_collect_begin(sum
26、,nproc);sum+=partial_sum; /add partial sumadsm_collect_end(sum); /total; sum is returned37Other FeaturesPointersCan 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 g
27、lobal address (an int)int adsm_gid(void *ptr);To translates global address back to local address for use byrequesting processvoid *adsm_attach(int gid);38Message passingCan use PVM routines in same program but must useadsm_spawn() to create processes (not pvm_spawn(). Message tags MAXINT-6 to MAXINT
28、 used by Adsmith.39Information Retrieval RoutinesFor 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 numberprocno resides. (If procno not specified, returns host id of c
29、allingprocess).int adsm_procno();-Returns process id of calling adsm_procno2tid(int procno);-Translates process id to corresponding PVM task adsm_tid2procno(int tid)translates PVM task id to corresponding process id.40DSM Implementation ProjectsUsing underlying message-passing software Easy to do Can sit on top of message-passing software such as MPI.41Issues in Implementing a DSM System Managing shared data - reader/writer policies Timing issues - relaxing read/write orders42Reader/Writer Policies Single reader/single writer policy - simple to
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年中國(guó)(甲基)丙烯酸異冰片酯數(shù)據(jù)監(jiān)測(cè)報(bào)告
- 2025至2030年中國(guó)高壓高溫高速溢流染色機(jī)市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)鋸條輥壓機(jī)市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)鄰溴苯乙腈市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)襯線市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)聚苯顆粒用砂漿市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)立式外加壓葉濾機(jī)市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)電網(wǎng)諧波監(jiān)測(cè)記錄裝置市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)熔鹽電加熱爐市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 2025至2030年中國(guó)棱形軸承市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- 工業(yè)機(jī)器人應(yīng)用編程(中級(jí)ABB匯博)理論考試題庫(kù)(含答案)
- 湖南省名校聯(lián)考聯(lián)合體2024-2025學(xué)年高一下學(xué)期期中考試數(shù)學(xué)試題 (A)含答案
- 擺攤食品培訓(xùn)課件
- 汽車電泳工藝培訓(xùn)
- 2025年實(shí)驗(yàn)室生物安全風(fēng)險(xiǎn)評(píng)估報(bào)告總結(jié)
- 蘇教版四年級(jí)下冊(cè)數(shù)學(xué)計(jì)算題每日一練帶答案(共30天)
- 煤礦應(yīng)急醫(yī)療救護(hù)常識(shí)課件
- 《上坡下坡山路駕駛》課件
- 《電信ICT產(chǎn)品介紹》課件
- 小紅書(shū)種草營(yíng)銷師模擬題及答案(單選+多選+判斷)
- 2023-2024學(xué)年滬科版(2019)高中信息技術(shù)必修二第三單元項(xiàng)目五《規(guī)劃并連接數(shù)字家庭系統(tǒng)的網(wǎng)絡(luò)-組建小型信息系統(tǒng)網(wǎng)絡(luò)(一)》說(shuō)課稿
評(píng)論
0/150
提交評(píng)論