Log In | Get Help   
Home My Page Projects Code Snippets Project Openings BonFIRE VCOC Demonstration Kit
Summary Activity SCM Files Wiki
[bonfiredemokit] Annotation of /ea/submit_par_file.py
[bonfiredemokit] / ea / submit_par_file.py Repository:
ViewVC logotype

Annotation of /ea/submit_par_file.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download) (as text)

1 : agomez 1 '''
2 :     Created on 20/03/2012
3 :    
4 :     @author: R. Valin
5 :     '''
6 :    
7 :     #import matplotlib.pyplot as plt
8 :     from multiprocessing import Process
9 :     import json
10 :     import os
11 :     import sys
12 :     import time
13 :     #from exp.ea
14 :     #import experiment_type as expt
15 :     #from exp.ea
16 :     import ea_bonfire as ea
17 :     #import pp
18 :    
19 :     def sub(e_cont):
20 :     # print 'Ruta completa del Json que define experimento:'
21 :     # #filej=raw_input()
22 :     # filej="/home/cesga/bonfire/examples/cluster_fr.json"
23 :     # print filej
24 :     # if os.path.exists(filej):
25 :     # jsonf=open(filej, 'r')
26 :     # expt=json.loads(jsonf.read())
27 :     # print expt
28 :     # jsonf.close()
29 :     # else:
30 :     # print "File doesn't exist"
31 :    
32 :     #duration = 120
33 :     multi = 1
34 :    
35 :     #for i in exp:
36 :     # print i
37 :     # m=str(i)
38 :     j=0
39 :     while j < multi:
40 :     #save(locations)
41 :     #location=info_location[m]
42 :     #instance=info_instance[m]
43 :     #store=info_storage[m]
44 :     print 'Repetition before ea:', j, os.getpid()
45 :     j=ea.ea_bf(e_cont,j)
46 :     j=j+1
47 :     #time.sleep(float(130))
48 :    
49 :     if __name__ == '__main__':
50 :     if len(sys.argv) < 3:
51 :     sys.stderr.write('Two JSON files are needed')
52 :     #sys.stderr.write('Usage: sys.argv[0] ')
53 :     sys.exit(1)
54 :    
55 :     filej=["/home/cesga/bonfire/examples/"+sys.argv[1], "/home/cesga/bonfire/examples/"+sys.argv[2]]
56 :     for i in filej:
57 :     print 'File:', i
58 :     if not os.path.exists(i):
59 :     sys.stderr.write('ERROR: file '+i+ 'does not exist!')
60 :     sys.exit(1)
61 :     expt=[]
62 :     for i in filej:
63 :     if os.path.exists(i):
64 :     jsonf=open(i, 'r')
65 :     expt.append(json.loads(jsonf.read()))
66 :     print "Reading:", i
67 :     print expt
68 :     jsonf.close()
69 :     else:
70 :     print "File doesn't exist"
71 :    
72 :     p1 = Process(target=sub, args=(expt[0],))
73 :     p2 = Process(target=sub, args=(expt[1],))
74 :     p1.start()
75 :     time.sleep(2)
76 :     p2.start()
77 :    
78 :    
79 :    
80 :    

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge