Changeset 8489


Ignore:
Timestamp:
Aug 5, 2012, 12:36:26 PM (12 years ago)
Author:
steve
Message:

Added some output to run_parallel_sw_merimbula_profile

Location:
trunk/anuga_core/source/anuga_parallel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_parallel/parallel_generic_communications.py

    r8455 r8489  
    4343    #Determine minimum timestep across all processors
    4444    pypar.reduce(domain.local_timestep, pypar.MIN, 0,
    45                       buffer=domain.global_timestep)#,
    46                      #bypass=True)
     45                      buffer=domain.global_timestep,
     46                      bypass=True)
     47
     48    #pypar.allreduce(domain.local_timestep, pypar.MIN,
     49    #                  buffer=domain.global_timestep,
     50    #                  bypass=True)
    4751
    4852    domain.communication_reduce_time += time.time()-t0
     
    5155    #Broadcast minimal timestep to all processors
    5256    t0 = time.time()
    53     pypar.broadcast(domain.global_timestep, 0)#,
    54                         #bypass=True)
     57    pypar.broadcast(domain.global_timestep, 0, bypass=True)
    5558
    5659    domain.communication_broadcast_time += time.time()-t0
    5760
    58     old_timestep = domain.flux_timestep
     61    old_fux_timestep = domain.flux_timestep
    5962    domain.flux_timestep = domain.global_timestep[0]
    6063   
    6164   
    62     #Compute minimal timestep on local process
    63     #Domain.update_timestep(domain, yieldstep, finaltime)
    64 
    6565
    6666def communicate_ghosts(domain):
     
    9090                        Xout[:,i] = num.take(Q_cv, Idf)
    9191
    92                     pypar.send(Xout, int(send_proc), use_buffer=True)
     92                    pypar.send(Xout, int(send_proc), use_buffer=True, bypass=True)
    9393
    9494
     
    100100                X   = domain.ghost_recv_dict[iproc][2]
    101101
    102                 X = pypar.receive(int(iproc), buffer=X)
     102                X = pypar.receive(int(iproc), buffer=X, bypass=True)
    103103
    104104                for i, q in enumerate(domain.conserved_quantities):
  • trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula_profile.py

    r8418 r8489  
    88   where m is the number of processors to be used.
    99   
    10    Will produce sww files with names domain_Pn_m.sww where m is number of processors and
    11    n in [0, m-1] refers to specific processor that owned this part of the partitioned mesh.
     10   Will produce sww files with names domain_Pn_m.sww where n is number of processors and
     11   m in [0, n-1] refers to specific processor that owned this part of the partitioned mesh.
    1212"""
    1313
     
    4646#mesh_filename = "test-100.tsh" ; x0 = 0.25 ; x1 = 0.5
    4747
    48 finaltime = 50
    49 yieldstep = finaltime
     48finaltime = 500
     49yieldstep = 50
    5050verbose = True
    5151
     
    8282
    8383#domain.smooth = False
     84for id in range(numprocs):
     85    if myid == id:
     86        print 'Process ID %g' %myid
     87        print 'Number of triangles %g ' %domain.get_number_of_triangles()
     88
     89    barrier()
    8490
    8591
     
    128134
    129135
     136barrier()
     137
    130138if myid == 0:
    131139    import pstats
    132140    p = pstats.Stats(prof_file)
    133     p.sort_stats('cumulative').print_stats(25)
     141    #p.sort_stats('cumulative').print_stats(25)
    134142
    135143
    136144    p.sort_stats('time').print_stats(25)
    137145
     146barrier()
    138147
     148
     149if myid == 1:
     150    import pstats
     151    p = pstats.Stats(prof_file)
     152    #p.sort_stats('cumulative').print_stats(25)
     153
     154
     155    p.sort_stats('time').print_stats(25)
    139156
    140157    #p.print_stats()
     
    146163#profiler.close()
    147164
    148 
     165barrier()
    149166
    150167if myid == 0:
     168    print 'Process ID %g' %myid
     169    print 'Number of processors %g ' %numprocs
     170    print 'That took %.2f seconds' %(time.time()-t0)
     171    print 'Communication time %.2f seconds'%domain.communication_time
     172    print 'Reduction Communication time %.2f seconds'%domain.communication_reduce_time
     173    print 'Broadcast time %.2f seconds'%domain.communication_broadcast_time
     174
     175barrier()
     176
     177if myid == 1:
     178    print 'Process ID %g' %myid
    151179    print 'Number of processors %g ' %numprocs
    152180    print 'That took %.2f seconds' %(time.time()-t0)
     
    156184
    157185
     186
    158187finalize()
    159188
Note: See TracChangeset for help on using the changeset viewer.