8
報報 2004/11/26

2004/11/26

Embed Size (px)

DESCRIPTION

報告. 2004/11/26. 概観. 具体的なアプリに向けて 完了 IndexSet シリアライズ メッセージリレーの実験 オブジェクトの管理・ RMI 実装中 マイグレーション アプリ書く. RMI の実験. 簡単なメソッドで実験. [0-10)-[30-40). [10-20)-[40-50). [20-30)-[50-60). 分散集合 1. [0-10)-[30-40). [10-20)-[40-50). [20-30)-[50-60). 分散集合 2. (method_a, [30-40), “hoge”). (method_a - PowerPoint PPT Presentation

Citation preview

Page 1: 2004/11/26

報告

2004/11/26

Page 2: 2004/11/26

概観• 具体的なアプリに向けて

–完了• IndexSet• シリアライズ• メッセージリレーの実験• オブジェクトの管理・ RMI

–実装中• マイグレーション

–アプリ書く

Page 3: 2004/11/26

RMIの実験• 簡単なメソッドで実験

[0-10)-[30-40) [10-20)-[40-50) [20-30)-[50-60)

send(分散集合 2, method_a [15-55), “hoge”)

(method_a,[30-40), “hoge”)

(method_a[15-20)-[40-50), “hoge”)

(method_a,[20-30)-[50-55), “hoge”)

[0-10)-[30-40) [10-20)-[40-50) [20-30)-[50-60) 分散集合 2

分散集合 1

Page 4: 2004/11/26

マイグレーションの実験 (予定 )• 個々の断片に明示的に”退避”を指令

[0-10)-[30-40) [10-20)-[40-50) [20-30)-[50-60)

leave()

[0-10)-[30-40) [10-20)-[40-50) [20-30)-[50-60) 分散集合 2

分散集合 1

Page 5: 2004/11/26

main()1. int npe = 3;2. int pn = get_pn();3. int io_lower = (int)(vp_segment_width * pn / npe);4. int io_upper = (int)(vp_segment_width * (pn + 1) / npe);5. IndexSet * initial_is = new IndexSet(io_lower, io_upper);6. InitialObject *io = new InitialObject(initial_is);

7. int lower, upper; lower = pn * 10; upper = (pn + 1) * 10;8. DistributedArray *da = new DistributedArray(1, new IndexSet(lower, upper));9. DistributedArray *da2 = new DistributedArray(2, new IndexSet(lower, upper));10. pthread_t pth;11. spawn_receiver(pth);

12. if(pn == 0){13. PackObject *po = new PackObject();14. po->pack_string("hello");15. rmi_send(1, new IndexSet(0, npe * 10), 0, po);16. }

Page 6: 2004/11/26

提供する関数1. void rmi_send(int, IndexSet *, method_kind_t, PackObject *);2. void *receiver(void *);3. void ro_assume_vps(int, ph_vp_t, ph_vp_t);4. void register_fraction(int, RemoteObject *, IndexSet *);

5. class RemoteObject {6. protected:7. int object_id;8. ph_vp_t vp_shift;9. IndexSet *handle_is;10. public:11. void send(IndexSet *is, method_kind_t method_kind, PackObject *po)12. { rmi_send(object_id, is, method_kind, po);}13. virtual void recv(IndexSet *, method_kind_t, UnpackObject *)=0;14. };

Page 7: 2004/11/26

クラス定義1. DistributedArray::DistributedArray(int _object_id, IndexSet *_handle_is){2. object_id = _object_id;3. handle_is = _handle_is;4. size = handle_is->size();5. A = new double[size];

6. register_fraction(object_id, this, handle_is);7. IndexSet *is0 = handle_is;8. while(is0 != NULL){9. ro_assume_vps(object_id, is0->lower, is0->upper);10. is0 = is0->next;11. }12. }

13. void DistributedArray::recv(IndexSet *is, method_kind_t method_kind, UnpackObject *upo){14. switch(method_kind){15. case 0:16. method_a(is, upo);17. break;18. }19. }

Page 8: 2004/11/26

今後• マイグレーション• アプリの記述• できれば 11月中