36 SUBROUTINE partition_ceff(ndim,nrows,nnz,nstart,rp1,cval,aval,newnrows,newnstart,newndim,ProcTemp,global)
51 INTEGER :: ndim, nnz, nstart, nrows
52 REAL(kind=wp),
DIMENSION(nnz) :: aval
53 INTEGER,
DIMENSION(nnz) :: cval
54 INTEGER,
DIMENSION(nrows+1) :: rp1
55 REAL(kind=wp),
DIMENSION(LNumNp) :: proctemp
63 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: dispbc
64 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: tempintv
66 INTEGER ::
i,
j,
n,
m, counter1, counter2, counter3, counter4, counter5
69 INTEGER :: ncols, idof, jdof
71 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:,:) :: ceffexplicit, ceffff, cefffp, ceffpf, ceffpp
75 IF(
ALLOCATED(gtempbc))
DEALLOCATE(gtempbc)
76 IF(
ALLOCATED(numtempproc))
DEALLOCATE(numtempproc)
81 DO i = 1, global%NumNp
82 IF (nodeproc(
i) == myid)
THEN
85 IF(node_flag(
i,1) == 8)
THEN
91 print*,myid,
' number of local disp BCs = ',numdisp
94 CALL mpi_barrier(rocstar_communicator,ierr)
97 CALL mpi_reduce(numdisp, gnumtemp, 1, mpi_integer, mpi_sum, 0 , rocstar_communicator, ierr)
100 CALL mpi_bcast(gnumtemp, 1, mpi_integer, 0, rocstar_communicator, ierr)
103 newndim = gnumnp - gnumtemp
104 print*,myid,
' number of global disp BCs = ',gnumtemp
110 ALLOCATE(dispbc(1:numdisp))
115 DO i = 1, global%NumNp
118 IF (local2global(
i) ==
m)
THEN
119 IF (nodeproc(
i) == myid)
THEN
120 IF(node_flag(
i,1) == 8)
THEN
121 counter2 = counter2 + 1
129 If(numdisp >0)
print*,myid,
' local disp bcs = ',dispbc(:)
132 ALLOCATE(numtempproc(1:nprocs))
134 numtempproc(myid+1) = numdisp
136 CALL mpi_bcast(numtempproc(
i), 1, mpi_integer,
i-1, rocstar_communicator, ierr)
144 newnstart = newnstart - numtempproc(
i)
146 print*,myid,
' number of disp bcs on other procs = ',numtempproc(:)
151 ALLOCATE(gtempbc(1:gnumtemp))
158 IF (numtempproc(
i) > 0)
THEN
159 ALLOCATE(tempintv(1:numtempproc(
i)))
163 if (
i-1 == myid) tempintv(:) = dispbc(:)
165 CALL mpi_bcast(tempintv(1), numtempproc(
i), mpi_integer,
i-1, rocstar_communicator, ierr)
168 DO j = 1, numtempproc(
i)
169 counter1 = counter1 + 1
170 gtempbc(counter1) = tempintv(
j)
175 print*,myid,
' global disp bcs = ',gtempbc(:)
180 ALLOCATE(ceffexplicit(nrows,ndim))
193 IF ((rp1(
i) <
n).AND.(rp1(
i+1) >=
n))
THEN
195 IF (cval(
n) ==
j - 1)
THEN
196 ceffexplicit(
i,
j) = aval(
n)
216 ALLOCATE(ceffff(nrows - numdisp, ndim - gnumtemp))
217 ALLOCATE(ceffpp(numdisp,gnumtemp))
218 ALLOCATE(ceffpf(numdisp, ndim - gnumtemp))
219 ALLOCATE(cefffp(nrows - numdisp, gnumtemp))
220 ALLOCATE(ceff_fptp(nrows - numdisp))
227 DO i = nstart, nstart + nrows - 1
238 IF(
i == dispbc(
n))
THEN
240 counter1 = counter1 + 1
258 IF(
j == gtempbc(
n))
THEN
260 counter2 = counter2 + 1
270 ceffpp(counter1,counter2) = ceffexplicit(idof-nstart+1,jdof)
277 ceffpf(counter1,
j-counter2) = ceffexplicit(idof-nstart+1,
j)
288 IF(
j == gtempbc(
n))
THEN
290 counter2 = counter2 + 1
301 cefffp(
i-counter1-nstart+1,counter2) = ceffexplicit(
i-nstart+1,jdof)
307 ceffff(
i-counter1-nstart+1,
j-counter2) = ceffexplicit(
i-nstart+1,
j)
322 DO j = rp1(
i)+1, rp1(
i+1)
323 counter2 = counter2 + 1
328 IF((gtempbc(
m) ==
i + nstart - 1).OR.(gtempbc(
m) == cval(counter2)+1))
THEN
333 IF(counter1 == 0) nnz_temp = nnz_temp + 1
346 IF(gtempbc(
m) ==
i + nstart - 1)
THEN
350 if(counter1==1)
print*,myid,
' row removed at ',
i+nstart-1
351 IF(counter1 == 0) newnrows = newnrows + 1
355 ALLOCATE(rp_temp(1:newnrows+1))
356 ALLOCATE(cval_temp(1:nnz_temp))
357 ALLOCATE(aval_temp(1:nnz_temp))
367 IF (ceffff(
i,
j) > 0.0d0)
THEN
372 aval_temp(
n) = ceffff(
i,
j)
379 rp_temp(newnrows+1) = nnz_temp
433 INTEGER :: nrows, numtemp
434 REAL(kind=wp),
DIMENSION(nrows-NumTemp,GNumTemp) :: ceff_fp
436 INTEGER,
DIMENSION(NumTemp) :: tempbc
440 REAL(kind=wp),
DIMENSION(LNumNp) :: proctemp
444 REAL(kind=wp),
DIMENSION(GNumTemp) :: gtempbcvalue
447 REAL(kind=wp),
DIMENSION(GNumNp) :: temptemp
448 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: numtempfrom
449 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: bufsnd
450 INTEGER ::
i,
j,
k,
m, counter1, counter2
451 REAL(kind=wp) :: tempval
452 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: req_rcv, req_snd
453 INTEGER,
ALLOCATABLE,
DIMENSION(:,:) :: stat_rcv, stat_snd
459 IF ( nprocs > 1)
THEN
461 CALL mpi_barrier(rocstar_communicator,ierr)
462 ALLOCATE(req_rcv(1:nprocs))
463 ALLOCATE(req_snd(1:nprocs))
464 ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
465 ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
466 ALLOCATE(numtempfrom(1:nprocs))
470 DO j = 1, mpi_status_size
476 IF (
i-1 /= myid)
THEN
477 CALL mpi_irecv(numtempfrom(
i),1, &
478 mpi_integer,
i-1,10,rocstar_communicator, &
483 IF (
i-1 /= myid)
THEN
486 CALL mpi_send(nrows,1,mpi_integer, &
487 i-1,10,rocstar_communicator,ierr)
490 CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
503 CALL mpi_barrier(rocstar_communicator,ierr)
504 ALLOCATE(req_rcv(1:nprocs))
505 ALLOCATE(req_snd(1:nprocs))
506 ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
507 ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
511 DO j = 1, mpi_status_size
516 ALLOCATE(frmproc(1:nprocs))
519 IF (
i-1 /= myid)
THEN
522 ALLOCATE(frmproc(
i)%rcvbuf(1:2*int(numtempfrom(
i))))
523 CALL mpi_irecv(frmproc(
i)%rcvbuf(1),2*int(numtempfrom(
i)), &
524 mpi_double_precision,
i-1,10,rocstar_communicator, &
531 IF (
i-1 /= myid)
THEN
535 ALLOCATE(bufsnd(1:2*lnumnp))
541 IF ((global2local(
j) /= -1) .AND. (nodeproc(global2local(
j)) == myid))
THEN
545 counter1 = counter1 + 1
546 bufsnd(2*counter1-1) =
j
547 bufsnd(2*counter1) = proctemp(counter1)
555 CALL mpi_send(bufsnd,2*nrows,mpi_double_precision, &
556 i-1,10,rocstar_communicator,ierr)
562 CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
576 IF ((global2local(
i) /= -1) .AND. (nodeproc(global2local(
i)) == myid))
THEN
577 temptemp(
i ) = proctemp(
i - (nstart-1))
585 IF (
j-1 /= myid)
THEN
587 DO m = 1, numtempfrom(
j)
591 IF (int(frmproc(
j)%rcvbuf(2*
m-1)) ==
i)
THEN
592 temptemp(
i ) = frmproc(
j)%rcvbuf(2*
m)
599 IF (nprocs > 1)
DEALLOCATE(frmproc)
607 IF (
i == gtempbc(
j))
THEN
608 gtempbcvalue(
j)= temptemp(
i)
616 DO i = 1, nrows-numtemp
618 ceff_fptp(
i) = ceff_fptp(
i) + ceff_fp(
i,
j) * gtempbcvalue(
j)
subroutine partition_ceff(ndim, nrows, nnz, nstart, rp1, cval, aval, newnrows, newnstart, newndim, ProcTemp, global)
subroutine prescribedload(nrows, nstart, NumTemp, TempBC, Ceff_fp, ProcTemp)