コンテンツに飛ぶ | ナビゲーションに飛ぶ

Free Theme for Plone

パーソナルツール

現在位置: ホーム / software / Xev-GMP:Automatic Code Generation for GMP Code from C Code

Xev-GMP:Automatic Code Generation for GMP Code from C Code

Change log

・2014/04/01 Project start.

・2016/11/03 Web page open.

・2016/11/15 Xev-GMP-Web 1.0.0 released!!

Introduction

What is Xev-GMP?

xevfig1.png

 

Xev-GMP is directive-based automatic code generation for a C code with multiple-precision floating-point-operation (GMP code) from a C code with double precision (C code).
The GMP code uses the GNU Multiple Precision Arithmetic Library (GMP).
Xev-GMP enables users to check the accuracy dependency of many algorithms by adding a few directives to C codes with double precision.
Xev-GMP is developed on Xevolver Framework.

How to use?

Xev-GMP requires only the information of the precision in a few directive line.

A user writes information of precision (directive) to header part and above function definition.

Current release version is Xev-GMP web interface(Xev-GMP-Web).

A user uploads C code with directive to Xev-GMP-Web. Then, it generates GMP code!

 

Xev-GMP-Web

Xev-GMP-Web does not need to install Xevolver Framework.

A user writes information of precision (directive) to header part and above function definition.

A user uploads C code with directive to Xev-GMP-Web, Then it generates GMP code!

 

The source file will be used to find bug. We don't disclose uploaded source file.

http://xev.arch.is.tohoku.ac.jp/XevWeb/Xev-GMP-Web.html

 

Xev-GMP-Web server is installed on Tohoku University. (Thanks Mr. Hirasawa!)

Download

coming soon...

 

Sample code (compute nrm2)

C code with Xev-GMP directives

Generated GMP code

 

Xev-GMP Directives

Directives

#pragma xev-gmp default(prec)

"prec" is the size of significant part with constant.

The user writes this directive in the header part of a C source file. This specifies the default precision of each value. When the user writes this directive, all processes related to "mpf_t" are generated.

“Xev-GMP” generates GMP code by using only this directive. It’s possible to generate GMP code by adding only a single-line.

 

#pragma xev-gmp set(prec) target(var1, var2, var3...)

"prec" is the size of significant part with constant.

"var" is target variable with string.

The user writes this directive above function declaration part. This specifies the arbitrary precision of targeted variables for mixed precision operation in this function.

 

#pragma xev-gmp set(prec) global-target(var1, var2, var3...)

"prec" is the size of significant part with constant.

"var" is target variable with string.

The user writes this directive above header part of C file. This specifies the arbitrary precision of targeted global-variables for mixed precision operation.

 

List of the code generation functions of Xev-GMP

#Generation functionsRemarks
1 Including "gmp.h"
2 Specified precision
3 Mixed precision
4 Variable declaration
5 Array
6 Comparison operator Ternary operator is impossible
7 Record
8 Arithmetics
9 I/O functions

printf, fprintf, sprintf, scanf, fscanf, sscanf

10 Mathematical functions sqrt, pow, abs
11 User defined functions
12 Other functions (return double) e.g. atof(), omp_get_wtime()

 

Limitations・bug information

Xev-GMP cannot translate following functions in C.

  • Searching across  multiple C source files
  • Specified a size of "malloc" must use "sizeof(double)"
    - ◯ a = (double *)malloc(sizeof(double) * N);
    - ☓ a = (double *)malloc(8 * N);
    - ☓ a = (double *)malloc(1000);
  • "float" type (float type does not translate mpt_t)
  • Union type
  • Enumerated type
  • Memory dump function
  • Mathematical function which is not implemented on GMP
  • Bitwise operations
  • Function pointer
  • Ternary operator
  • Multi-threading (pthread, OpenMP, etc..)
  • MPI

Bugs in Xev-GMP 1.0.0.

  • User-defined functions cannot return a record (please use "call by pointer").

Tested platforms

  • gmp 6.0.0, 6.0.1, 6.1.1
  • gcc 4.4.7, 4.6.3, 4.9.3
  • icc 12.0.3, 13.0.1


Publications

  1. 丸地 賢, 佐々木 信一, 菱沼 利彰, 藤井 昭宏, 田中 輝雄, 平澤 将一. Xevolverを用いたGMPコードへの自動変換機能の実装, 第77回情報処理学会全国大会, 京都, 2015年3月.
  2. 榊原 巧磨, 佐々木 信一, 菱沼 利彰, 藤井 昭宏, 田中 輝雄, 平澤 将一. GMPライブラリを用いた任意多倍長プログラムへの自動変換機構の提案, 情報処理学会研究報告, vol.2015-HPC-152, No. 6, pp. 1-8, 2015年12月.
  3. T. Hishinuma, T Sakakibara, A. Fujii, T. Tanaka, and S Hirasawa. Xev-GMP: Automatic Code Generation for GMP Multiple-Precision Code from C Code, 19th IEEE International Conference on Computational Science and Engineering (CSE 2016), pp.1-4, Aug. 24-26, Paris, France, 2016.
  4. 菱沼 利彰, 藤井 昭宏, 田中 輝雄, 平澤 将一. GMPを用いた混合精度型プログラムの自動生成機構の提案, 日本応用数理学会 2016年度年会, pp.1-2, 2016年9月.

Member

菱沼 利彰 Toshiaki Hishinuma (2014/04-, Univ. of Tsukuba, Student)

・ 斯波 柾 Masaki Suwa (2016/04-, Kogakuin Univ.)

・ 愛沢 菜穂 Nao Aizawa (2016/04-, Kogakuin Univ.)

・ 榊原巧磨 Takuma Sakakibara (2015/04 - 2016/03, Kogakuin Univ.)

・ 藤井 昭宏 Akihiro Fujii (2014/04-, Kogakuin Univ.)

・ 田中 輝雄 Teruo Tanaka (2014/04-, Kogakuin Univ.)

・ 平澤 将一 Shoichi Hirasawa (2014/04-, Tohoku Univ.)

Contact

Please feel free to send comments and requests:

hishinuma [at mark] slis.tsukuba.ac.jp

Acknowledgement

Xev-GMP was partially supported by JST CREST "An Evolutionary Approach to Construction of a Software Development Environment for Massively-Parallel Heterogeneous Systems," and JSPS KAKENHI Grant Number 25330144.

We would also like to thank members of JST CREST for helpful discussion. Especially, Prof. Daisuke Takahashi of University of Tsukuba gave us valuable comments on this work.

This is Schools Diazo Plone Theme