[bonfiredemokit] Annotation of /ea/submit_file.py
Annotation of /ea/submit_file.py
Parent Directory
| Revision Log
Revision 18 -
(view)
(download)
(as text)
1 : |
agomez |
18 |
#
|
2 : |
|
|
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit
|
3 : |
|
|
#
|
4 : |
|
|
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012
|
5 : |
|
|
#
|
6 : |
|
|
# License Apache Software
|
7 : |
|
|
#
|
8 : |
|
|
# The research leading to these results has received funding from
|
9 : |
|
|
# the European Community's Seventh Framework Programme (FP7/2007-2013)
|
10 : |
|
|
# under agreement number 257386
|
11 : |
|
|
#
|
12 : |
|
|
# This software is provided with ABSOLUTELY NO WARRANTY
|
13 : |
|
|
#
|
14 : |
|
|
'''
|
15 : |
|
|
Created on 20/03/2012
|
16 : |
|
|
|
17 : |
|
|
@author: R. Valin
|
18 : |
|
|
'''
|
19 : |
|
|
|
20 : |
|
|
#import matplotlib.pyplot as plt
|
21 : |
|
|
import time
|
22 : |
|
|
import json
|
23 : |
|
|
import os
|
24 : |
|
|
import sys
|
25 : |
|
|
import random
|
26 : |
|
|
#from exp.ea
|
27 : |
|
|
#import experiment_type as expt
|
28 : |
|
|
#from exp.ea
|
29 : |
|
|
import ea_bonfire as ea
|
30 : |
|
|
|
31 : |
|
|
|
32 : |
|
|
#print 'Path to Json:'
|
33 : |
|
|
#filej=raw_input()
|
34 : |
|
|
if len(sys.argv) < 2:
|
35 : |
|
|
sys.stderr.write('A JSON file is needed')
|
36 : |
|
|
#sys.stderr.write('Usage: sys.argv[0] ')
|
37 : |
|
|
sys.exit(1)
|
38 : |
|
|
|
39 : |
|
|
filej="../examples/"+sys.argv[1]
|
40 : |
|
|
if not os.path.exists(filej):
|
41 : |
|
|
sys.stderr.write('ERROR: file '+filej+ 'does not exist!')
|
42 : |
|
|
sys.exit(1)
|
43 : |
|
|
|
44 : |
|
|
print '----------------'
|
45 : |
|
|
print 'Json PATH:',filej
|
46 : |
|
|
print '----------------'
|
47 : |
|
|
|
48 : |
|
|
if os.path.exists(filej):
|
49 : |
|
|
jsonf=open(filej, 'r')
|
50 : |
|
|
exper=json.loads(jsonf.read())
|
51 : |
|
|
print exper
|
52 : |
|
|
jsonf.close()
|
53 : |
|
|
else:
|
54 : |
|
|
print "File doesn't exist"
|
55 : |
|
|
|
56 : |
|
|
|
57 : |
|
|
#duration = 120
|
58 : |
|
|
#Number of repetitions
|
59 : |
|
|
|
60 : |
|
|
multi = 1
|
61 : |
|
|
|
62 : |
|
|
#for i in exp:
|
63 : |
|
|
# print i
|
64 : |
|
|
# m=str(i)
|
65 : |
|
|
j=0
|
66 : |
|
|
while j < multi:
|
67 : |
|
|
#save(locations)
|
68 : |
|
|
#location=info_location[m]
|
69 : |
|
|
#instance=info_instance[m]
|
70 : |
|
|
#store=info_storage[m]
|
71 : |
|
|
print 'Repetition before ea:', j
|
72 : |
|
|
j=ea.ea_bf(exper,j)
|
73 : |
|
|
j=j+1
|
74 : |
|
|
#time.sleep(float(130))
|
75 : |
|
|
|
76 : |
|
|
|
77 : |
|
|
|
|