def build_sect_params(self): """Build parameters for parallel job""" sect_pars={} nxs=int(self.param("nxs")) oxs=float(self.param("oxs")) dxs=float(self.param("dxs")) ozs=float(self.param("ozs")) nblock=self.param("nblock") if not nblock: nblock=nxs nblock=int(block) imin=int(n/nblock) nextra=n-nblock*imin itot=0 for i in range(nblock): sect_pars[str(i)]=SEP.args.basic(name=str(i)) ol=o+d*itot dl=d nl=imin if i < nextra: nl=nl+1 itot=itot+nl sect_pars[str(i)].add_string("nzs=1 ozs=%f dzs=1."%(ozs)) sect_pars[str(i)].add_string("nxs=%d oxs=%f dxs=%f"%(nl,ol,dl)) return sect_pars
The prep_run function creates the list of parameters and defines a dictionary of parallel files. The velocity space is copied to all of the nodes using the SEP.pf_copy.parfile class, the output shot gather files are spread accross the cluster using the SEP.pf_split.parfile object.
par_files={} par_files["vel"]=SEP.pf_copy.parfile(name=self.param("intag"), tag="intag=",usage="INPUT",njobs=len(sect_pars.keys()),restart=restart) par_files["hsfile"]=SEP.pf_split.parfile(name=self.param("hsfile"), dff_axis=3,tag="hsfile=",usage="OUTPUT",njobs=len(sect_pars.keys()), restart=restart,nblock=len(sect_pars.keys()))The section parameters, the parallel files, and the modeling program are then added to the objects parameters and the parallel job is initialized.
self.add_param("files",par_files) self.add_param("sect_pars",sect_pars) self.add_param("program","%s/Fdmod"%SEP.paths.sepbindir) SEP.pj_base.par_job.prep_run(self)