Exemplo n.º 1
0
    def sww_merge(self, verbose=False, delete_old=False):

        # make sure all the computations have finished

        pypar.barrier()

        # now on processor 0 pull all the separate sww files together
        if self.processor == 0 and self.numproc > 1 and self.store :
            import anuga.utilities.sww_merge as merge

            global_name = join(self.get_datadir(),self.get_global_name())
            
            merge.sww_merge_parallel(global_name,self.numproc,verbose,delete_old)

        # make sure all the merge completes on processor 0 before other
        # processors complete (like when finalize is forgotten in main script)
        
        pypar.barrier()
Exemplo n.º 2
0
    def sww_merge(self, verbose=False, delete_old=False):

        # make sure all the computations have finished

        pypar.barrier()

        # now on processor 0 pull all the separate sww files together
        if self.processor == 0 and self.numproc > 1 and self.store:
            import anuga.utilities.sww_merge as merge

            global_name = join(self.get_datadir(), self.get_global_name())

            merge.sww_merge_parallel(global_name, self.numproc, verbose,
                                     delete_old)

        # make sure all the merge completes on processor 0 before other
        # processors complete (like when finalize is forgotten in main script)

        pypar.barrier()
Exemplo n.º 3
0
        dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values
        dd = dd*(dd>0.)
        vv = (dd>1.0e-02)*( (xx/(dd+1.0e-06))**2 + (yy/(dd+1.0e-06))**2)**0.5
        print 'velocity max = ', vv.max()
#print 'That took %.2f seconds' %(time.time()-t0)

barrier()

# Get peak_stage outputs and save to file
c_v = max_operator.max_stage.centroid_values.flatten()
c_x = domain.centroid_coordinates[:,0].flatten()
c_y = domain.centroid_coordinates[:,1].flatten()
c_e = domain.quantities['elevation'].centroid_values.flatten()
out_max_data = numpy.vstack((c_x,c_y,c_v, c_e)).transpose()
out_max_file = project.output_run+"/" + 'max_stage_P' + str(myid)+'.txt'
numpy.savetxt(out_max_file, out_max_data,fmt='%.4f')

barrier()

if ((myid == 0) & (numprocs>1)):
    print 'Number of processors %g ' %numprocs
    print 'That took %.2f seconds' %(time.time()-t0)
    print 'Communication time %.2f seconds'%domain.communication_time
    print 'Reduction Communication time %.2f seconds'%domain.communication_reduce_time
    print 'Broadcast time %.2f seconds'%domain.communication_broadcast_time

    os.chdir(project.output_run)
    sww_merge.sww_merge_parallel(domainName, np=numprocs, verbose=True, delete_old=True)

finalize()