Ceriumによる
正規表現の実装
Masataka Kohagura
22th October , 2013
Masataka Kohagura
22th October , 2013
本研究室では、Cell用に作られたCeriumにて並列プログラミングを行なっている。Ceriumにて正規表現を実装し、既存の正規表現との処理速度、処理効率がどれだけ良くなるのかを測定する。
現在は文字列サーチをBM法(Boyer-Moore String Search Algorithm)にて実装している。 I/O部分の読み込みの並列化、及びセミグループという、分割したファイルに対して並列処理をさせるような手法によって、効率化を図る。
・cのreadとlseekの動作確認
・新しい例題の作成:fileread readとlseekを使って、Ceriumにて実装
for(loop_counter = 0; loop_counter < task_num - 1; loop_counter++){ lseek(fd, loop_counter * ONE_TASK_READ_SIZE,SEEK_SET); read(fd,text,ONE_TASK_READ_SIZE + EXTRA_LENGTH); result_printf(loop_counter,text); } lseek(fd, loop_counter * ONE_TASK_READ_SIZE,SEEK_SET); read(fd,text,ONE_TASK_READ_SIZE); result_printf(loop_counter,text);
・lseekにて loop_counter * ONE_TASK_READ_SIZE 分読み込み部分をずらす。
SEEK_SETはファイルの先頭からを示している。
・readにて読み込んだファイルを ONE_TASK_READ_SIZE + EXTRA_LENGTH 分読み込む。
出力結果
task size:71 task num:8 -------1-------- This is a test f ----------------- -------2-------- test file that w ----------------- ・・・ -------10-------- that will be us ----------------- -------11-------- be used l be us -----------------
main.cc
fileread