Exemple #1
0
// each LP gets his events from those that have been generated at start up
func getEvents(index warp.Pid, data *warp.LocalData) {
	for i := 0; i < n_events; i++ {
		if warp.Pid(initEv[i].Type.From/(entitynum/lpnum)) == index {
			data.FutureEvents.Insert(&initEv[i])
		}
	}
}
Exemple #2
0
func main() {
	n_lp, n_ent := readParams()

	initPhold(n_lp, n_ent)

	fmt.Println("GO-WARP: the simulator will use", runtime.GOMAXPROCS(-1), "COREs")
	fmt.Println("GO-WARP: the simulation will use", n_lp, "LPs")

	startT = time.Now()
	for i := 1; i < n_lp; i++ {
		go launchLP(warp.Pid(i), n_ent/n_lp)
	}
	launchLP(0, n_ent/n_lp)

	for n_term != lpnum {
		time.Sleep(1e3)
	}
	printStats(elapsedT)
}
Exemple #3
0
func ProcessEvent(ev *warp.Event, l *warp.LocalData) {
	newev := generateEvent(ev)
	lp := e2lp(newev.Type.To, entitynum, lpnum)
	warp.NoticeEvent(newev, warp.Pid(lp), l)
	compute()
}