Ejemplo n.º 1
0
def write_scan_header(P, cls, out_dir):
    
    try:
    	os.mkdir(out_dir)
    except:
    	pass
	write_scan_header.header = []
	def write_header(params):
		p2 = cls(params).processed_params()
		write_scan_header.header += [p2]
	
	parameter_scan_3(P,write_header)
	
	header = write_scan_header.header
	header_fn = hashlib.md5(json.dumps(header,indent=4)).hexdigest()
	header_fn = out_dir+'scan-'+ P.name + '-' +header_fn+'.json'
	#print header_fn
	
	open(header_fn,'w').write(json.dumps(header,indent=4))
	
	return header_fn
Ejemplo n.º 2
0
        launcher = launcherCLS(clspath,fn,largs)
        
        for i in range(start,end):
            p = js[i]
            #p = js[k]
            
            t = Task(p)
            #print [t]
            launcher.map([t])
        
        launcher.join()
    else:
        if options.params:
            P = my_import(options.params)()
        else:
            P = my_import(clspath+'.Params')()
            
        
        #out_dir = my_import(clspath+'.out_dir')
        out_dir = Task(P).out_dir()
        
        header_fn = write_scan_header(P, Task, out_dir)
    
        launcher = launcherCLS(clspath,header_fn, largs)
        parameter_scan_3(P,params2task2map)
        launcher.join()