Changeset 8026
- Timestamp:
- Sep 24, 2010, 5:56:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_parallel/parallel_meshes.py
r8022 r8026 17 17 import numpy as num 18 18 19 from anuga_parallel.parallel_abstraction import pypar_available20 import pypar21 22 19 from anuga.config import epsilon 23 20 24 21 25 if pypar_available 22 from parallel_api import distribute 23 from parallel_api import myid, numprocs, get_processor_name 24 from parallel_api import send, receive 25 from parallel_api import pypar_available, barrier, finalize 26 26 27 27 28 … … 40 41 """ 41 42 42 processor = pypar.rank() 43 numproc = pypar.size() 44 45 #print 'numproc',numproc 46 #print 'processor ',processor 47 48 m_low, m_high = pypar.balance(m_g, numproc, processor) 43 44 45 m_low, m_high = pypar.balance(m_g, numprocs, myid) 49 46 50 47 n = n_g … … 132 129 133 130 if i == m-1: 134 if processor == numproc-1:131 if myid == numprocs-1: 135 132 boundary[nt, 2] = 'right' 136 133 else: … … 156 153 157 154 if i == 0: 158 if processor== 0:155 if myid == 0: 159 156 boundary[nt, 2] = 'left' 160 157 else: … … 164 161 elements[nt,:] = [i1,i2,i3] 165 162 166 if numproc ==1:163 if numprocs==1: 167 164 Idfl.extend(Idfr) 168 165 Idgr.extend(Idgl) … … 177 174 #print Idgr 178 175 179 full_send_dict[processor] = [Idfl, Idfl] 180 ghost_recv_dict[processor] = [Idgr, Idgr] 181 182 #print full_send_dict[processor] 183 #print ghost_recv_dict[processor] 184 elif numproc == 2: 176 full_send_dict[myid] = [Idfl, Idfl] 177 ghost_recv_dict[myid] = [Idgr, Idgr] 178 179 180 elif numprocs == 2: 185 181 Idfl.extend(Idfr) 186 182 Idgr.extend(Idgl) 187 183 Idfl = num.array(Idfl,num.int) 188 184 Idgr = num.array(Idgr,num.int) 189 full_send_dict[( processor-1)%numproc] = [Idfl, Idfl]190 ghost_recv_dict[( processor-1)%numproc] = [Idgr, Idgr]185 full_send_dict[(myid-1)%numprocs] = [Idfl, Idfl] 186 ghost_recv_dict[(myid-1)%numprocs] = [Idgr, Idgr] 191 187 else: 192 188 Idfl = num.array(Idfl,num.int) … … 196 192 Idgr = num.array(Idgr,num.int) 197 193 198 full_send_dict[( processor-1)%numproc] = [Idfl, Idfl]199 ghost_recv_dict[( processor-1)%numproc] = [Idgl, Idgl]200 full_send_dict[( processor+1)%numproc] = [Idfr, Idfr]201 ghost_recv_dict[( processor+1)%numproc] = [Idgr, Idgr]194 full_send_dict[(myid-1)%numprocs] = [Idfl, Idfl] 195 ghost_recv_dict[(myid-1)%numprocs] = [Idgl, Idgl] 196 full_send_dict[(myid+1)%numprocs] = [Idfr, Idfr] 197 ghost_recv_dict[(myid+1)%numprocs] = [Idgr, Idgr] 202 198 203 199 … … 291 287 292 288 if i == m-1: 293 if processor == numproc-1:289 if myid == numprocs-1: 294 290 boundary[nt, 2] = 'right' 295 291 else: … … 313 309 314 310 if i == 0: 315 if processor== 0:311 if myid == 0: 316 312 boundary[nt, 2] = 'left' 317 313 else: … … 422 418 423 419 if i == m-1: 424 if processor == numproc-1:420 if myid == numprocs-1: 425 421 boundary[nt, 2] = 'right' 426 422 else: … … 438 434 439 435 if i == 0: 440 if processor== 0:436 if myid == 0: 441 437 boundary[nt, 2] = 'left' 442 438 else:
Note: See TracChangeset
for help on using the changeset viewer.