| 223 |
|
mfactLocal = Cmfact |
| 224 |
|
|
| 225 |
|
call gather(groupStartLocal, groupStartRow, plan_group_row) |
| 226 |
< |
call gather(groupStartLocal, groupStartCol, plan_group_col) |
| 227 |
< |
groupStartRow(nGroupsInRow+1) = nAtomsInRow |
| 228 |
< |
groupStartCol(nGroupsInCol+1) = nAtomsInCol |
| 226 |
> |
call gather(groupStartLocal, groupStartCol, plan_group_col) |
| 227 |
> |
groupStartRow(nGroupsInRow+1) = nAtomsInRow + 1 |
| 228 |
> |
groupStartCol(nGroupsInCol+1) = nAtomsInCol + 1 |
| 229 |
|
call gather(groupListLocal, groupListRow, plan_atom_row) |
| 230 |
|
call gather(groupListLocal, groupListCol, plan_atom_col) |
| 231 |
+ |
|
| 232 |
+ |
! C passes us groupList as globalID numbers for the atoms |
| 233 |
+ |
! we need to remap these onto the row and column ids on this |
| 234 |
+ |
! processor. This is a linear search, but is only done once |
| 235 |
+ |
! (we hope) |
| 236 |
+ |
|
| 237 |
+ |
do i = 1, nAtomsInRow |
| 238 |
+ |
do j = 1, nAtomsInRow |
| 239 |
+ |
if (AtomRowToGlobal(j) .eq. groupListRow(i)) then |
| 240 |
+ |
groupListRow(i) = j |
| 241 |
+ |
endif |
| 242 |
+ |
enddo |
| 243 |
+ |
enddo |
| 244 |
+ |
do i = 1, nAtomsInCol |
| 245 |
+ |
do j = 1, nAtomsInCol |
| 246 |
+ |
if (AtomColToGlobal(j) .eq. groupListCol(i)) then |
| 247 |
+ |
groupListCol(i) = j |
| 248 |
+ |
endif |
| 249 |
+ |
enddo |
| 250 |
+ |
enddo |
| 251 |
|
call gather(mfactLocal, mfactRow, plan_atom_row) |
| 252 |
|
call gather(mfactLocal, mfactCol, plan_atom_col) |
| 253 |
|
|
| 295 |
|
groupStartRow(i) = CgroupStart(i) |
| 296 |
|
groupStartCol(i) = CgroupStart(i) |
| 297 |
|
end do |
| 298 |
< |
groupStartRow(nGroups+1) = nLocal |
| 299 |
< |
groupStartCol(nGroups+1) = nLocal |
| 298 |
> |
groupStartRow(nGroups+1) = nLocal + 1 |
| 299 |
> |
groupStartCol(nGroups+1) = nLocal + 1 |
| 300 |
|
do i = 1, nLocal |
| 301 |
|
groupListRow(i) = CgroupList(i) |
| 302 |
|
groupListCol(i) = CgroupList(i) |
| 321 |
|
enddo |
| 322 |
|
|
| 323 |
|
maxSkipsForAtom = 0 |
| 324 |
+ |
#ifdef IS_MPI |
| 325 |
+ |
do j = 1, nAtomsInRow |
| 326 |
+ |
#else |
| 327 |
|
do j = 1, nLocal |
| 328 |
+ |
#endif |
| 329 |
|
nSkipsForAtom(j) = 0 |
| 330 |
|
#ifdef IS_MPI |
| 331 |
|
id1 = AtomRowToGlobal(j) |
| 350 |
|
end do |
| 351 |
|
enddo |
| 352 |
|
|
| 353 |
+ |
#ifdef IS_MPI |
| 354 |
+ |
allocate(skipsForAtom(nAtomsInRow, maxSkipsForAtom), stat=alloc_stat) |
| 355 |
+ |
#else |
| 356 |
|
allocate(skipsForAtom(nLocal, maxSkipsForAtom), stat=alloc_stat) |
| 357 |
+ |
#endif |
| 358 |
|
if (alloc_stat /= 0 ) then |
| 359 |
|
write(*,*) 'Could not allocate skipsForAtom array' |
| 360 |
|
return |
| 361 |
|
endif |
| 362 |
|
|
| 363 |
+ |
#ifdef IS_MPI |
| 364 |
+ |
do j = 1, nAtomsInRow |
| 365 |
+ |
#else |
| 366 |
|
do j = 1, nLocal |
| 367 |
+ |
#endif |
| 368 |
|
nSkipsForAtom(j) = 0 |
| 369 |
|
#ifdef IS_MPI |
| 370 |
|
id1 = AtomRowToGlobal(j) |
| 374 |
|
do i = 1, nExcludes_Local |
| 375 |
|
if (excludesLocal(1,i) .eq. id1 ) then |
| 376 |
|
nSkipsForAtom(j) = nSkipsForAtom(j) + 1 |
| 377 |
< |
#ifdef IS_MPI |
| 378 |
< |
id2 = AtomColToGlobal(excludesLocal(2,i)) |
| 347 |
< |
#else |
| 377 |
> |
! exclude lists have global ID's so this line is |
| 378 |
> |
! the same in MPI and non-MPI |
| 379 |
|
id2 = excludesLocal(2,i) |
| 349 |
– |
#endif |
| 380 |
|
skipsForAtom(j, nSkipsForAtom(j)) = id2 |
| 381 |
|
endif |
| 382 |
|
if (excludesLocal(2, i) .eq. id2 ) then |
| 383 |
|
nSkipsForAtom(j) = nSkipsForAtom(j) + 1 |
| 384 |
< |
#ifdef IS_MPI |
| 385 |
< |
id2 = AtomColToGlobal(excludesLocal(1,i)) |
| 356 |
< |
#else |
| 384 |
> |
! exclude lists have global ID's so this line is |
| 385 |
> |
! the same in MPI and non-MPI |
| 386 |
|
id2 = excludesLocal(1,i) |
| 358 |
– |
#endif |
| 387 |
|
skipsForAtom(j, nSkipsForAtom(j)) = id2 |
| 388 |
|
endif |
| 389 |
|
end do |