# HG changeset patch # User Masataka Kohagura # Date 1394943723 -32400 # Node ID 43c6da29d688f9e6b31064c51e6767e898dca70a # Parent f40041ffd52489ed036a2d239a3aa956cf370a91 add some files diff -r f40041ffd524 -r 43c6da29d688 2014/March/memo/16th.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2014/March/memo/16th.txt Sun Mar 16 13:22:03 2014 +0900 @@ -0,0 +1,20 @@ +2014/02/01 (Sat) + [program] + wait_for かけたいけど、どうしようか + + 現状 + divide read が完全に終わってから Task が走る + -> 読み込んでから実行してるしあまりはやくならねーよ + + 理想 + divide read しながら Task 走るのが一番の理想 + -> divide read が最初からちゃんと走るけど、 Task が追い越してしまうので + それをどう同期とろうか悩み中 + + 2GB 以上を取ろうとすると + regex(19797,0x7fff75dad310) malloc: *** mach_vm_map(size=18446744071569698816) failed (error code=3) + *** error: can't allocate region + *** set a breakpoint in malloc_error_break to debug + Can't allocate memory + + もしかして、allocate sizeに限界がある?? diff -r f40041ffd524 -r 43c6da29d688 2014/March/slide/04th.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2014/March/slide/04th.html Sun Mar 16 13:22:03 2014 +0900 @@ -0,0 +1,179 @@ + + + + + + + slide + + + + + + + + + +
+ + + +
+

+ Cerium の並列処理向け I/O の設計と実装 +

+

+ Masataka Kohagura +
+ 21st January , 2014 +

+
+ +
+

研究背景と目的

+

+ 近年のCPUのほとんどはマルチコアであり、それらの性能を引き出すためには並列プログラミングが必須となっている。そこで当研究室では Cerium Library の開発を行い、提供することによって並列プログラミングを容易にしている。 +

+

+ 先行研究では Task の並列化によって、プログラム全体の処理速度は向上しているが、ファイル読み込み等の I/O に対して並列に Task が動作するようにはされていない。 +

+

+ 現状では、ファイルを全て memory に mapping を行ってから Task が走るようになっているので、非常に大きいサイズのファイルを読み込むと、ファイルを memory に mapping するまでの時間がオーバーヘッドになってしまう。 +

+

+ 本研究では I/O と Task の並列化の設計、実装によってプログラム全体の処理速度、処理効率を上げていく。 +

+
+ +
+

+ したこと +

+
    + +
  • + 2GB 以上のファイルが読み込めなかった -> 修正 +
  • + +
  • + fileread をちょっとだけ測定 +
  • +
      +
+ + + +
+ +

2GB 以上のファイルが読み込めなかった -> 修正

+

+ manager->allocate(int) を使用したところ +

+
+if (divide_read_flag != 0) {
+    printf("[divide read mode]\n");
+    w->file_mmap = (char*)manager->allocate((long)w->read_filesize);
+    r_run = manager->create_task
+            (RUN_READ_BLOCKS, (memaddr)&w->self, sizeof(memaddr),0,0);
+}else {
+    printf("[mmap mode]\n");
+    r_run = manager->create_task
+            (MMAP , (memaddr)&w->self, sizeof(memaddr),0,0);
+}
+
+

+ divide read をする前に manager->alocate にて memory を確保する。 + この領域に、分割して読み込んだ file を mapping していく。 +

+
+ +
+

+ kernel/ppe/TaskManagerImpl.h +

+

修正前

+ +
+void* allocate(int size, int alignment)
+{
+#if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN)
+    buff =  malloc(size);
+#else
+    posix_memalign(&buff, alignment, size);
+#endif
+    return buff;
+}
+
+ +

修正後

+
+void* allocate(long size, int alignment)
+{
+    ・・・
+}
+
+ +
+ +
+

+ fileread +

+

+ ファイルの読み込みだけを行うプログラム +

+

+ firefly 上で実行
+ 2*2.66 GHz, HHD 1TB, memory 16GB
+ file size : 10740996168 Byte (約10GB) +

+ + + +
+ + + + + +
modetime(s)
mmap0.194788
read_divide_size
4*4096 Byte391.734989
4*4096*1024 Byte123.563726
+ + +
+ + +