Exemple #1
0
			MUTATION_DEPTH = int(query)
		elif opt == "-n":
			NSIZE = int(query)
		elif opt == "-l":
			LOOP_SIZE = int(query)
		elif opt =="-d":
			DEBUG = True
		elif opt == "-t":
			if(DEBUG):
				print 'Setting threshold to {0}'.format(query)
			nAVG = float(query)
		elif opt == "-u":
			location = query
		elif opt == "-a":
			EMAIL = True
			ADDRESS=query
		elif opt == "-c":
			CSV = True
		else:
			print "ERROR: incorrect usage"
			usage()
			sys.exit
	if EMAIL:
		email = smail.mail(ADDRESS, SEQUENCE,location)	
	if(re.match('\w+',SEQUENCE)):
		sampling = BootStrap.bootstrap(seq)
		initial()
	else:
		print "ERROR: Buggy or Null Sequence"
		sys.exit
Exemple #2
0
	migration = {"true": True, "false": False}.get(sys.argv[6].lower())#data_migration [true, false]
	propagation_delay = long(sys.argv[7]) * 1000#replication delay secs
	migration_delay = long(sys.argv[8]) * 1000
	hours_between_login = int(sys.argv[9])

	SimPy.Simulation.initialize()#required by SimPy

	last_stamp = -1
	trace = open(tracefile, 'r')

	placement_police = CoLocatedWithSecondaryRandomPlacement()

	diskSize = 1024 * 1024 * 1024 * 4#1 GiBytes
	fileSizeDistribution = FileSizeDistribution(8.46, math.sqrt(2.38), diskSize)

	devices = [Device(i) for i in range(num_machines)]

	if homeless:
		login_strategy = HomeLessLoginStrategy(migration_prob, experiment.HOUR_IN_MILLIS * hours_between_login, devices, Random())
	else:
		login_strategy = SweetHomeLoginAlgorithm(migration_prob, experiment.HOUR_IN_MILLIS * hours_between_login, devices, Random())

	boot = BootStrap(trace, login_strategy)
	client = Client(boot, 3, devices, placement_police, fileSizeDistribution, communication_delay, migration, migration_delay)
	boot.set_client(client)

	SimPy.Simulation.activate(client, client.Run())#required by SimPy

	SimPy.Simulation.simulate(1234567890123456L)	
	print experiment.logger
Exemple #3
0
			ALL = True
		elif opt in ("-h", "--help"):
			usage()
		elif opt == "-b":
			TOP_BREAK = query
		elif opt == "-j":
			JSON = True
		elif opt == "-a":
			EMAIL = True
			ADDRESS = query
		elif opt == "-u":
			location = query
		elif opt == "-c":
			CSV = True
		elif opt == "-t":
			BOOTSTRAP = True
		else:
			print "ERROR: incorrect usage"
			print usage()
			sys.exit
	if EMAIL:
		email = smail.mail(ADDRESS, SEQUENCE, location)
	if BOOTSTRAP:
		sampling = BootStrap.bootstrap(seq,MUTATION_DEPTH)
	if(re.match('\w',seq)):
		start_sampling(seq)
		
	else:
		print "ERROR: Buggy Sequence"
		sys.exit