7.當(dāng)變量在使用中可以從堆棧中的所有線程修改,有必要
確保只有一次一個線程讀寫的內(nèi)存位置
考慮變量,否則會發(fā)生不可預(yù)知的結(jié)果.
8.這個指令,明確或暗示,標識序列點的實施
必須確保每個線程具有一致的方向
某些變量在內(nèi)存中:同樣的正確的指針必須指向所有線程.該指令
必須出現(xiàn)在代碼中的精確分際在數(shù)據(jù)同步
是必需的.
初看起來這似乎是沒有必要的指示,一般自
寫作/ 更新共享變量做了這樣一種方式,只有一個線程
在時間允許這樣做.但這只是在理論上正確的,因為什么OpenMPimplementation
并模擬一次“功能”沒有一個線程指定
OpenMP的規(guī)范.這不是一個錯誤,而且這是一個敞開大門的
OpenMP的建置作業(yè),讓他們可以嘗試優(yōu)化的代碼.
9.必須做的是,在每個循環(huán)迭代執(zhí)行的一些發(fā)言需要進行評估
在相同的順序,如果這樣做,將循環(huán)順序執(zhí)行.
英語翻譯
英語翻譯
7.When a variable in use can be modified from all threads in a team,it is necessary to
ensure that only one thread at a time is writing/updating the memory location of the
considered variable,otherwise unpredictable results will occur.
8.This directive,whether explicit or implied,identifies a sequence point at which the implementation
is required to ensure that each thread in the team has a consistent view of
certain variables in memory:the same correct value has to be seen by all threads.This directive
must appear at the precise point in the code at which the data synchronization
is required.
At a first glance it seems that this directive is not necessary,since in general the
writing/updating of shared variables has been done in such a way,that only one thread
at a time is allowed to do that.But this is only true in theory,because what the OpenMPimplementation
does to simulate the ”one thread at a time” feature is not specified by
the OpenMP specification.This is not a fault,moreover it is a door left open to the
OpenMP-implementations so that they can try to optimize the resulting code.
9.In certain do-loops some of the statements executed at each iteration need to be evaluated
in the same order as if the do-loop would be executed sequentially.
7.When a variable in use can be modified from all threads in a team,it is necessary to
ensure that only one thread at a time is writing/updating the memory location of the
considered variable,otherwise unpredictable results will occur.
8.This directive,whether explicit or implied,identifies a sequence point at which the implementation
is required to ensure that each thread in the team has a consistent view of
certain variables in memory:the same correct value has to be seen by all threads.This directive
must appear at the precise point in the code at which the data synchronization
is required.
At a first glance it seems that this directive is not necessary,since in general the
writing/updating of shared variables has been done in such a way,that only one thread
at a time is allowed to do that.But this is only true in theory,because what the OpenMPimplementation
does to simulate the ”one thread at a time” feature is not specified by
the OpenMP specification.This is not a fault,moreover it is a door left open to the
OpenMP-implementations so that they can try to optimize the resulting code.
9.In certain do-loops some of the statements executed at each iteration need to be evaluated
in the same order as if the do-loop would be executed sequentially.
英語人氣:925 ℃時間:2020-06-15 22:24:46
優(yōu)質(zhì)解答
我來回答
類似推薦
猜你喜歡
- 1寒冷的冬天呼出氣體后,會看到白霧,出現(xiàn)這種現(xiàn)象的原因是?
- 2空氣對我們很重要的英語作文
- 3張阿姨用112元去買窗簾布,由于窗簾布每米降價1元,因此張阿姨所帶的錢可以比原來多買2米,原來每米多少元?
- 4什么叫電能 作用
- 5什么時候用I were 什么時候用I was
- 6描述人生最經(jīng)典的一句話是什么~
- 7用同樣的2臺抽水機,3小時可以澆地1.2公頃,4臺抽水機1小時可以澆地多少公頃?
- 8若x²+2(a+1)x=16是完全平方式,求a²-2a+1的值
- 9已知I={X|-1≤X≤3},M={X|-1
- 10figure sth.out和figure out sth.的區(qū)別?
- 11高粱桿可以吃嗎
- 12誰可以給我說說I 與U I與R 以及伏安法測電阻中滑動變阻器的作用分別是什么,最好把實驗寫下 thx