• 検索結果がありません。

共有メモリプログラミングのための拡張C言語

N/A
N/A
Protected

Academic year: 2021

シェア "共有メモリプログラミングのための拡張C言語"

Copied!
1
0
0

読み込み中.... (全文を見る)

全文

(1)Vol. 44. No. SIG 13(PRO 18). Oct. 2003. 情報処理学会論文誌:プログラミング. 発表概要. 共有メモリプログラミングのための拡張 C 言語 高 小. 田 宮. 常. 潤† 康†. 八 湯. 杉 淺. 昌 太. 宏† 一†. 従来の並列プログラミングでは,共有メモリに対する不可分操作やメモリアクセス完了順序につい て,専用ライブラリの呼び出しや asm 文などを使用してきた.しかしそれらを用いると,コード の移 植性やライブラリ呼び出しのオーバヘッド,コンパイラによる最適化や型チェックを妨げるなどの問 題があった.本研究では,C 言語を拡張し,共有メモリ向け機能を追加した.実装にはコンパイラと して GCC を用いた.オーバヘッド を減らし,最適化を最大限に生かすためには GCC の持つ RTL を拡張するのが望ましいが,それには GCC のすべての最適化器に手を入れる必要があり非常に繁雑 である.したがって本研究では既存の RTL をうまく利用することで GCC が持つ最適化器自体には 触れないように実装することにした.これにより最適化は GCC の既存部分に任せることができる. 一方で,メモリアクセス完了順序を保証する場合など ,最適化してはならない部分も存在する.それ らを考慮に入れたうえで,最適化を最大限に生かすようにした.また本発表では,実装した拡張 C 言 語を用いて,共有メモリに関するいくつかのプログラミング例について紹介する.. An Extended C Language for Shared-memory Programming Jun Takada,† Masahiro Yasugi,† Tsuneyasu Komiya† and Taiichi Yuasa† In parallel programming in C, we often use library calls or asm statements for atomic memory operations and constraints on memory access order. However, asm statements reduce portability and the overhead of library calls reduce performance. Furthermore, they often invalidate optimizations and the type checking of the compiler. So, we extended the C language with shared-memory functionalities. The C compiler we implemented is based on GCC. In order to minimize the overhead and maximize the effect of optimizations, it is ideal to extend the RTL in GCC. However, it is very costly because we must extend all optimizers in GCC. In this research, we effectively used the combination of the original RTL without extension. The optimization process is left to the original optimizers of GCC because we did not extend the optimizers. However, some code should not be optimized by the compiler, in particularly, the code for constrains on memory access order. Our implementation can maximize the effect of optimization even if the program contains such code. We also present some examples of shared-memory programming in our extended C language.. ( 平成 15 年 1 月 24 日発表). † 京都大学大学院情報学研究科通信情報システム専攻 Department of Communications and Computer Engineering, Graduate School of Informatics, Kyoto University. 117.

(2)

参照

関連したドキュメント

We find the criteria for the solvability of the operator equation AX − XB = C, where A, B , and C are unbounded operators, and use the result to show existence and regularity

We study parallel algorithms for addition of numbers having finite representation in a positional numeration system defined by a base β in C and a finite digit set A of

“Breuil-M´ezard conjecture and modularity lifting for potentially semistable deformations after

In this paper, this problem will be solved for the case N = 2, for tested convex sets of class C 4 and testing convex sets of class C 2 , as stated in Theorem 2.2 below. From now on,

Replace the previous sum by a sum over all partitions in S c × DD Check that coefficents of x n on both sides are polynomials in t, and conclude that the formula is true for

, 1 read the labels of rows with area equal to i from top to bottom and insert them in the diagonal, then read the labels of rows with area equal to −i + 1 from bottom to top and

2) every structures and signature types have self variables; 3) paths are always prefixed by some self variable. Yet, our running examples do not follow these exactly. We assume

When a vertex a i is paired with a component C where C is an odd cycle, we use the fact that, in any odd cycle, for any choice of two vertices, there exists a maximum independent set