码迷,mamicode.com
首页 > 其他好文 > 详细

Notes of Principles of Parallel Programming: Peril-L Notation

时间:2015-05-30 21:08:07      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:

Content

1 syntax and semantic

2 example set

 

1 syntax and semantic

1.1 extending C

 Peril-L notation stands on the shoulder of C.

 

1.2 parallel threads

forall(<intVar in (<index range specification>)){
    <body>   
}

 

 

 

1.3 synchronized and coordination

 (1) exclusive block

exclusive { <body> }

 

(2) barrier

近在forall中使用。

barrier

 

 

1.4 memory model

 2 address spaces: global, local

全局内存存在并发读写、延迟(λ)。

 

全局-本地映射函数

(1) localize()

根据进程id,返回生成本地数据副本

(2) mysize(global, i)

返回进程Pi中数据的数量

(3) localToGlobal(localData, i, j)

返回Pi的局部数据中索引为i的数据相应的全局索引

 

1.5 synchronized memory

FE(full/empty)变量,必须是global数据,记法示例:

int t = 0;

 

 

FE state transfer
state\operation read write
empty stall(blocking) => full
full => empty stall(blocking)

 

 

1.6 reduce and scan

 Reduce(/)

Scan(\)

sample:

+/count   // count is an array, return the sum of count‘s element
min\items // item is an array, return the minimal of items‘ element

 

 

 

2 example set

 

Notes of Principles of Parallel Programming: Peril-L Notation

标签:

原文地址:http://www.cnblogs.com/zhoujiagen/p/4540913.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!