Changeset 1588
- Timestamp:
- Jul 7, 2005, 5:02:56 PM (18 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/parallel/parallel_advection.py
r1575 r1588 81 81 ltimestep = ones( 1, Float ) 82 82 ltimestep[0] = self.timestep 83 84 83 gtimestep = zeros( 1, Float) # Buffer for results 85 84 … … 99 98 # the separate processors 100 99 100 from Numeric import take,put 101 101 import time 102 102 t0 = time.time() … … 116 116 N = len(Idf) 117 117 118 for i in range(N): 119 Xout[i,0] = stage_cv[Idf[i]] 118 #for i in range(N): 119 # Xout[i,0] = stage_cv[Idf[i]] 120 Xout[:,0] = take(stage_cv, Idf) 120 121 121 122 pypar.send(Xout,send_proc) … … 134 135 N = len(Idg) 135 136 136 137 for i in range(N):138 stage_cv[Idg[i]] = X[i,0]137 put(stage_cv, Idg, X[:,0]) 138 #for i in range(N): 139 # stage_cv[Idg[i]] = X[i,0] 139 140 140 141 … … 153 154 N = len(Idg) 154 155 155 for i in range(N):156 #print i,Idg[i],Idf[i]157 stage_cv[Idg[i]] = stage_cv[Idf[i]]156 #for i in range(N): 157 # #print i,Idg[i],Idf[i] 158 # stage_cv[Idg[i]] = stage_cv[Idf[i]] 158 159 159 160 put(stage_cv, Idg, take(stage_cv, Idf)) 160 161 161 162 -
inundation/ga/storm_surge/parallel/parallel_shallow_water.py
r1575 r1588 108 108 109 109 110 from Numeric import take,put 110 111 import time 111 112 t0 = time.time() … … 125 126 Xout = self.full_send_dict[send_proc][2] 126 127 127 N = len(Idf) 128 129 for i in range(N): 130 Xout[i,0] = stage_cv[Idf[i]] 131 Xout[i,1] = xmomentum_cv[Idf[i]] 132 Xout[i,2] = ymomentum_cv[Idf[i]] 133 128 Xout[:,0] = take(stage_cv, Idf) 129 Xout[:,1] = take(xmomentum_cv, Idf) 130 Xout[:,2] = take(ymomentum_cv, Idf) 134 131 135 132 pypar.send(Xout,send_proc) … … 144 141 145 142 X = pypar.receive(iproc,X) 146 N = len(Idg)147 143 148 for i in range(N): 149 stage_cv[Idg[i]] = X[i,0] 150 xmomentum_cv[Idg[i]] = X[i,1] 151 ymomentum_cv[Idg[i]] = X[i,2] 152 144 put(stage_cv, Idg, X[:,0]) 145 put(xmomentum_cv, Idg, X[:,1]) 146 put(ymomentum_cv, Idg, X[:,2]) 153 147 154 148 #local update of ghost cells … … 164 158 Idg = self.ghost_recv_dict[iproc][0] 165 159 166 N = len(Idg) 167 168 for i in range(N): 169 stage_cv[Idg[i]] = stage_cv[Idf[i]] 170 xmomentum_cv[Idg[i]] = xmomentum_cv[Idf[i]] 171 ymomentum_cv[Idg[i]] = ymomentum_cv[Idf[i]] 160 put(stage_cv, Idg, take(stage_cv, Idf)) 161 put(xmomentum_cv, Idg, take(xmomentum_cv, Idf)) 162 put(ymomentum_cv, Idg, take(ymomentum_cv, Idf)) 172 163 173 164 self.communication_time += time.time()-t0 … … 203 194 #Pass control on to outer loop for more specific actions 204 195 yield(t) 205 -
inundation/ga/storm_surge/parallel/run_parallel_sw_merimbula.py
r1585 r1588 145 145 ghost_recv_dict = ghost_recv_dict) 146 146 147 domain.initialise_visualiser(rect=rect,scale_z =0.1)147 #domain.initialise_visualiser(rect=rect,scale_z =0.1) 148 148 #domain.initialise_visualiser(rect=rect) 149 149 domain.visualise_color_stage = True … … 175 175 if myid == 0: 176 176 domain.write_time() 177 print domain.quantities['stage'].get_integral() 177 print 'Processor %d, Integral of stage %d'%\ 178 (domain.processor,domain.quantities['stage'].get_integral()) 178 179 179 180 if myid == 0: 180 181 print 'That took %.2f seconds' %(time.time()-t0) 182 print 'Communication time %.2f seconds'%domain.communication_time 183 print 'Reduction Communication time %.2f seconds'%domain.communication_reduce_time
Note: See TracChangeset
for help on using the changeset viewer.