#!/usr/bin/python
import subprocess
import time
import sys
subprocess.Popen(["java", "-cp", "gstarnew.jar","gstar.Master", "-workers","2","-port","2112"])
time.sleep(2)
subprocess.Popen(["java", "-cp", "gstarnew.jar","gstar.Worker", "0","2000","127.0.0.1:2112"])
time.sleep(1)
subprocess.Popen(["java", "-cp", "gstarnew.jar","gstar.Worker", "1","2001","127.0.0.1:2112"])
time.sleep(1)
a = "cat " + sys.argv[1] + " | java -cp, gstarnew.jar gstar.Terminal 2113 127.0.0.1:2112"
subprocess.Popen(a)