diff options
| author | thibauth <thibauth@30fcff6e-8de6-41c7-acce-77ff6d1dd07b> | 2011-06-20 15:55:56 +0000 |
|---|---|---|
| committer | thibauth <thibauth@30fcff6e-8de6-41c7-acce-77ff6d1dd07b> | 2011-06-20 15:55:56 +0000 |
| commit | 2f79e5e15aa99e9ae4885f92bb408f4af8c834bf (patch) | |
| tree | b981722be2a7e3760ac7cbea5fc508842df248b5 | |
| parent | eeb738e10fd8044d8abcfe6a14fbed0f64dcb7a9 (diff) | |
| download | pacemaker-2f79e5e15aa99e9ae4885f92bb408f4af8c834bf.tar.gz | |
Starting analysing mesh structure
git-svn-id: https://scm.gforge.inria.fr/svn/pacemaker@29 30fcff6e-8de6-41c7-acce-77ff6d1dd07b
| -rw-r--r-- | sources/thibaut/Makefile | 4 | ||||
| -rw-r--r-- | sources/thibaut/globals.ml | 1 | ||||
| -rw-r--r-- | sources/thibaut/simulator.ml | 17 |
3 files changed, 19 insertions, 3 deletions
diff --git a/sources/thibaut/Makefile b/sources/thibaut/Makefile index 5b0561b..98b17e8 100644 --- a/sources/thibaut/Makefile +++ b/sources/thibaut/Makefile @@ -3,7 +3,7 @@ OCAMLOPT=ocamlopt.opt OCAMLDEP=ocamldep.opt INCLUDES= OCAMLFLAGS=$(INCLUDES) -SRCS=map2.ml simulator.ml trace.ml gentrace.ml pacemaker.ml globals.ml compattrace.ml tracestats.ml mesh.ml +SRCS=map2.ml simulator.ml trace.ml gentrace.ml pacemaker.ml globals.ml compattrace.ml tracestats.ml mesh.ml graph.ml BUILDDIR=build DEPEND=.depend @@ -19,7 +19,7 @@ gentrace.opt: depend $(BUILDDIR) gentrace.cmx $(OCAMLOPT) -o $(BUILDDIR)/gentrace $(OCAMLFLAGS) map2.cmx str.cmxa globals.cmx pacemaker.cmx trace.cmx gentrace.cmx simulator.opt : depend $(BUILDDIR) simulator.cmx - $(OCAMLOPT) -o $(BUILDDIR)/simulator $(OCAMLFLAGS) map2.cmx str.cmxa globals.cmx pacemaker.cmx trace.cmx mesh.cmx simulator.cmx + $(OCAMLOPT) -o $(BUILDDIR)/simulator $(OCAMLFLAGS) map2.cmx str.cmxa globals.cmx graph.cmx pacemaker.cmx trace.cmx mesh.cmx simulator.cmx clean: rm -f *.cm? *.cmx? *.o *~ diff --git a/sources/thibaut/globals.ml b/sources/thibaut/globals.ml index 632d59a..fe45e48 100644 --- a/sources/thibaut/globals.ml +++ b/sources/thibaut/globals.ml @@ -252,6 +252,7 @@ end = struct | _ -> failwith "Big problem" in aux 0 + end type peer = { diff --git a/sources/thibaut/simulator.ml b/sources/thibaut/simulator.ml index d738214..425de91 100644 --- a/sources/thibaut/simulator.ml +++ b/sources/thibaut/simulator.ml @@ -1,8 +1,9 @@ open Pacemaker open Globals open Mesh +open Graph -let degree = ref 10 +let degree = ref 1000 let tpm = ref 3 let accuracy = ref 60 let duration = ref 24 @@ -94,6 +95,20 @@ let _ = Printf.printf "Askroots: %d" !Mesh.askroot; print_newline (); + let rep = repart (distances peers) in + for i = 0 to Array.length rep - 1 do + Printf.printf "%d, " rep.(i) + done; + print_newline (); + + for i = 0 to (npeers-1) do + let p = peers.(i) in + if p.con_state = ON then begin + Printf.printf "%d: " p.id; + SlotArray.iter (fun (SlotArray.Peer p) -> Printf.printf "%d, " p.id ) p.slots; + print_newline () + end + done; Mesh.ask := 0; Mesh.askroot := 0; end |
