BLACS takeout.
psblas3-type-indexed
Salvatore Filippone 15 years ago
parent 5ffbc8ca82
commit 7530cafc83

@ -35,7 +35,6 @@ LIBS=@LIBS@
# BLAS, BLACS and METIS libraries. # BLAS, BLACS and METIS libraries.
BLAS=@BLAS_LIBS@ BLAS=@BLAS_LIBS@
BLACS=@BLACS_LIBS@
METIS_LIB=@METIS_LIBS@ METIS_LIB=@METIS_LIBS@
LAPACK=@LAPACK_LIBS@ LAPACK=@LAPACK_LIBS@
EXTRA_COBJS=@FAKEMPI@ EXTRA_COBJS=@FAKEMPI@

@ -355,7 +355,7 @@ subroutine psi_cswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),n*nerv,& call mpi_irecv(rcvbuf(rcv_pt),n*nerv,&
& mpi_complex,prcid(i),& & mpi_complex,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -378,7 +378,7 @@ subroutine psi_cswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag=psb_complex_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
call mpi_rsend(sndbuf(snd_pt),n*nesd,& call mpi_rsend(sndbuf(snd_pt),n*nesd,&
@ -411,7 +411,7 @@ subroutine psi_cswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -844,7 +844,7 @@ subroutine psi_cswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),nerv,& call mpi_irecv(rcvbuf(rcv_pt),nerv,&
& mpi_complex,prcid(i),& & mpi_complex,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -866,7 +866,7 @@ subroutine psi_cswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_complex_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
@ -898,7 +898,7 @@ subroutine psi_cswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -363,7 +363,7 @@ subroutine psi_ctranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
call mpi_irecv(sndbuf(snd_pt),n*nesd,& call mpi_irecv(sndbuf(snd_pt),n*nesd,&
& mpi_complex,prcid(i),& & mpi_complex,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -386,7 +386,7 @@ subroutine psi_ctranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_complex_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),n*nerv,& call mpi_rsend(rcvbuf(rcv_pt),n*nerv,&
& mpi_complex,prcid(i),& & mpi_complex,prcid(i),&
@ -417,7 +417,7 @@ subroutine psi_ctranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -852,7 +852,7 @@ subroutine psi_ctranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
call mpi_irecv(sndbuf(snd_pt),nesd,& call mpi_irecv(sndbuf(snd_pt),nesd,&
& mpi_complex,prcid(i),& & mpi_complex,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -875,7 +875,7 @@ subroutine psi_ctranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_complex_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),nerv,& call mpi_rsend(rcvbuf(rcv_pt),nerv,&
& mpi_complex,prcid(i),& & mpi_complex,prcid(i),&
@ -905,7 +905,7 @@ subroutine psi_ctranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
proc_to_comm = idx(pnti+psb_proc_id_) proc_to_comm = idx(pnti+psb_proc_id_)
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_complex_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -356,7 +356,7 @@ subroutine psi_dswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),n*nerv,& call mpi_irecv(rcvbuf(rcv_pt),n*nerv,&
& mpi_double_precision,prcid(i),& & mpi_double_precision,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -379,7 +379,7 @@ subroutine psi_dswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag=psb_double_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
call mpi_rsend(sndbuf(snd_pt),n*nesd,& call mpi_rsend(sndbuf(snd_pt),n*nesd,&
@ -412,7 +412,7 @@ subroutine psi_dswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -844,7 +844,7 @@ subroutine psi_dswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),nerv,& call mpi_irecv(rcvbuf(rcv_pt),nerv,&
& mpi_double_precision,prcid(i),& & mpi_double_precision,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -866,7 +866,7 @@ subroutine psi_dswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag=psb_double_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
@ -898,7 +898,7 @@ subroutine psi_dswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag =psb_double_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -363,7 +363,7 @@ subroutine psi_dtranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
call mpi_irecv(sndbuf(snd_pt),n*nesd,& call mpi_irecv(sndbuf(snd_pt),n*nesd,&
& mpi_double_precision,prcid(i),& & mpi_double_precision,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -386,7 +386,7 @@ subroutine psi_dtranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag=psb_double_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),n*nerv,& call mpi_rsend(rcvbuf(rcv_pt),n*nerv,&
& mpi_double_precision,prcid(i),& & mpi_double_precision,prcid(i),&
@ -417,7 +417,7 @@ subroutine psi_dtranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -849,7 +849,7 @@ subroutine psi_dtranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
call mpi_irecv(sndbuf(snd_pt),nesd,& call mpi_irecv(sndbuf(snd_pt),nesd,&
& mpi_double_precision,prcid(i),& & mpi_double_precision,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -872,7 +872,7 @@ subroutine psi_dtranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag=psb_double_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),nerv,& call mpi_rsend(rcvbuf(rcv_pt),nerv,&
& mpi_double_precision,prcid(i),& & mpi_double_precision,prcid(i),&
@ -902,7 +902,7 @@ subroutine psi_dtranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
proc_to_comm = idx(pnti+psb_proc_id_) proc_to_comm = idx(pnti+psb_proc_id_)
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_double_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -355,7 +355,7 @@ subroutine psi_iswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),n*nerv,& call mpi_irecv(rcvbuf(rcv_pt),n*nerv,&
& mpi_integer,prcid(i),& & mpi_integer,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -378,7 +378,7 @@ subroutine psi_iswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_int_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
call mpi_rsend(sndbuf(snd_pt),n*nesd,& call mpi_rsend(sndbuf(snd_pt),n*nesd,&
@ -411,7 +411,7 @@ subroutine psi_iswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -844,7 +844,7 @@ subroutine psi_iswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),nerv,& call mpi_irecv(rcvbuf(rcv_pt),nerv,&
& mpi_integer,prcid(i),& & mpi_integer,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -866,7 +866,7 @@ subroutine psi_iswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_int_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
@ -898,7 +898,7 @@ subroutine psi_iswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -363,7 +363,7 @@ subroutine psi_itranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
call mpi_irecv(sndbuf(snd_pt),n*nesd,& call mpi_irecv(sndbuf(snd_pt),n*nesd,&
& mpi_integer,prcid(i),& & mpi_integer,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -386,7 +386,7 @@ subroutine psi_itranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_int_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),n*nerv,& call mpi_rsend(rcvbuf(rcv_pt),n*nerv,&
& mpi_integer,prcid(i),& & mpi_integer,prcid(i),&
@ -417,7 +417,7 @@ subroutine psi_itranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -852,7 +852,7 @@ subroutine psi_itranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
call mpi_irecv(sndbuf(snd_pt),nesd,& call mpi_irecv(sndbuf(snd_pt),nesd,&
& mpi_integer,prcid(i),& & mpi_integer,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -875,7 +875,7 @@ subroutine psi_itranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_int_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),nerv,& call mpi_rsend(rcvbuf(rcv_pt),nerv,&
& mpi_integer,prcid(i),& & mpi_integer,prcid(i),&
@ -905,7 +905,7 @@ subroutine psi_itranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
proc_to_comm = idx(pnti+psb_proc_id_) proc_to_comm = idx(pnti+psb_proc_id_)
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_int_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -356,7 +356,7 @@ subroutine psi_sswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),n*nerv,& call mpi_irecv(rcvbuf(rcv_pt),n*nerv,&
& mpi_real,prcid(i),& & mpi_real,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -379,7 +379,7 @@ subroutine psi_sswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_real_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
call mpi_rsend(sndbuf(snd_pt),n*nesd,& call mpi_rsend(sndbuf(snd_pt),n*nesd,&
@ -412,7 +412,7 @@ subroutine psi_sswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -844,7 +844,7 @@ subroutine psi_sswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),nerv,& call mpi_irecv(rcvbuf(rcv_pt),nerv,&
& mpi_real,prcid(i),& & mpi_real,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -866,7 +866,7 @@ subroutine psi_sswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_real_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
@ -898,7 +898,7 @@ subroutine psi_sswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -363,7 +363,7 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
call mpi_irecv(sndbuf(snd_pt),n*nesd,& call mpi_irecv(sndbuf(snd_pt),n*nesd,&
& mpi_real,prcid(i),& & mpi_real,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -386,7 +386,7 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_real_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),n*nerv,& call mpi_rsend(rcvbuf(rcv_pt),n*nerv,&
& mpi_real,prcid(i),& & mpi_real,prcid(i),&
@ -417,7 +417,7 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -849,7 +849,7 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
call mpi_irecv(sndbuf(snd_pt),nesd,& call mpi_irecv(sndbuf(snd_pt),nesd,&
& mpi_real,prcid(i),& & mpi_real,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -872,7 +872,7 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_real_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),nerv,& call mpi_rsend(rcvbuf(rcv_pt),nerv,&
& mpi_real,prcid(i),& & mpi_real,prcid(i),&
@ -902,7 +902,7 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
proc_to_comm = idx(pnti+psb_proc_id_) proc_to_comm = idx(pnti+psb_proc_id_)
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_real_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -355,7 +355,7 @@ subroutine psi_zswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),n*nerv,& call mpi_irecv(rcvbuf(rcv_pt),n*nerv,&
& mpi_double_complex,prcid(i),& & mpi_double_complex,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -378,7 +378,7 @@ subroutine psi_zswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_dcomplex_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
call mpi_rsend(sndbuf(snd_pt),n*nesd,& call mpi_rsend(sndbuf(snd_pt),n*nesd,&
@ -411,7 +411,7 @@ subroutine psi_zswapidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -844,7 +844,7 @@ subroutine psi_zswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
call mpi_irecv(rcvbuf(rcv_pt),nerv,& call mpi_irecv(rcvbuf(rcv_pt),nerv,&
& mpi_double_complex,prcid(i),& & mpi_double_complex,prcid(i),&
& p2ptag, icomm,rvhd(i),iret) & p2ptag, icomm,rvhd(i),iret)
@ -866,7 +866,7 @@ subroutine psi_zswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_dcomplex_swap_tag
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
if (usersend) then if (usersend) then
@ -898,7 +898,7 @@ subroutine psi_zswapidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
if ((proc_to_comm /= me).and.(nerv>0)) then if ((proc_to_comm /= me).and.(nerv>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -363,7 +363,7 @@ subroutine psi_ztranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
call mpi_irecv(sndbuf(snd_pt),n*nesd,& call mpi_irecv(sndbuf(snd_pt),n*nesd,&
& mpi_double_complex,prcid(i),& & mpi_double_complex,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -386,7 +386,7 @@ subroutine psi_ztranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_dcomplex_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),n*nerv,& call mpi_rsend(rcvbuf(rcv_pt),n*nerv,&
& mpi_double_complex,prcid(i),& & mpi_double_complex,prcid(i),&
@ -417,7 +417,7 @@ subroutine psi_ztranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)
@ -852,7 +852,7 @@ subroutine psi_ztranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
call psb_get_rank(prcid(i),ictxt,proc_to_comm) call psb_get_rank(prcid(i),ictxt,proc_to_comm)
if ((nesd>0).and.(proc_to_comm /= me)) then if ((nesd>0).and.(proc_to_comm /= me)) then
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
call mpi_irecv(sndbuf(snd_pt),nesd,& call mpi_irecv(sndbuf(snd_pt),nesd,&
& mpi_double_complex,prcid(i),& & mpi_double_complex,prcid(i),&
& p2ptag,icomm,rvhd(i),iret) & p2ptag,icomm,rvhd(i),iret)
@ -875,7 +875,7 @@ subroutine psi_ztranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
if ((nerv>0).and.(proc_to_comm /= me)) then if ((nerv>0).and.(proc_to_comm /= me)) then
p2ptag=ksendid(ictxt,proc_to_comm,me) p2ptag= psb_dcomplex_swap_tag
if (usersend) then if (usersend) then
call mpi_rsend(rcvbuf(rcv_pt),nerv,& call mpi_rsend(rcvbuf(rcv_pt),nerv,&
& mpi_double_complex,prcid(i),& & mpi_double_complex,prcid(i),&
@ -905,7 +905,7 @@ subroutine psi_ztranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
proc_to_comm = idx(pnti+psb_proc_id_) proc_to_comm = idx(pnti+psb_proc_id_)
nerv = idx(pnti+psb_n_elem_recv_) nerv = idx(pnti+psb_n_elem_recv_)
nesd = idx(pnti+nerv+psb_n_elem_send_) nesd = idx(pnti+nerv+psb_n_elem_send_)
p2ptag = krecvid(ictxt,proc_to_comm,me) p2ptag = psb_dcomplex_swap_tag
if ((proc_to_comm /= me).and.(nesd>0)) then if ((proc_to_comm /= me).and.(nesd>0)) then
call mpi_wait(rvhd(i),p2pstat,iret) call mpi_wait(rvhd(i),p2pstat,iret)

@ -2,11 +2,11 @@ include ../../Make.inc
BASIC_MODS= psb_const_mod.o psb_error_mod.o psb_realloc_mod.o BASIC_MODS= psb_const_mod.o psb_error_mod.o psb_realloc_mod.o
UTIL_MODS = psb_string_mod.o \ UTIL_MODS = psb_string_mod.o \
psb_desc_type.o psb_sort_mod.o psb_penv_mod.o \ psb_desc_type.o psb_sort_mod.o psb_serial_mod.o \
psb_serial_mod.o \
psb_base_tools_mod.o psb_s_tools_mod.o psb_d_tools_mod.o\ psb_base_tools_mod.o psb_s_tools_mod.o psb_d_tools_mod.o\
psb_c_tools_mod.o psb_z_tools_mod.o psb_tools_mod.o \ psb_c_tools_mod.o psb_z_tools_mod.o psb_tools_mod.o \
psb_blacs_mod.o \ psi_comm_buffers_mod.o psi_penv_mod.o psi_bcast_mod.o \
psi_reduce_mod.o psi_p2p_mod.o psb_error_impl.o \
psb_linmap_type_mod.o psb_linmap_mod.o psb_comm_mod.o\ psb_linmap_type_mod.o psb_linmap_mod.o psb_comm_mod.o\
psb_s_psblas_mod.o psb_c_psblas_mod.o \ psb_s_psblas_mod.o psb_c_psblas_mod.o \
psb_d_psblas_mod.o psb_z_psblas_mod.o psb_psblas_mod.o \ psb_d_psblas_mod.o psb_z_psblas_mod.o psb_psblas_mod.o \
@ -28,13 +28,17 @@ CINCLUDES=-I.
FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG). FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG).
lib: $(BASIC_MODS) blacsmod $(UTIL_MODS) $(OBJS) $(LIBMOD) lib: $(BASIC_MODS) penvmod $(UTIL_MODS) $(OBJS) $(LIBMOD)
$(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)
/bin/cp -p $(LIBMOD) $(LIBDIR) /bin/cp -p $(LIBMOD) $(LIBDIR)
/bin/cp -p *$(.mod) $(LIBDIR) /bin/cp -p *$(.mod) $(LIBDIR)
psi_penv_mod.o: psi_comm_buffers_mod.o psb_const_mod.o psb_realloc_mod.o
psi_bcast_mod.o psi_reduce_mod.o psi_p2p_mod.o penvmod.o: psi_penv_mod.o
psb_penv_mod.o: psi_bcast_mod.o psi_reduce_mod.o psi_p2p_mod.o
psb_base_mat_mod.o: psb_string_mod.o psb_sort_mod.o psb_ip_reord_mod.o\ psb_base_mat_mod.o: psb_string_mod.o psb_sort_mod.o psb_ip_reord_mod.o\
psb_error_mod.o psi_serial_mod.o psb_error_mod.o psi_serial_mod.o
psb_s_base_mat_mod.o psb_d_base_mat_mod.o psb_c_base_mat_mod.o psb_z_base_mat_mod.o: psb_base_mat_mod.o psb_s_base_mat_mod.o psb_d_base_mat_mod.o psb_c_base_mat_mod.o psb_z_base_mat_mod.o: psb_base_mat_mod.o
@ -51,7 +55,6 @@ psb_realloc_mod.o : psb_error_mod.o
psb_spmat_type.o : psb_realloc_mod.o psb_error_mod.o psb_const_mod.o psb_string_mod.o psb_sort_mod.o psb_spmat_type.o : psb_realloc_mod.o psb_error_mod.o psb_const_mod.o psb_string_mod.o psb_sort_mod.o
psb_error_mod.o: psb_const_mod.o psb_error_mod.o: psb_const_mod.o
psb_ip_reord_mod.o: psb_const_mod.o psb_ip_reord_mod.o: psb_const_mod.o
psb_penv_mod.o: psb_const_mod.o psb_error_mod.o psb_realloc_mod.o psb_blacs_mod.o
psb_blacs_mod.o: psb_const_mod.o psb_blacs_mod.o: psb_const_mod.o
psi_serial_mod.o: psb_const_mod.o psb_realloc_mod.o psi_serial_mod.o: psb_const_mod.o psb_realloc_mod.o
psi_mod.o: psb_penv_mod.o psb_error_mod.o psb_desc_type.o psb_const_mod.o psi_serial_mod.o psb_serial_mod.o psi_mod.o: psb_penv_mod.o psb_error_mod.o psb_desc_type.o psb_const_mod.o psi_serial_mod.o psb_serial_mod.o
@ -75,8 +78,11 @@ psb_sparse_mod.o: $(MODULES)
newmods: $(BASIC_MODS) newmods: $(BASIC_MODS)
(cd ../newserial; make lib LIBNAME=$(LIBNAME)) (cd ../newserial; make lib LIBNAME=$(LIBNAME))
blacsmod:
(make psb_blacs_mod.o psb_penv_mod.o F90COPT="$(F90COPT) $(EXTRA_OPT)")
penvmod:
(make psb_penv_mod.o F90COPT="$(F90COPT) $(EXTRA_OPT)")
clean: clean:

@ -32,7 +32,11 @@
module psb_const_mod module psb_const_mod
! This is the default integer ! This is the default integer
#if defined(LONG_INTEGERS)
integer, parameter :: ndig=12
#else
integer, parameter :: ndig=8 integer, parameter :: ndig=8
#endif
integer, parameter :: psb_int_k_ = selected_int_kind(ndig) integer, parameter :: psb_int_k_ = selected_int_kind(ndig)
! This is an 8-byte integer, and normally different from default integer. ! This is an 8-byte integer, and normally different from default integer.
integer, parameter :: longndig=12 integer, parameter :: longndig=12
@ -45,6 +49,7 @@ module psb_const_mod
integer, parameter :: psb_spk_ = kind(1.e0) integer, parameter :: psb_spk_ = kind(1.e0)
integer, save :: psb_sizeof_dp, psb_sizeof_sp integer, save :: psb_sizeof_dp, psb_sizeof_sp
integer, save :: psb_sizeof_int, psb_sizeof_long_int integer, save :: psb_sizeof_int, psb_sizeof_long_int
integer, save :: psb_mpi_integer
! !
! Handy & miscellaneous constants ! Handy & miscellaneous constants

@ -30,25 +30,38 @@
!!$ !!$
!!$ !!$
module psb_error_mod module psb_error_mod
use psb_const_mod
integer, parameter, public :: psb_act_ret_=0, psb_act_abort_=1, psb_no_err_=0 integer, parameter, public :: psb_act_ret_=0, psb_act_abort_=1, psb_no_err_=0
integer, parameter, public :: psb_debug_ext_=1, psb_debug_outer_=2 integer, parameter, public :: psb_debug_ext_=1, psb_debug_outer_=2
integer, parameter, public :: psb_debug_comp_=3, psb_debug_inner_=4 integer, parameter, public :: psb_debug_comp_=3, psb_debug_inner_=4
integer, parameter, public :: psb_debug_serial_=8, psb_debug_serial_comp_=9 integer, parameter, public :: psb_debug_serial_=8, psb_debug_serial_comp_=9
! !
! Error handling ! Error handling
! !
public psb_errpush, psb_error, psb_get_errstatus,& public psb_errpush, psb_error, psb_get_errstatus,&
& psb_get_errverbosity, psb_set_errverbosity,psb_errcomm, & & psb_errpop, psb_errmsg, psb_errcomm, psb_get_numerr, &
& psb_get_errverbosity, psb_set_errverbosity, &
& psb_erractionsave, psb_erractionrestore, & & psb_erractionsave, psb_erractionrestore, &
& psb_get_erraction, psb_set_erraction, & & psb_get_erraction, psb_set_erraction, &
& psb_get_debug_level, psb_set_debug_level,& & psb_get_debug_level, psb_set_debug_level,&
& psb_get_debug_unit, psb_set_debug_unit,& & psb_get_debug_unit, psb_set_debug_unit,&
& psb_get_serial_debug_level, psb_set_serial_debug_level & psb_get_serial_debug_level, psb_set_serial_debug_level
interface psb_error interface psb_error
module procedure psb_serror subroutine psb_serror()
module procedure psb_perror end subroutine psb_serror
subroutine psb_perror(ictxt)
integer, intent(in) :: ictxt
end subroutine psb_perror
end interface
interface
subroutine psb_errcomm(ictxt, err)
integer, intent(in) :: ictxt
integer, intent(inout):: err
end subroutine psb_errcomm
end interface end interface
@ -163,20 +176,6 @@ contains
end subroutine psb_set_serial_debug_level end subroutine psb_set_serial_debug_level
! checks wether an error has occurred on one of the porecesses in the execution pool
subroutine psb_errcomm(ictxt, err)
integer, intent(in) :: ictxt
integer, intent(inout):: err
integer :: temp(2)
integer, parameter :: ione=1
! Cannot use psb_amx or otherwise we have a recursion in module usage
#if !defined(SERIAL_MPI)
call igamx2d(ictxt, 'A', ' ', ione, ione, err, ione,&
&temp ,temp,-ione ,-ione,-ione)
#endif
end subroutine psb_errcomm
! sets verbosity of the error message ! sets verbosity of the error message
subroutine psb_set_errverbosity(v) subroutine psb_set_errverbosity(v)
@ -186,6 +185,14 @@ contains
! returns number of errors
function psb_get_numerr()
integer :: psb_get_numerr
psb_get_numerr = error_stack%n_elems
end function psb_get_numerr
! returns verbosity of the error message ! returns verbosity of the error message
function psb_get_errverbosity() function psb_get_errverbosity()
integer :: psb_get_errverbosity integer :: psb_get_errverbosity
@ -259,97 +266,6 @@ contains
! handles the occurence of an error in a parallel routine
subroutine psb_perror(ictxt)
integer, intent(in) :: ictxt
integer :: err_c
character(len=20) :: r_name
character(len=40) :: a_e_d
integer :: i_e_d(5)
integer :: nprow, npcol, me, mypcol
integer, parameter :: ione=1, izero=0
#if defined(SERIAL_MPI)
me = -1
#else
call blacs_gridinfo(ictxt,nprow,npcol,me,mypcol)
#endif
if(error_status > 0) then
if(verbosity_level > 1) then
do while (error_stack%n_elems > izero)
write(0,'(50("="))')
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
call psb_errmsg(err_c, r_name, i_e_d, a_e_d,me)
! write(0,'(50("="))')
end do
#if defined(SERIAL_MPI)
stop
#else
call blacs_abort(ictxt,-1)
#endif
else
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
call psb_errmsg(err_c, r_name, i_e_d, a_e_d,me)
do while (error_stack%n_elems > 0)
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
end do
#if defined(SERIAL_MPI)
stop
#else
call blacs_abort(ictxt,-1)
#endif
end if
end if
if(error_status > izero) then
#if defined(SERIAL_MPI)
stop
#else
call blacs_abort(ictxt,err_c)
#endif
end if
end subroutine psb_perror
! handles the occurence of an error in a serial routine
subroutine psb_serror()
integer :: err_c
character(len=20) :: r_name
character(len=40) :: a_e_d
integer :: i_e_d(5)
integer, parameter :: ione=1, izero=0
if(error_status > 0) then
if(verbosity_level > 1) then
do while (error_stack%n_elems > izero)
write(0,'(50("="))')
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
call psb_errmsg(err_c, r_name, i_e_d, a_e_d)
! write(0,'(50("="))')
end do
else
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
call psb_errmsg(err_c, r_name, i_e_d, a_e_d)
do while (error_stack%n_elems > 0)
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
end do
end if
end if
end subroutine psb_serror
! prints the error msg associated to a specific error code ! prints the error msg associated to a specific error code
subroutine psb_errmsg(err_c, r_name, i_e_d, a_e_d,me) subroutine psb_errmsg(err_c, r_name, i_e_d, a_e_d,me)
@ -367,164 +283,147 @@ contains
select case (err_c) select case (err_c)
case(:0) case(:psb_success_)
write (0,'("error on calling sperror. err_c must be greater than 0")') write (0,'("error on calling sperror. err_c must be greater than 0")')
case(2) case(psb_err_pivot_too_small_)
write (0,'("pivot too small: ",i0,1x,a)')i_e_d(1),a_e_d write (0,'("pivot too small: ",i0,1x,a)')i_e_d(1),a_e_d
case(3) case(psb_err_invalid_ovr_num_)
write (0,'("Invalid number of ovr:",i0)')i_e_d(1) write (0,'("Invalid number of ovr:",i0)')i_e_d(1)
case(5) case(psb_err_invalid_input_)
write (0,'("Invalid input")') write (0,'("Invalid input")')
case(10) case(psb_err_iarg_neg_)
write (0,'("input argument n. ",i0," cannot be less than 0")')i_e_d(1) write (0,'("input argument n. ",i0," cannot be less than 0")')i_e_d(1)
write (0,'("current value is ",i0)')i_e_d(2) write (0,'("current value is ",i0)')i_e_d(2)
case(20) case(psb_err_iarg_pos_)
write (0,'("input argument n. ",i0," cannot be greater than 0")')i_e_d(1) write (0,'("input argument n. ",i0," cannot be greater than 0")')i_e_d(1)
write (0,'("current value is ",i0)')i_e_d(2) write (0,'("current value is ",i0)')i_e_d(2)
case(30) case(psb_err_input_value_invalid_i_)
write (0,'("input argument n. ",i0," has an invalid value")')i_e_d(1) write (0,'("input argument n. ",i0," has an invalid value")')i_e_d(1)
write (0,'("current value is ",i0)')i_e_d(2) write (0,'("current value is ",i0)')i_e_d(2)
case(31) case(psb_err_input_asize_invalid_i_)
write (0,'("input argument n. ",i0," has an invalid value")')i_e_d(1)
write (0,'("current value is ",a)')a_e_d
case(35)
write (0,'("Size of input array argument n. ",i0," is invalid.")')i_e_d(1) write (0,'("Size of input array argument n. ",i0," is invalid.")')i_e_d(1)
write (0,'("Current value is ",i0)')i_e_d(2) write (0,'("Current value is ",i0)')i_e_d(2)
case(36) case(psb_err_iarg_invalid_i_)
write (0,'("Size of input array argument n. ",i0," must be ")')i_e_d(1)
write (0,'("at least ",i0)')i_e_d(2)
case(40)
write (0,'("input argument n. ",i0," has an invalid value")')i_e_d(1) write (0,'("input argument n. ",i0," has an invalid value")')i_e_d(1)
write (0,'("current value is ",a)')a_e_d(2:2) write (0,'("current value is ",a)')a_e_d(2:2)
case(50) case(psb_err_iarg_not_gtia_ii_)
write (0,'("input argument n. ",i0," must be equal or greater than input argument n. ",i0)') i_e_d(1), i_e_d(3) write (0,'("input argument n. ",i0," must be equal or greater than input argument n. ",i0)') i_e_d(1), i_e_d(3)
write (0,'("current values are ",i0," < ",i0)') i_e_d(2),i_e_d(5) write (0,'("current values are ",i0," < ",i0)') i_e_d(2),i_e_d(5)
case(60) case(psb_err_iarg_not_gteia_ii_)
write (0,'("input argument n. ",i0," must be greater than or equal to ",i0)')i_e_d(1),i_e_d(2) write (0,'("input argument n. ",i0," must be greater than or equal to ",i0)')i_e_d(1),i_e_d(2)
write (0,'("current value is ",i0," < ",i0)')i_e_d(3), i_e_d(2) write (0,'("current value is ",i0," < ",i0)')i_e_d(3), i_e_d(2)
case(70) case(psb_err_iarg_invalid_value_)
write (0,'("input argument n. ",i0," in entry # ",i0," has an invalid value")')i_e_d(1:2) write (0,'("input argument n. ",i0," in entry # ",i0," has an invalid value")')i_e_d(1:2)
write (0,'("current value is ",a)')a_e_d write (0,'("current value is ",a)')a_e_d
case(71) case(psb_err_asb_nrc_error_)
write (0,'("Impossible error in ASB: nrow>ncol,")') write (0,'("Impossible error in ASB: nrow>ncol,")')
write (0,'("Actual values are ",i0," > ",i0)')i_e_d(1:2) write (0,'("Actual values are ",i0," > ",i0)')i_e_d(1:2)
! ... csr format error ... ! ... csr format error ...
case(80) case(psb_err_iarg2_neg_)
write (0,'("input argument ia2(1) is less than 0")') write (0,'("input argument ia2(1) is less than 0")')
write (0,'("current value is ",i0)')i_e_d(1) write (0,'("current value is ",i0)')i_e_d(1)
! ... csr format error ... ! ... csr format error ...
case(90) case(psb_err_ia2_not_increasing_)
write (0,'("indices in ia2 array are not in increasing order")') write (0,'("indices in ia2 array are not in increasing order")')
case(91) case(psb_err_ia1_not_increasing_)
write (0,'("indices in ia1 array are not in increasing order")') write (0,'("indices in ia1 array are not in increasing order")')
! ... csr format error ... ! ... csr format error ...
case(100) case(psb_err_ia1_badindices_)
write (0,'("indices in ia1 array are not within problem dimension")') write (0,'("indices in ia1 array are not within problem dimension")')
write (0,'("problem dimension is ",i0)')i_e_d(1) write (0,'("problem dimension is ",i0)')i_e_d(1)
case(110) case(psb_err_invalid_args_combination_)
write (0,'("invalid combination of input arguments")') write (0,'("invalid combination of input arguments")')
case(115) case(psb_err_invalid_pid_arg_)
write (0,'("Invalid process identifier in input array argument n. ",i0,".")')i_e_d(1) write (0,'("Invalid process identifier in input array argument n. ",i0,".")')i_e_d(1)
write (0,'("Current value is ",i0)')i_e_d(2) write (0,'("Current value is ",i0)')i_e_d(2)
case(120) case(psb_err_iarg_n_mbgtian_)
write (0,'("input argument n. ",i0," must be greater than input argument n. ",i0)')i_e_d(1:2) write (0,'("input argument n. ",i0," must be greater than input argument n. ",i0)')i_e_d(1:2)
write (0,'("current values are ",i0," < ",i0)') i_e_d(3:4) write (0,'("current values are ",i0," < ",i0)') i_e_d(3:4)
! ... coo format error ... ! ... coo format error ...
case(130) case(psb_err_duplicate_coo)
write (0,'("there are duplicated elements in coo format")') write (0,'("there are duplicated elements in coo format")')
write (0,'("and you have chosen psb_dupl_err_ ")') write (0,'("and you have chosen psb_dupl_err_ ")')
case(134) case(psb_err_invalid_input_format_)
write (0,'("Invalid input format ",a3)')a_e_d(1:3) write (0,'("Invalid input format ",a3)')a_e_d(1:3)
case(135) case(psb_err_unsupported_format_)
write (0,'("Format ",a3," not yet supported here")')a_e_d(1:3) write (0,'("Format ",a3," not yet supported here")')a_e_d(1:3)
case(136) case(psb_err_format_unknown_)
write (0,'("Format ",a3," is unknown")')a_e_d(1:3) write (0,'("Format ",a3," is unknown")')a_e_d(1:3)
case(140) case(psb_err_iarray_outside_bounds_)
write (0,'("indices in input array are not within problem dimension ",2(i0,2x))')i_e_d(1:2) write (0,'("indices in input array are not within problem dimension ",2(i0,2x))')i_e_d(1:2)
case(150) case(psb_err_iarray_outside_process_)
write (0,'("indices in input array are not belonging to the calling process ",i0)')i_e_d(1) write (0,'("indices in input array are not belonging to the calling process ",i0)')i_e_d(1)
case(290) case(psb_err_forgot_geall_)
write (0,'("To call this routine you must first call psb_geall on the same matrix")') write (0,'("To call this routine you must first call psb_geall on the same matrix")')
case(295) case(psb_err_forgot_spall_)
write (0,'("To call this routine you must first call psb_spall on the same matrix")') write (0,'("To call this routine you must first call psb_spall on the same matrix")')
case(300) case(psb_err_iarg_mbeeiarra_i_)
write (0,'("Input argument n. ",i0," must be equal to entry n. ",i0," in array input argument n.",i0)') & write (0,'("Input argument n. ",i0," must be equal to entry n. ",i0," in array input argument n.",i0)') &
& i_e_d(1),i_e_d(4),i_e_d(3) & i_e_d(1),i_e_d(4),i_e_d(3)
write (0,'("Current values are ",i0," != ",i0)')i_e_d(2), i_e_d(5) write (0,'("Current values are ",i0," != ",i0)')i_e_d(2), i_e_d(5)
case(400) case(psb_err_mpi_error_)
write (0,'("MPI error:",i0)')i_e_d(1) write (0,'("MPI error:",i0)')i_e_d(1)
case(550) case(psb_err_parm_differs_among_procs_)
write (0,'("Parameter n. ",i0," must be equal on all processes. ",i0)')i_e_d(1) write (0,'("Parameter n. ",i0," must be equal on all processes. ",i0)')i_e_d(1)
case(551) case(psb_err_entry_out_of_bounds_)
write (0,'("Entry n. ",i0," out of ",i0," should be between 1 and ",i0," but is ",i0)')i_e_d(1),i_e_d(3),i_e_d(4),i_e_d(2) write (0,'("Entry n. ",i0," out of ",i0," should be between 1 and ",i0," but is ",i0)')i_e_d(1),i_e_d(3),i_e_d(4),i_e_d(2)
case(552) case(psb_err_inconsistent_index_lists_)
write (0,'("Index lists are inconsistent: some indices are orphans")') write (0,'("Index lists are inconsistent: some indices are orphans")')
case(570) case(psb_err_partfunc_toomuchprocs_)
write (0,'("partition function passed as input argument n. ",i0," returns number of processes")')i_e_d(1) write (0,'("partition function passed as input argument n. ",i0," returns number of processes")')i_e_d(1)
write (0,'("greater than No of grid s processes on global point ",i0,". Actual number of grid s ")')i_e_d(4) write (0,'("greater than No of grid s processes on global point ",i0,". Actual number of grid s ")')i_e_d(4)
write (0,'("processes is ",i0,", number returned is ",i0)')i_e_d(2),i_e_d(3) write (0,'("processes is ",i0,", number returned is ",i0)')i_e_d(2),i_e_d(3)
case(575) case(psb_err_partfunc_toofewprocs_)
write (0,'("partition function passed as input argument n. ",i0," returns number of processes")')i_e_d(1) write (0,'("partition function passed as input argument n. ",i0," returns number of processes")')i_e_d(1)
write (0,'("less or equal to 0 on global point ",i0,". Number returned is ",i0)')i_e_d(3),i_e_d(2) write (0,'("less or equal to 0 on global point ",i0,". Number returned is ",i0)')i_e_d(3),i_e_d(2)
case(580) case(psb_err_partfunc_wrong_pid_)
write (0,'("partition function passed as input argument n. ",i0," returns wrong processes identifier")')i_e_d(1) write (0,'("partition function passed as input argument n. ",i0," returns wrong processes identifier")')i_e_d(1)
write (0,'("on global point ",i0,". Current value returned is : ",i0)')i_e_d(3),i_e_d(2) write (0,'("on global point ",i0,". Current value returned is : ",i0)')i_e_d(3),i_e_d(2)
case(581) case(psb_err_no_optional_arg_)
write (0,'("Exactly one of the optional arguments ",a," must be present")')a_e_d write (0,'("Exactly one of the optional arguments ",a," must be present")')a_e_d
case(582) case(psb_err_arg_m_required_)
write (0,'("Argument M is required when argument PARTS is specified")') write (0,'("Argument M is required when argument PARTS is specified")')
case(583) case(psb_err_spmat_invalid_state_)
write (0,'("No more than one of the optional arguments ",a," must be present")')a_e_d
case(600)
write (0,'("Sparse Matrix and descriptors are in an invalid state for this subroutine call: ",i0)')i_e_d(1) write (0,'("Sparse Matrix and descriptors are in an invalid state for this subroutine call: ",i0)')i_e_d(1)
case(700) case (psb_err_invalid_cd_state_)
write (0,'("The base version of subroutine ''",a,"'' has been called.",/,&
&"The class implementation for ''",a,"'' may be incomplete!")') &
& trim(r_name), trim(a_e_d)
case (1121)
write (0,'("Invalid state for sparse matrix A")')
case (1122)
write (0,'("Invalid state for communication descriptor")') write (0,'("Invalid state for communication descriptor")')
case (1123) case (psb_err_invalid_a_and_cd_state_)
write (0,'("Invalid combined state for A and DESC_A")') write (0,'("Invalid combined state for A and DESC_A")')
case (1124) case(1124:1999)
write (0,'("Invalid state for object:",a)') trim(a_e_d)
case(1125:1999)
write (0,'("computational error. code: ",i0)')err_c write (0,'("computational error. code: ",i0)')err_c
case(2010) case(psb_err_blacs_error_)
write (0,'("BLACS error. Number of processes=-1")') write (0,'("BLACS error. Number of processes=-1")')
case(2011) case(psb_err_initerror_neugh_procs_)
write (0,'("Initialization error: not enough processes available in the parallel environment")') write (0,'("Initialization error: not enough processes available in the parallel environment")')
case(2030) case(psb_err_blacs_err_gridcols_not_1_)
write (0,'("BLACS ERROR: Number of grid columns must be equal to 1\nCurrent value is ",i4," != 1.")')i_e_d(1) write (0,'("BLACS ERROR: Number of grid columns must be equal to 1\nCurrent value is ",i4," != 1.")')i_e_d(1)
case(2231) case(psb_err_invalid_matrix_input_state_)
write (0,'("Invalid input state for matrix.")') write (0,'("Invalid input state for matrix.")')
case(2232) case(psb_err_input_no_regen_)
write (0,'("Input state for matrix is not adequate for regeneration.")') write (0,'("Input state for matrix is not adequate for regeneration.")')
case (2233:2999) case (2233:2999)
write(0,'("resource error. code: ",i0)')err_c write(0,'("resource error. code: ",i0)')err_c
case(3000:3009) case(3000:3009)
write (0,'("sparse matrix representation ",a3," not yet implemented")')a_e_d(1:3) write (0,'("sparse matrix representation ",a3," not yet implemented")')a_e_d(1:3)
case(3010) case(psb_err_lld_case_not_implemented_)
write (0,'("Case lld not equal matrix_data[N_COL_] is not yet implemented.")') write (0,'("Case lld not equal matrix_data[N_COL_] is not yet implemented.")')
case(3015) case(psb_err_transpose_unsupported_)
write (0,'("transpose option for sparse matrix representation ",a3," not implemented")')a_e_d(1:3) write (0,'("transpose option for sparse matrix representation ",a3," not implemented")')a_e_d(1:3)
case(3020) case(psb_err_transpose_c_unsupported_)
write (0,'("Case trans = C is not yet implemented.")') write (0,'("Case trans = C is not yet implemented.")')
case(3021) case(psb_err_transpose_not_n_unsupported_)
write (0,'("Case trans /= N is not yet implemented.")') write (0,'("Case trans /= N is not yet implemented.")')
case(3022) case(psb_err_only_unit_diag_)
write (0,'("Only unit diagonal so far for triangular matrices. ")') write (0,'("Only unit diagonal so far for triangular matrices. ")')
case(3023) case(3023)
write (0,'("Cases DESCRA(1:1)=S DESCRA(1:1)=T not yet implemented. ")') write (0,'("Cases DESCRA(1:1)=S DESCRA(1:1)=T not yet implemented. ")')
case(3024) case(3024)
write (0,'("Cases DESCRA(1:1)=G not yet implemented. ")') write (0,'("Cases DESCRA(1:1)=G not yet implemented. ")')
case(3030) case(psb_err_ja_nix_ia_niy_unsupported_)
write (0,'("Case ja /= ix or ia/=iy is not yet implemented.")') write (0,'("Case ja /= ix or ia/=iy is not yet implemented.")')
case(3040) case(psb_err_ix_n1_iy_n1_unsupported_)
write (0,'("Case ix /= 1 or iy /= 1 is not yet implemented.")') write (0,'("Case ix /= 1 or iy /= 1 is not yet implemented.")')
case(3050) case(3050)
write (0,'("Case ix /= iy is not yet implemented.")') write (0,'("Case ix /= iy is not yet implemented.")')
@ -539,7 +438,7 @@ contains
case(3100) case(3100)
write (0,'("Error on index. Element has not been inserted")') write (0,'("Error on index. Element has not been inserted")')
write (0,'("local index is: ",i0," and global index is:",i0)')i_e_d(1:2) write (0,'("local index is: ",i0," and global index is:",i0)')i_e_d(1:2)
case(3110) case(psb_err_input_matrix_unassembled_)
write (0,'("Before you call this routine, you must assembly sparse matrix")') write (0,'("Before you call this routine, you must assembly sparse matrix")')
case(3111) case(3111)
write (0,'("Before you call this routine, you must initialize the preconditioner")') write (0,'("Before you call this routine, you must initialize the preconditioner")')
@ -547,23 +446,23 @@ contains
write (0,'("Before you call this routine, you must build the preconditioner")') write (0,'("Before you call this routine, you must build the preconditioner")')
case(3113:3999) case(3113:3999)
write(0,'("miscellaneus error. code: ",i0)')err_c write(0,'("miscellaneus error. code: ",i0)')err_c
case(4000) case(psb_err_alloc_dealloc_)
write(0,'("Allocation/deallocation error")') write(0,'("Allocation/deallocation error")')
case(4001) case(psb_err_internal_error_)
write(0,'("Internal error: ",a)')a_e_d write(0,'("Internal error: ",a)')a_e_d
case(4010) case(psb_err_from_subroutine_)
write (0,'("Error from call to subroutine ",a)')a_e_d write (0,'("Error from call to subroutine ",a)')a_e_d
case(4011) case(psb_err_from_subroutine_non_)
write (0,'("Error from call to a subroutine ")') write (0,'("Error from call to a subroutine ")')
case(4012) case(psb_err_from_subroutine_i_)
write (0,'("Error ",i0," from call to a subroutine ")')i_e_d(1) write (0,'("Error ",i0," from call to a subroutine ")')i_e_d(1)
case(4013) case(psb_err_from_subroutine_ai_)
write (0,'("Error from call to subroutine ",a," ",i0)')a_e_d,i_e_d(1) write (0,'("Error from call to subroutine ",a," ",i0)')a_e_d,i_e_d(1)
case(4025) case(psb_err_alloc_request_)
write (0,'("Error on allocation request for ",i0," items of type ",a)')i_e_d(1),a_e_d write (0,'("Error on allocation request for ",i0," items of type ",a)')i_e_d(1),a_e_d
case(4110) case(4110)
write (0,'("Error ",i0," from call to an external package in subroutine ",a)')i_e_d(1),a_e_d write (0,'("Error ",i0," from call to an external package in subroutine ",a)')i_e_d(1),a_e_d
case (5001) case (psb_err_invalid_istop_)
write (0,'("Invalid ISTOP: ",i0)')i_e_d(1) write (0,'("Invalid ISTOP: ",i0)')i_e_d(1)
case (5002) case (5002)
write (0,'("Invalid PREC: ",i0)')i_e_d(1) write (0,'("Invalid PREC: ",i0)')i_e_d(1)

File diff suppressed because it is too large Load Diff

@ -38,21 +38,25 @@ module psb_realloc_mod
! the size specified, possibly shortening it. ! the size specified, possibly shortening it.
! !
Interface psb_realloc Interface psb_realloc
module procedure psb_dreallocate1i module procedure psb_reallocate1i
module procedure psb_dreallocate2i module procedure psb_reallocate2i
module procedure psb_dreallocate2i1d module procedure psb_reallocate2i1d
module procedure psb_dreallocate2i1s module procedure psb_reallocate2i1s
module procedure psb_dreallocate1d module procedure psb_reallocate1d
module procedure psb_dreallocate1s module procedure psb_reallocate1s
module procedure psb_dreallocated2 module procedure psb_reallocated2
module procedure psb_dreallocates2 module procedure psb_reallocates2
module procedure psb_dreallocatei2 module procedure psb_reallocatei2
module procedure psb_dreallocate2i1z #if ! defined(LONG_INTEGERS)
module procedure psb_dreallocate2i1c module procedure psb_reallocate1i8
module procedure psb_dreallocate1z module procedure psb_reallocatei8_2
module procedure psb_dreallocate1c #endif
module procedure psb_dreallocatez2 module procedure psb_reallocate2i1z
module procedure psb_dreallocatec2 module procedure psb_reallocate2i1c
module procedure psb_reallocate1z
module procedure psb_reallocate1c
module procedure psb_reallocatez2
module procedure psb_reallocatec2
end Interface end Interface
interface psb_move_alloc interface psb_move_alloc
@ -62,6 +66,10 @@ module psb_realloc_mod
module procedure psb_dmove_alloc2d module procedure psb_dmove_alloc2d
module procedure psb_imove_alloc1d module procedure psb_imove_alloc1d
module procedure psb_imove_alloc2d module procedure psb_imove_alloc2d
#if !defined(LONG_INTEGERS)
module procedure psb_i8move_alloc1d
module procedure psb_i8move_alloc2d
#endif
module procedure psb_cmove_alloc1d module procedure psb_cmove_alloc1d
module procedure psb_cmove_alloc2d module procedure psb_cmove_alloc2d
module procedure psb_zmove_alloc1d module procedure psb_zmove_alloc1d
@ -91,12 +99,18 @@ module psb_realloc_mod
! !
interface psb_ensure_size interface psb_ensure_size
module procedure psb_icksz1d,& module procedure psb_icksz1d,&
#if !defined(LONG_INTEGERS)
& psb_i8cksz1d, &
#endif
& psb_scksz1d, psb_ccksz1d, & & psb_scksz1d, psb_ccksz1d, &
& psb_dcksz1d, psb_zcksz1d & psb_dcksz1d, psb_zcksz1d
end Interface end Interface
interface psb_size interface psb_size
module procedure psb_isize1d, psb_isize2d,& module procedure psb_isize1d, psb_isize2d,&
#if !defined(LONG_INTEGERS)
& psb_i8size1d, psb_i8size2d,&
#endif
& psb_ssize1d, psb_ssize2d,& & psb_ssize1d, psb_ssize2d,&
& psb_csize1d, psb_csize2d,& & psb_csize1d, psb_csize2d,&
& psb_dsize1d, psb_dsize2d,& & psb_dsize1d, psb_dsize2d,&
@ -1114,6 +1128,7 @@ Contains
psb_isize1d = size(vin) psb_isize1d = size(vin)
end if end if
end function psb_isize1d end function psb_isize1d
function psb_isize2d(vin,dim) function psb_isize2d(vin,dim)
integer :: psb_isize2d integer :: psb_isize2d
integer, allocatable, intent(in) :: vin(:,:) integer, allocatable, intent(in) :: vin(:,:)
@ -1132,6 +1147,37 @@ Contains
end if end if
end function psb_isize2d end function psb_isize2d
#if !defined(LONG_INTEGERS)
function psb_i8size1d(vin)
integer :: psb_i8size1d
integer(psb_long_int_k_), allocatable, intent(in) :: vin(:)
if (.not.allocated(vin)) then
psb_i8size1d = 0
else
psb_i8size1d = size(vin)
end if
end function psb_i8size1d
function psb_i8size2d(vin,dim)
integer :: psb_i8size2d
integer(psb_long_int_k_), allocatable, intent(in) :: vin(:,:)
integer, optional :: dim
integer :: dim_
if (.not.allocated(vin)) then
psb_i8size2d = 0
else
if (present(dim)) then
dim_= dim
psb_i8size2d = size(vin,dim=dim_)
else
psb_i8size2d = size(vin)
end if
end if
end function psb_i8size2d
#endif
function psb_ssize1d(vin) function psb_ssize1d(vin)
integer :: psb_ssize1d integer :: psb_ssize1d
real(psb_spk_), allocatable, intent(in) :: vin(:) real(psb_spk_), allocatable, intent(in) :: vin(:)
@ -1310,6 +1356,64 @@ Contains
End Subroutine psb_icksz1d End Subroutine psb_icksz1d
#if !defined(LONG_INTEGERS)
Subroutine psb_i8cksz1d(len,v,info,pad,addsz,newsz)
use psb_error_mod
! ...Subroutine Arguments
Integer,Intent(in) :: len
Integer(psb_long_int_k_),allocatable, intent(inout) :: v(:)
integer :: info
integer(psb_long_int_k_), optional, intent(in) :: pad
integer, optional, intent(in) :: addsz,newsz
! ...Local Variables
character(len=20) :: name
logical, parameter :: debug=.false.
integer :: isz, err_act
name='psb_ensure_size'
call psb_erractionsave(err_act)
info=psb_success_
if(psb_get_errstatus() /= 0) then
info=psb_err_from_subroutine_
goto 9999
end if
If (len > psb_size(v)) Then
if (present(newsz)) then
isz = (max(len+1,newsz))
else
if (present(addsz)) then
isz = len+max(1,addsz)
else
isz = max(len+10, int(1.25*len))
endif
endif
call psb_realloc(isz,v,info,pad=pad)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_realloc')
goto 9999
end if
end If
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error()
end if
return
End Subroutine psb_i8cksz1d
#endif
Subroutine psb_scksz1d(len,v,info,pad,addsz,newsz) Subroutine psb_scksz1d(len,v,info,pad,addsz,newsz)
use psb_error_mod use psb_error_mod
@ -1544,7 +1648,7 @@ Contains
End Subroutine psb_zcksz1d End Subroutine psb_zcksz1d
Subroutine psb_dreallocate1i(len,rrax,info,pad,lb) Subroutine psb_reallocate1i(len,rrax,info,pad,lb)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
@ -1559,7 +1663,90 @@ Contains
character(len=20) :: name character(len=20) :: name
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
name='psb_dreallocate1i' name='psb_reallocate1i'
call psb_erractionsave(err_act)
info=psb_success_
if (debug) write(0,*) 'reallocate I',len
if (psb_get_errstatus() /= 0) then
if (debug) write(0,*) 'reallocate errstatus /= 0'
info=psb_err_from_subroutine_
goto 9999
end if
if (present(lb)) then
lb_ = lb
else
lb_ = 1
endif
if ((len<0)) then
err=4025
call psb_errpush(err,name,i_err=(/len,0,0,0,0/),a_err='integer')
goto 9999
end if
ub_ = lb_+len-1
if (debug) write(0,*) 'reallocate : lb ub ',lb_, ub_
if (allocated(rrax)) then
dim = size(rrax)
lbi = lbound(rrax,1)
If ((dim /= len).or.(lbi /= lb_)) Then
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
call psb_errpush(err,name,i_err=(/len,0,0,0,0/),a_err='integer')
goto 9999
end if
tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim))
if (debug) write(0,*) 'reallocate : calling move_alloc '
call psb_move_alloc(tmp,rrax,info)
if (debug) write(0,*) 'reallocate : from move_alloc ',info
end if
else
dim = 0
allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
call psb_errpush(err,name,i_err=(/len,0,0,0,0/),a_err='integer')
goto 9999
end if
endif
if (present(pad)) then
rrax(lb_-1+dim+1:lb_-1+len) = pad
endif
if (debug) write(0,*) 'end reallocate : ',info
call psb_erractionrestore(err_act)
return
9999 continue
info = err
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error()
end if
return
End Subroutine psb_reallocate1i
Subroutine psb_reallocate1i8(len,rrax,info,pad,lb)
use psb_error_mod
! ...Subroutine Arguments
Integer,Intent(in) :: len
Integer(psb_long_int_k_),allocatable, intent(inout) :: rrax(:)
integer :: info
integer(psb_long_int_k_), optional, intent(in) :: pad
integer, optional, intent(in) :: lb
! ...Local Variables
Integer(psb_long_int_k_),allocatable :: tmp(:)
Integer :: dim, err_act, err,lb_, lbi, ub_
character(len=20) :: name
logical, parameter :: debug=.false.
name='psb_reallocate1i'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
@ -1625,10 +1812,10 @@ Contains
return return
End Subroutine psb_dreallocate1i End Subroutine psb_reallocate1i8
Subroutine psb_dreallocate1s(len,rrax,info,pad,lb) Subroutine psb_reallocate1s(len,rrax,info,pad,lb)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
@ -1644,7 +1831,7 @@ Contains
character(len=20) :: name character(len=20) :: name
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
name='psb_dreallocate1s' name='psb_reallocate1s'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (debug) write(0,*) 'reallocate S',len if (debug) write(0,*) 'reallocate S',len
@ -1700,9 +1887,9 @@ Contains
end if end if
return return
End Subroutine psb_dreallocate1s End Subroutine psb_reallocate1s
Subroutine psb_dreallocate1d(len,rrax,info,pad,lb) Subroutine psb_reallocate1d(len,rrax,info,pad,lb)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
@ -1718,7 +1905,7 @@ Contains
character(len=20) :: name character(len=20) :: name
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
name='psb_dreallocate1d' name='psb_reallocate1d'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (debug) write(0,*) 'reallocate D',len if (debug) write(0,*) 'reallocate D',len
@ -1774,10 +1961,10 @@ Contains
end if end if
return return
End Subroutine psb_dreallocate1d End Subroutine psb_reallocate1d
Subroutine psb_dreallocate1c(len,rrax,info,pad,lb) Subroutine psb_reallocate1c(len,rrax,info,pad,lb)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
@ -1793,7 +1980,7 @@ Contains
character(len=20) :: name character(len=20) :: name
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
name='psb_dreallocate1c' name='psb_reallocate1c'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (debug) write(0,*) 'reallocate C',len if (debug) write(0,*) 'reallocate C',len
@ -1848,9 +2035,9 @@ Contains
end if end if
return return
End Subroutine psb_dreallocate1c End Subroutine psb_reallocate1c
Subroutine psb_dreallocate1z(len,rrax,info,pad,lb) Subroutine psb_reallocate1z(len,rrax,info,pad,lb)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
@ -1866,7 +2053,7 @@ Contains
character(len=20) :: name character(len=20) :: name
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
name='psb_dreallocate1z' name='psb_reallocate1z'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (debug) write(0,*) 'reallocate Z',len if (debug) write(0,*) 'reallocate Z',len
@ -1921,11 +2108,11 @@ Contains
end if end if
return return
End Subroutine psb_dreallocate1z End Subroutine psb_reallocate1z
Subroutine psb_dreallocates2(len1,len2,rrax,info,pad,lb1,lb2) Subroutine psb_reallocates2(len1,len2,rrax,info,pad,lb1,lb2)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len1,len2 Integer,Intent(in) :: len1,len2
@ -1941,7 +2128,7 @@ Contains
& lbi1, lbi2 & lbi1, lbi2
character(len=20) :: name character(len=20) :: name
name='psb_dreallocates2' name='psb_reallocates2'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (present(lb1)) then if (present(lb1)) then
@ -2014,10 +2201,10 @@ Contains
end if end if
return return
End Subroutine psb_dreallocates2 End Subroutine psb_reallocates2
Subroutine psb_dreallocated2(len1,len2,rrax,info,pad,lb1,lb2) Subroutine psb_reallocated2(len1,len2,rrax,info,pad,lb1,lb2)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len1,len2 Integer,Intent(in) :: len1,len2
@ -2033,7 +2220,7 @@ Contains
& lbi1, lbi2 & lbi1, lbi2
character(len=20) :: name character(len=20) :: name
name='psb_dreallocated2' name='psb_reallocated2'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (present(lb1)) then if (present(lb1)) then
@ -2106,10 +2293,10 @@ Contains
end if end if
return return
End Subroutine psb_dreallocated2 End Subroutine psb_reallocated2
Subroutine psb_dreallocatec2(len1,len2,rrax,info,pad,lb1,lb2) Subroutine psb_reallocatec2(len1,len2,rrax,info,pad,lb1,lb2)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len1,len2 Integer,Intent(in) :: len1,len2
@ -2125,7 +2312,7 @@ Contains
& lbi1, lbi2 & lbi1, lbi2
character(len=20) :: name character(len=20) :: name
name='psb_dreallocatec2' name='psb_reallocatec2'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (present(lb1)) then if (present(lb1)) then
@ -2199,9 +2386,9 @@ Contains
end if end if
return return
End Subroutine psb_dreallocatec2 End Subroutine psb_reallocatec2
Subroutine psb_dreallocatez2(len1,len2,rrax,info,pad,lb1,lb2) Subroutine psb_reallocatez2(len1,len2,rrax,info,pad,lb1,lb2)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len1,len2 Integer,Intent(in) :: len1,len2
@ -2217,7 +2404,7 @@ Contains
& lbi1, lbi2 & lbi1, lbi2
character(len=20) :: name character(len=20) :: name
name='psb_dreallocatez2' name='psb_reallocatez2'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (present(lb1)) then if (present(lb1)) then
@ -2291,10 +2478,10 @@ Contains
end if end if
return return
End Subroutine psb_dreallocatez2 End Subroutine psb_reallocatez2
Subroutine psb_dreallocatei2(len1,len2,rrax,info,pad,lb1,lb2) Subroutine psb_reallocatei2(len1,len2,rrax,info,pad,lb1,lb2)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len1,len2 Integer,Intent(in) :: len1,len2
@ -2309,7 +2496,98 @@ Contains
& lbi1, lbi2 & lbi1, lbi2
character(len=20) :: name character(len=20) :: name
name='psb_dreallocatei2' name='psb_reallocatei2'
call psb_erractionsave(err_act)
info=psb_success_
if (present(lb1)) then
lb1_ = lb1
else
lb1_ = 1
endif
if (present(lb2)) then
lb2_ = lb2
else
lb2_ = 1
endif
ub1_ = lb1_ + len1 -1
ub2_ = lb2_ + len2 -1
if (len1 < 0) then
err=4025
call psb_errpush(err,name,i_err=(/len1,0,0,0,0/),a_err='integer')
goto 9999
end if
if (len2 < 0) then
err=4025
call psb_errpush(err,name,i_err=(/len2,0,0,0,0/),a_err='integer')
goto 9999
end if
if (allocated(rrax)) then
dim = size(rrax,1)
lbi1 = lbound(rrax,1)
dim2 = size(rrax,2)
lbi2 = lbound(rrax,2)
If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)&
& .or.(lbi2 /= lb2_)) Then
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
call psb_errpush(err,name,i_err=(/len1*len2,0,0,0,0/),a_err='integer')
goto 9999
end if
tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = &
& rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2))
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
dim2 = 0
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
call psb_errpush(err,name,i_err=(/len1*len2,0,0,0,0/),a_err='integer')
goto 9999
end if
endif
if (present(pad)) then
rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad
rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad
endif
call psb_erractionrestore(err_act)
return
9999 continue
info = err
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error()
end if
return
End Subroutine psb_reallocatei2
#if !defined(LONG_INTEGERS)
Subroutine psb_reallocatei8_2(len1,len2,rrax,info,pad,lb1,lb2)
use psb_error_mod
! ...Subroutine Arguments
Integer,Intent(in) :: len1,len2
integer(psb_long_int_k_),allocatable :: rrax(:,:)
integer :: info
integer(psb_long_int_k_), optional, intent(in) :: pad
Integer,Intent(in), optional :: lb1,lb2
! ...Local Variables
integer(psb_long_int_k_),allocatable :: tmp(:,:)
Integer :: dim,err_act,err, dim2,lb1_, lb2_, ub1_, ub2_,&
& lbi1, lbi2
character(len=20) :: name
name='psb_reallocatei2'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
if (present(lb1)) then if (present(lb1)) then
@ -2382,9 +2660,10 @@ Contains
end if end if
return return
End Subroutine psb_dreallocatei2 End Subroutine psb_reallocatei8_2
#endif
Subroutine psb_dreallocate2i(len,rrax,y,info,pad) Subroutine psb_reallocate2i(len,rrax,y,info,pad)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
@ -2395,7 +2674,7 @@ Contains
character(len=20) :: name character(len=20) :: name
integer :: err_act, err integer :: err_act, err
name='psb_dreallocate2i' name='psb_reallocate2i'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
@ -2404,13 +2683,13 @@ Contains
goto 9999 goto 9999
end if end if
call psb_dreallocate1i(len,rrax,info,pad=pad) call psb_reallocate1i(len,rrax,info,pad=pad)
if (info /= psb_success_) then if (info /= psb_success_) then
err=4000 err=4000
call psb_errpush(err,name) call psb_errpush(err,name)
goto 9999 goto 9999
end if end if
call psb_dreallocate1i(len,y,info,pad=pad) call psb_reallocate1i(len,y,info,pad=pad)
if (info /= psb_success_) then if (info /= psb_success_) then
err=4000 err=4000
call psb_errpush(err,name) call psb_errpush(err,name)
@ -2429,12 +2708,12 @@ Contains
end if end if
return return
End Subroutine psb_dreallocate2i End Subroutine psb_reallocate2i
Subroutine psb_dreallocate2i1s(len,rrax,y,z,info) Subroutine psb_reallocate2i1s(len,rrax,y,z,info)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len Integer,Intent(in) :: len
@ -2445,7 +2724,7 @@ Contains
integer :: err_act, err integer :: err_act, err
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
name='psb_dreallocate2i1s' name='psb_reallocate2i1s'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
@ -2480,10 +2759,10 @@ Contains
call psb_error() call psb_error()
end if end if
return return
End Subroutine psb_dreallocate2i1s End Subroutine psb_reallocate2i1s
Subroutine psb_dreallocate2i1d(len,rrax,y,z,info) Subroutine psb_reallocate2i1d(len,rrax,y,z,info)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len Integer,Intent(in) :: len
@ -2493,7 +2772,7 @@ Contains
character(len=20) :: name character(len=20) :: name
integer :: err_act, err integer :: err_act, err
name='psb_dreallocate2i1d' name='psb_reallocate2i1d'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
@ -2528,11 +2807,11 @@ Contains
call psb_error() call psb_error()
end if end if
return return
End Subroutine psb_dreallocate2i1d End Subroutine psb_reallocate2i1d
Subroutine psb_dreallocate2i1c(len,rrax,y,z,info) Subroutine psb_reallocate2i1c(len,rrax,y,z,info)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len Integer,Intent(in) :: len
@ -2542,7 +2821,7 @@ Contains
character(len=20) :: name character(len=20) :: name
integer :: err_act, err integer :: err_act, err
name='psb_dreallocate2i1c' name='psb_reallocate2i1c'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
@ -2577,9 +2856,9 @@ Contains
call psb_error() call psb_error()
end if end if
return return
End Subroutine psb_dreallocate2i1c End Subroutine psb_reallocate2i1c
Subroutine psb_dreallocate2i1z(len,rrax,y,z,info) Subroutine psb_reallocate2i1z(len,rrax,y,z,info)
use psb_error_mod use psb_error_mod
! ...Subroutine Arguments ! ...Subroutine Arguments
Integer,Intent(in) :: len Integer,Intent(in) :: len
@ -2589,7 +2868,7 @@ Contains
character(len=20) :: name character(len=20) :: name
integer :: err_act, err integer :: err_act, err
name='psb_dreallocate2i1z' name='psb_reallocate2i1z'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info=psb_success_ info=psb_success_
@ -2623,7 +2902,7 @@ Contains
call psb_error() call psb_error()
end if end if
return return
End Subroutine psb_dreallocate2i1z End Subroutine psb_reallocate2i1z
Subroutine psb_smove_alloc1d(vin,vout,info) Subroutine psb_smove_alloc1d(vin,vout,info)
use psb_error_mod use psb_error_mod
@ -2632,8 +2911,25 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_smove_alloc1d end Subroutine psb_smove_alloc1d
Subroutine psb_smove_alloc2d(vin,vout,info) Subroutine psb_smove_alloc2d(vin,vout,info)
@ -2643,8 +2939,24 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1),&
& lbound(vin,2):ubound(vin,2)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_smove_alloc2d end Subroutine psb_smove_alloc2d
Subroutine psb_dmove_alloc1d(vin,vout,info) Subroutine psb_dmove_alloc1d(vin,vout,info)
@ -2654,8 +2966,25 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_dmove_alloc1d end Subroutine psb_dmove_alloc1d
Subroutine psb_dmove_alloc2d(vin,vout,info) Subroutine psb_dmove_alloc2d(vin,vout,info)
@ -2665,8 +2994,24 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1),&
& lbound(vin,2):ubound(vin,2)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_dmove_alloc2d end Subroutine psb_dmove_alloc2d
Subroutine psb_cmove_alloc1d(vin,vout,info) Subroutine psb_cmove_alloc1d(vin,vout,info)
@ -2676,8 +3021,22 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_cmove_alloc1d end Subroutine psb_cmove_alloc1d
Subroutine psb_cmove_alloc2d(vin,vout,info) Subroutine psb_cmove_alloc2d(vin,vout,info)
@ -2687,8 +3046,24 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1),&
& lbound(vin,2):ubound(vin,2)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_cmove_alloc2d end Subroutine psb_cmove_alloc2d
Subroutine psb_zmove_alloc1d(vin,vout,info) Subroutine psb_zmove_alloc1d(vin,vout,info)
@ -2698,8 +3073,22 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_zmove_alloc1d end Subroutine psb_zmove_alloc1d
Subroutine psb_zmove_alloc2d(vin,vout,info) Subroutine psb_zmove_alloc2d(vin,vout,info)
@ -2709,8 +3098,24 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1),&
& lbound(vin,2):ubound(vin,2)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_zmove_alloc2d end Subroutine psb_zmove_alloc2d
Subroutine psb_imove_alloc1d(vin,vout,info) Subroutine psb_imove_alloc1d(vin,vout,info)
@ -2720,7 +3125,23 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_imove_alloc1d end Subroutine psb_imove_alloc1d
Subroutine psb_imove_alloc2d(vin,vout,info) Subroutine psb_imove_alloc2d(vin,vout,info)
@ -2730,8 +3151,78 @@ Contains
! !
! !
info=psb_success_ info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout) call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1),&
& lbound(vin,2):ubound(vin,2)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_imove_alloc2d end Subroutine psb_imove_alloc2d
#if !defined(LONG_INTEGERS)
Subroutine psb_i8move_alloc1d(vin,vout,info)
use psb_error_mod
integer(psb_long_int_k_), allocatable, intent(inout) :: vin(:),vout(:)
integer, intent(out) :: info
!
!
info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_i8move_alloc1d
Subroutine psb_i8move_alloc2d(vin,vout,info)
use psb_error_mod
integer(psb_long_int_k_), allocatable, intent(inout) :: vin(:,:),vout(:,:)
integer, intent(out) :: info
!
!
info=psb_success_
#ifdef HAVE_MOVE_ALLOC
if (allocated(vin)) then
call move_alloc(vin,vout)
else if (allocated(vout)) then
deallocate(vout)
end if
#else
if (allocated(vout)) then
deallocate(vout,stat=info)
end if
if (.not.allocated(vin) ) return
allocate(vout(lbound(vin,1):ubound(vin,1),&
& lbound(vin,2):ubound(vin,2)),stat=info)
if (info /= psb_success_) return
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_i8move_alloc2d
#endif
end module psb_realloc_mod end module psb_realloc_mod

@ -3,7 +3,6 @@ include ../../Make.inc
#FCOPT=-O2 #FCOPT=-O2
OBJS= psb_ddot.o psb_damax.o psb_dasum.o psb_daxpby.o\ OBJS= psb_ddot.o psb_damax.o psb_dasum.o psb_daxpby.o\
psb_dnrm2.o psb_dnrmi.o psb_dspmm.o psb_dspsm.o\ psb_dnrm2.o psb_dnrmi.o psb_dspmm.o psb_dspsm.o\
pdtreecomb.o pstreecomb.o\
psb_zamax.o psb_zasum.o psb_zaxpby.o psb_zdot.o \ psb_zamax.o psb_zasum.o psb_zaxpby.o psb_zdot.o \
psb_znrm2.o psb_znrmi.o psb_zspmm.o psb_zspsm.o\ psb_znrm2.o psb_znrmi.o psb_zspmm.o psb_zspsm.o\
psb_saxpby.o psb_sdot.o psb_sasum.o psb_samax.o\ psb_saxpby.o psb_sdot.o psb_sasum.o psb_samax.o\

@ -1,396 +0,0 @@
C
C Parallel Sparse BLAS version 2.2
C (C) Copyright 2006/2007/2008
C Salvatore Filippone University of Rome Tor Vergata
C Alfredo Buttari University of Rome Tor Vergata
C
C Redistribution and use in source and binary forms, with or without
C modification, are permitted provided that the following conditions
C are met:
C 1. Redistributions of source code must retain the above copyright
C notice, this list of conditions and the following disclaimer.
C 2. Redistributions in binary form must reproduce the above copyright
C notice, this list of conditions, and the following disclaimer in the
C documentation and/or other materials provided with the distribution.
C 3. The name of the PSBLAS group or the names of its contributors may
C not be used to endorse or promote products derived from this
C software without specific written permission.
C
C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
C ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
C TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
C PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
C BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
C CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
C SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
C INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
C CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
C ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
C POSSIBILITY OF SUCH DAMAGE.
C
C
C
C This file imported from ScaLAPACK.
C
C
SUBROUTINE PDTREECOMB( ICTXT, SCOPE, N, MINE, RDEST0, CDEST0,
$ SUBPTR )
*
* -- ScaLAPACK tools routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
*
* .. Scalar Arguments ..
CHARACTER SCOPE
INTEGER CDEST0, ICTXT, N, RDEST0
* ..
* .. Array Arguments ..
DOUBLE PRECISION MINE( * )
* ..
* .. Subroutine Arguments ..
EXTERNAL SUBPTR
* ..
*
* Purpose
* == = ====
*
* PDTREECOMB does a 1-tree parallel combine operation on scalars,
* using the subroutine indicated by SUBPTR to perform the required
* computation.
*
* Arguments
* == = ======
*
* ICTXT (global input) INTEGER
* The BLACS context handle, indicating the global context of
* the operation. The context itself is global.
*
* SCOPE (global input) CHARACTER
* The scope of the operation: 'Rowwise', 'Columnwise', or
* 'All'.
*
* N (global input) INTEGER
* The number of elements in MINE. N = 1 for the norm-2
* computation and 2 for the sum of square.
*
* MINE (local input/global output) DOUBLE PRECISION array of
* dimension at least equal to N. The local data to use in the
* combine.
*
* RDEST0 (global input) INTEGER
* The process row to receive the answer. If RDEST0 = -1,
* every process in the scope gets the answer.
*
* CDEST0 (global input) INTEGER
* The process column to receive the answer. If CDEST0 = -1,
* every process in the scope gets the answer.
*
* SUBPTR (local input) Pointer to the subroutine to call to perform
* the required combine.
*
* == = ==================================================================
*
* .. Local Scalars ..
LOGICAL BCAST, RSCOPE, CSCOPE
INTEGER CMSSG, DEST, DIST, HISDIST, I, IAM, MYCOL,
$ MYROW, MYDIST, MYDIST2, NP, NPCOL, NPROW,
$ RMSSG, TCDEST, TRDEST
* ..
* .. Local Arrays ..
DOUBLE PRECISION HIS( 2 )
* ..
* .. External Subroutines ..
#if !defined(SERIAL_MPI)
EXTERNAL BLACS_GRIDINFO, DGEBR2D, DGEBS2D,
$ DGERV2D, DGESD2D
#endif
* ..
* .. External Functions ..
LOGICAL PSB_LSAME
EXTERNAL PSB_LSAME
* ..
* .. Intrinsic Functions ..
INTRINSIC MOD
* ..
* .. Executable Statements ..
*
* See if everyone wants the answer (need to broadcast the answer)
*
BCAST = ( ( RDEST0.EQ.-1 ).OR.( CDEST0.EQ.-1 ) )
IF( BCAST ) THEN
TRDEST = 0
TCDEST = 0
ELSE
TRDEST = RDEST0
TCDEST = CDEST0
END IF
#if !defined(SERIAL_MPI)
*
* Get grid parameters.
*
CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
*
* Figure scope-dependant variables, or report illegal scope
*
RSCOPE = PSB_LSAME( SCOPE, 'R' )
CSCOPE = PSB_LSAME( SCOPE, 'C' )
*
IF( RSCOPE ) THEN
IF( BCAST ) THEN
TRDEST = MYROW
ELSE IF( MYROW.NE.TRDEST ) THEN
RETURN
END IF
NP = NPCOL
MYDIST = MOD( NPCOL + MYCOL - TCDEST, NPCOL )
ELSE IF( CSCOPE ) THEN
IF( BCAST ) THEN
TCDEST = MYCOL
ELSE IF( MYCOL.NE.TCDEST ) THEN
RETURN
END IF
NP = NPROW
MYDIST = MOD( NPROW + MYROW - TRDEST, NPROW )
ELSE IF( PSB_LSAME( SCOPE, 'A' ) ) THEN
NP = NPROW * NPCOL
IAM = MYROW*NPCOL + MYCOL
DEST = TRDEST*NPCOL + TCDEST
MYDIST = MOD( NP + IAM - DEST, NP )
ELSE
RETURN
END IF
*
IF( NP.LT.2 )
$ RETURN
*
MYDIST2 = MYDIST
RMSSG = MYROW
CMSSG = MYCOL
I = 1
*
10 CONTINUE
*
IF( MOD( MYDIST, 2 ).NE.0 ) THEN
*
* If I am process that sends information
*
DIST = I * ( MYDIST - MOD( MYDIST, 2 ) )
*
* Figure coordinates of dest of message
*
IF( RSCOPE ) THEN
CMSSG = MOD( TCDEST + DIST, NP )
ELSE IF( CSCOPE ) THEN
RMSSG = MOD( TRDEST + DIST, NP )
ELSE
CMSSG = MOD( DEST + DIST, NP )
RMSSG = CMSSG / NPCOL
CMSSG = MOD( CMSSG, NPCOL )
END IF
*
CALL DGESD2D( ICTXT, N, 1, MINE, N, RMSSG, CMSSG )
*
GO TO 20
*
ELSE
*
* If I am a process receiving information, figure coordinates
* of source of message
*
DIST = MYDIST2 + I
IF( RSCOPE ) THEN
CMSSG = MOD( TCDEST + DIST, NP )
HISDIST = MOD( NP + CMSSG - TCDEST, NP )
ELSE IF( CSCOPE ) THEN
RMSSG = MOD( TRDEST + DIST, NP )
HISDIST = MOD( NP + RMSSG - TRDEST, NP )
ELSE
CMSSG = MOD( DEST + DIST, NP )
RMSSG = CMSSG / NPCOL
CMSSG = MOD( CMSSG, NPCOL )
HISDIST = MOD( NP + RMSSG*NPCOL+CMSSG - DEST, NP )
END IF
*
IF( MYDIST2.LT.HISDIST ) THEN
*
* If I have anyone sending to me
*
CALL DGERV2D( ICTXT, N, 1, HIS, N, RMSSG, CMSSG )
CALL SUBPTR( MINE, HIS )
*
END IF
MYDIST = MYDIST / 2
*
END IF
I = I * 2
*
IF( I.LT.NP )
$ GO TO 10
*
20 CONTINUE
*
IF( BCAST ) THEN
IF( MYDIST2.EQ.0 ) THEN
CALL DGEBS2D( ICTXT, SCOPE, ' ', N, 1, MINE, N )
ELSE
CALL DGEBR2D( ICTXT, SCOPE, ' ', N, 1, MINE, N,
$ TRDEST, TCDEST )
END IF
END IF
#endif
*
RETURN
*
* End of PDTREECOMB
*
END
*
SUBROUTINE DCOMBAMAX( V1, V2 )
*
* -- ScaLAPACK tools routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
*
* .. Array Arguments ..
DOUBLE PRECISION V1( 2 ), V2( 2 )
* ..
*
* Purpose
* == = ====
*
* DCOMBAMAX finds the element having max. absolute value as well
* as its corresponding globl index.
*
* Arguments
* == = ======
*
* V1 (local input/local output) DOUBLE PRECISION array of
* dimension 2. The first maximum absolute value element and
* its global index. V1(1) = AMAX, V1(2) = INDX.
*
* V2 (local input) DOUBLE PRECISION array of dimension 2.
* The second maximum absolute value element and its global
* index. V2(1) = AMAX, V2(2) = INDX.
*
* == = ==================================================================
*
* .. Intrinsic Functions ..
INTRINSIC ABS
* ..
* .. Executable Statements ..
*
IF( ABS( V1( 1 ) ).LT.ABS( V2( 1 ) ) ) THEN
V1( 1 ) = V2( 1 )
V1( 2 ) = V2( 2 )
END IF
*
RETURN
*
* End of DCOMBAMAX
*
END
*
SUBROUTINE DCOMBSSQ( V1, V2 )
*
* -- ScaLAPACK tools routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
*
* .. Array Arguments ..
DOUBLE PRECISION V1( 2 ), V2( 2 )
* ..
*
* Purpose
* == = ====
*
* DCOMBSSQ does a scaled sum of squares on two scalars.
*
* Arguments
* == = ======
*
* V1 (local input/local output) DOUBLE PRECISION array of
* dimension 2. The first scaled sum. V1(1) = SCALE,
* V1(2) = SUMSQ.
*
* V2 (local input) DOUBLE PRECISION array of dimension 2.
* The second scaled sum. V2(1) = SCALE, V2(2) = SUMSQ.
*
* == = ==================================================================
*
* .. Parameters ..
DOUBLE PRECISION ZERO
PARAMETER ( ZERO = 0.0D+0 )
* ..
* .. Executable Statements ..
*
IF( V1( 1 ).GE.V2( 1 ) ) THEN
IF( V1( 1 ).NE.ZERO )
$ V1( 2 ) = V1( 2 ) + ( V2( 1 ) / V1( 1 ) )**2 * V2( 2 )
ELSE
V1( 2 ) = V2( 2 ) + ( V1( 1 ) / V2( 1 ) )**2 * V1( 2 )
V1( 1 ) = V2( 1 )
END IF
*
RETURN
*
* End of DCOMBSSQ
*
END
*
SUBROUTINE DCOMBNRM2( X, Y )
*
* -- ScaLAPACK tools routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
*
* .. Scalar Arguments ..
DOUBLE PRECISION X, Y
* ..
*
* Purpose
* == = ====
*
* DCOMBNRM2 combines local norm 2 results, taking care not to cause
* unnecessary overflow.
*
* Arguments
* == = ======
*
* X (local input) DOUBLE PRECISION
* Y (local input) DOUBLE PRECISION
* X and Y specify the values x and y. X and Y are supposed to
* be >= 0.
*
* == = ==================================================================
*
* .. Parameters ..
DOUBLE PRECISION ONE, ZERO
PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
* ..
* .. Local Scalars ..
DOUBLE PRECISION W, Z
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN, SQRT
* ..
* .. Executable Statements ..
*
W = MAX( X, Y )
Z = MIN( X, Y )
*
IF( Z.EQ.ZERO ) THEN
X = W
ELSE
X = W*SQRT( ONE+( Z / W )**2 )
END IF
*
RETURN
*
* End of DCOMBNRM2
*
END

@ -45,7 +45,10 @@
! jx - integer(optional). The column offset for sub( X ). ! jx - integer(optional). The column offset for sub( X ).
! !
function psb_cnrm2(x, desc_a, info, jx) function psb_cnrm2(x, desc_a, info, jx)
use psb_sparse_mod, psb_protect_name => psb_cnrm2 use psb_descriptor_type
use psb_check_mod
use psb_error_mod
use psb_penv_mod
implicit none implicit none
complex(psb_spk_), intent(in) :: x(:,:) complex(psb_spk_), intent(in) :: x(:,:)
@ -59,7 +62,7 @@ function psb_cnrm2(x, desc_a, info, jx)
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm
real(psb_spk_) :: nrm2, scnrm2, dd real(psb_spk_) :: nrm2, scnrm2, dd
external scombnrm2 !!$ external scombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_cnrm2' name='psb_cnrm2'
@ -116,7 +119,8 @@ function psb_cnrm2(x, desc_a, info, jx)
nrm2 = dzero nrm2 = dzero
end if end if
call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2) !!$ call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_cnrm2 = nrm2 psb_cnrm2 = nrm2
@ -178,7 +182,10 @@ end function psb_cnrm2
! info - integer. Return code ! info - integer. Return code
! !
function psb_cnrm2v(x, desc_a, info) function psb_cnrm2v(x, desc_a, info)
use psb_sparse_mod, psb_protect_name => psb_cnrm2v use psb_descriptor_type
use psb_check_mod
use psb_error_mod
use psb_penv_mod
implicit none implicit none
complex(psb_spk_), intent(in) :: x(:) complex(psb_spk_), intent(in) :: x(:)
@ -191,7 +198,7 @@ function psb_cnrm2v(x, desc_a, info)
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_spk_) :: nrm2, scnrm2, dd real(psb_spk_) :: nrm2, scnrm2, dd
external scombnrm2 !!$ external scombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_cnrm2v' name='psb_cnrm2v'
@ -243,7 +250,8 @@ function psb_cnrm2v(x, desc_a, info)
nrm2 = dzero nrm2 = dzero
end if end if
call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2) !!$ call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_cnrm2v = nrm2 psb_cnrm2v = nrm2
@ -307,7 +315,10 @@ end function psb_cnrm2v
! info - integer. Return code ! info - integer. Return code
! !
subroutine psb_cnrm2vs(res, x, desc_a, info) subroutine psb_cnrm2vs(res, x, desc_a, info)
use psb_sparse_mod, psb_protect_name => psb_cnrm2vs use psb_descriptor_type
use psb_check_mod
use psb_error_mod
use psb_penv_mod
implicit none implicit none
complex(psb_spk_), intent(in) :: x(:) complex(psb_spk_), intent(in) :: x(:)
@ -320,7 +331,7 @@ subroutine psb_cnrm2vs(res, x, desc_a, info)
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_spk_) :: nrm2, scnrm2, dd real(psb_spk_) :: nrm2, scnrm2, dd
external scombnrm2 !!$ external scombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_cnrm2' name='psb_cnrm2'
@ -372,8 +383,8 @@ subroutine psb_cnrm2vs(res, x, desc_a, info)
nrm2 = dzero nrm2 = dzero
end if end if
call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2) !!$ call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2)
call psb_nrm2(ictxt,nrm2)
res = nrm2 res = nrm2
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)

@ -61,7 +61,7 @@ function psb_dnrm2(x, desc_a, info, jx)
integer :: ictxt, np, me,& integer :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm
real(psb_dpk_) :: nrm2, dnrm2, dd real(psb_dpk_) :: nrm2, dnrm2, dd
external dcombnrm2 !!$ external dcombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_dnrm2' name='psb_dnrm2'
@ -118,7 +118,8 @@ function psb_dnrm2(x, desc_a, info, jx)
nrm2 = dzero nrm2 = dzero
end if end if
call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2) !!$ call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_dnrm2 = nrm2 psb_dnrm2 = nrm2
@ -195,7 +196,7 @@ function psb_dnrm2v(x, desc_a, info)
integer :: ictxt, np, me,& integer :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_dpk_) :: nrm2, dnrm2, dd real(psb_dpk_) :: nrm2, dnrm2, dd
external dcombnrm2 !!$ external dcombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_dnrm2v' name='psb_dnrm2v'
@ -247,7 +248,8 @@ function psb_dnrm2v(x, desc_a, info)
nrm2 = dzero nrm2 = dzero
end if end if
call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2) !!$ call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_dnrm2v = nrm2 psb_dnrm2v = nrm2
@ -311,7 +313,10 @@ end function psb_dnrm2v
! info - integer. Return code ! info - integer. Return code
! !
subroutine psb_dnrm2vs(res, x, desc_a, info) subroutine psb_dnrm2vs(res, x, desc_a, info)
use psb_sparse_mod, psb_protect_name => psb_dnrm2vs use psb_descriptor_type
use psb_check_mod
use psb_error_mod
use psb_penv_mod
implicit none implicit none
real(psb_dpk_), intent(in) :: x(:) real(psb_dpk_), intent(in) :: x(:)
@ -323,7 +328,7 @@ subroutine psb_dnrm2vs(res, x, desc_a, info)
integer :: ictxt, np, me,& integer :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_dpk_) :: nrm2, dnrm2, dd real(psb_dpk_) :: nrm2, dnrm2, dd
external dcombnrm2 !!$ external dcombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_dnrm2' name='psb_dnrm2'
@ -375,7 +380,8 @@ subroutine psb_dnrm2vs(res, x, desc_a, info)
nrm2 = dzero nrm2 = dzero
end if end if
call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2) !!$ call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2)
call psb_nrm2(ictxt,nrm2)
res = nrm2 res = nrm2

@ -61,7 +61,7 @@ function psb_snrm2(x, desc_a, info, jx)
integer :: ictxt, np, me,& integer :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm
real(psb_spk_) :: nrm2, snrm2, dd real(psb_spk_) :: nrm2, snrm2, dd
external scombnrm2 !!$ external scombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_snrm2' name='psb_snrm2'
@ -118,7 +118,8 @@ function psb_snrm2(x, desc_a, info, jx)
nrm2 = szero nrm2 = szero
end if end if
call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2) !!$ call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_snrm2 = nrm2 psb_snrm2 = nrm2
@ -195,7 +196,7 @@ function psb_snrm2v(x, desc_a, info)
integer :: ictxt, np, me,& integer :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_spk_) :: nrm2, snrm2, dd real(psb_spk_) :: nrm2, snrm2, dd
external scombnrm2 !!$ external scombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_snrm2v' name='psb_snrm2v'
@ -247,7 +248,8 @@ function psb_snrm2v(x, desc_a, info)
nrm2 = szero nrm2 = szero
end if end if
call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2) !!$ call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_snrm2v = nrm2 psb_snrm2v = nrm2
@ -311,7 +313,10 @@ end function psb_snrm2v
! info - integer. Return code ! info - integer. Return code
! !
subroutine psb_snrm2vs(res, x, desc_a, info) subroutine psb_snrm2vs(res, x, desc_a, info)
use psb_sparse_mod, psb_protect_name => psb_snrm2vs use psb_descriptor_type
use psb_check_mod
use psb_error_mod
use psb_penv_mod
implicit none implicit none
real(psb_spk_), intent(in) :: x(:) real(psb_spk_), intent(in) :: x(:)
@ -323,7 +328,7 @@ subroutine psb_snrm2vs(res, x, desc_a, info)
integer :: ictxt, np, me,& integer :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_spk_) :: nrm2, snrm2, dd real(psb_spk_) :: nrm2, snrm2, dd
external scombnrm2 !!$ external scombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_snrm2' name='psb_snrm2'
@ -375,7 +380,8 @@ subroutine psb_snrm2vs(res, x, desc_a, info)
nrm2 = szero nrm2 = szero
end if end if
call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2) !!$ call pstreecomb(ictxt,'All',1,nrm2,-1,-1,scombnrm2)
call psb_nrm2(ictxt,nrm2)
res = nrm2 res = nrm2

@ -62,7 +62,7 @@ function psb_znrm2(x, desc_a, info, jx)
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm
real(psb_dpk_) :: nrm2, dznrm2, dd real(psb_dpk_) :: nrm2, dznrm2, dd
external dcombnrm2 !!$ external dcombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_znrm2' name='psb_znrm2'
@ -119,7 +119,8 @@ function psb_znrm2(x, desc_a, info, jx)
nrm2 = dzero nrm2 = dzero
end if end if
call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2) !!$ call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_znrm2 = nrm2 psb_znrm2 = nrm2
@ -197,7 +198,7 @@ function psb_znrm2v(x, desc_a, info)
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_dpk_) :: nrm2, dznrm2, dd real(psb_dpk_) :: nrm2, dznrm2, dd
external dcombnrm2 !!$ external dcombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_znrm2v' name='psb_znrm2v'
@ -249,7 +250,8 @@ function psb_znrm2v(x, desc_a, info)
nrm2 = dzero nrm2 = dzero
end if end if
call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2) !!$ call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2)
call psb_nrm2(ictxt,nrm2)
psb_znrm2v = nrm2 psb_znrm2v = nrm2
@ -313,7 +315,10 @@ end function psb_znrm2v
! info - integer. Return code ! info - integer. Return code
! !
subroutine psb_znrm2vs(res, x, desc_a, info) subroutine psb_znrm2vs(res, x, desc_a, info)
use psb_sparse_mod, psb_protect_name => psb_znrm2vs use psb_descriptor_type
use psb_check_mod
use psb_error_mod
use psb_penv_mod
implicit none implicit none
complex(psb_dpk_), intent(in) :: x(:) complex(psb_dpk_), intent(in) :: x(:)
@ -326,7 +331,7 @@ subroutine psb_znrm2vs(res, x, desc_a, info)
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm & err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm
real(psb_dpk_) :: nrm2, dznrm2, dd real(psb_dpk_) :: nrm2, dznrm2, dd
external dcombnrm2 !!$ external dcombnrm2
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_znrm2' name='psb_znrm2'
@ -378,7 +383,8 @@ subroutine psb_znrm2vs(res, x, desc_a, info)
nrm2 = dzero nrm2 = dzero
end if end if
call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2) !!$ call pdtreecomb(ictxt,'All',1,nrm2,-1,-1,dcombnrm2)
call psb_nrm2(ictxt,nrm2)
res = nrm2 res = nrm2

@ -1,396 +0,0 @@
C
C Parallel Sparse BLAS version 2.2
C (C) Copyright 2006/2007/2008
C Salvatore Filippone University of Rome Tor Vergata
C Alfredo Buttari University of Rome Tor Vergata
C
C Redistribution and use in source and binary forms, with or without
C modification, are permitted provided that the following conditions
C are met:
C 1. Redistributions of source code must retain the above copyright
C notice, this list of conditions and the following disclaimer.
C 2. Redistributions in binary form must reproduce the above copyright
C notice, this list of conditions, and the following disclaimer in the
C documentation and/or other materials provided with the distribution.
C 3. The name of the PSBLAS group or the names of its contributors may
C not be used to endorse or promote products derived from this
C software without specific written permission.
C
C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
C ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
C TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
C PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
C BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
C CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
C SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
C INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
C CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
C ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
C POSSIBILITY OF SUCH DAMAGE.
C
C
C
C This file imported from ScaLAPACK.
C
C
SUBROUTINE PSTREECOMB( ICTXT, SCOPE, N, MINE, RDEST0, CDEST0,
$ SUBPTR )
*
* -- ScaLAPACK tools routine (version 1.5) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* May 1, 1997
*
* .. Scalar Arguments ..
CHARACTER SCOPE
INTEGER CDEST0, ICTXT, N, RDEST0
* ..
* .. Array Arguments ..
REAL MINE( * )
* ..
* .. Subroutine Arguments ..
EXTERNAL SUBPTR
* ..
*
* Purpose
* == = ====
*
* PSTREECOMB does a 1-tree parallel combine operation on scalars,
* using the subroutine indicated by SUBPTR to perform the required
* computation.
*
* Arguments
* == = ======
*
* ICTXT (global input) INTEGER
* The BLACS context handle, indicating the global context of
* the operation. The context itself is global.
*
* SCOPE (global input) CHARACTER
* The scope of the operation: 'Rowwise', 'Columnwise', or
* 'All'.
*
* N (global input) INTEGER
* The number of elements in MINE. N = 1 for the norm-2
* computation and 2 for the sum of square.
*
* MINE (local input/global output) REAL array of
* dimension at least equal to N. The local data to use in the
* combine.
*
* RDEST0 (global input) INTEGER
* The process row to receive the answer. If RDEST0 = -1,
* every process in the scope gets the answer.
*
* CDEST0 (global input) INTEGER
* The process column to receive the answer. If CDEST0 = -1,
* every process in the scope gets the answer.
*
* SUBPTR (local input) Pointer to the subroutine to call to perform
* the required combine.
*
* == = ==================================================================
*
* .. Local Scalars ..
LOGICAL BCAST, RSCOPE, CSCOPE
INTEGER CMSSG, DEST, DIST, HISDIST, I, IAM, MYCOL,
$ MYROW, MYDIST, MYDIST2, NP, NPCOL, NPROW,
$ RMSSG, TCDEST, TRDEST
* ..
* .. Local Arrays ..
REAL HIS( 2 )
* ..
* .. External Subroutines ..
#if !defined(SERIAL_MPI)
EXTERNAL BLACS_GRIDINFO, SGEBR2D, SGEBS2D,
$ SGERV2D, SGESD2D
#endif
* ..
* .. External Functions ..
LOGICAL PSB_LSAME
EXTERNAL PSB_LSAME
* ..
* .. Intrinsic Functions ..
INTRINSIC MOD
* ..
* .. Executable Statements ..
*
* See if everyone wants the answer (need to broadcast the answer)
*
BCAST = ( ( RDEST0.EQ.-1 ).OR.( CDEST0.EQ.-1 ) )
IF( BCAST ) THEN
TRDEST = 0
TCDEST = 0
ELSE
TRDEST = RDEST0
TCDEST = CDEST0
END IF
#if !defined(SERIAL_MPI)
*
* Get grid parameters.
*
CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
*
* Figure scope-dependant variables, or report illegal scope
*
RSCOPE = PSB_LSAME( SCOPE, 'R' )
CSCOPE = PSB_LSAME( SCOPE, 'C' )
*
IF( RSCOPE ) THEN
IF( BCAST ) THEN
TRDEST = MYROW
ELSE IF( MYROW.NE.TRDEST ) THEN
RETURN
END IF
NP = NPCOL
MYDIST = MOD( NPCOL + MYCOL - TCDEST, NPCOL )
ELSE IF( CSCOPE ) THEN
IF( BCAST ) THEN
TCDEST = MYCOL
ELSE IF( MYCOL.NE.TCDEST ) THEN
RETURN
END IF
NP = NPROW
MYDIST = MOD( NPROW + MYROW - TRDEST, NPROW )
ELSE IF( PSB_LSAME( SCOPE, 'A' ) ) THEN
NP = NPROW * NPCOL
IAM = MYROW*NPCOL + MYCOL
DEST = TRDEST*NPCOL + TCDEST
MYDIST = MOD( NP + IAM - DEST, NP )
ELSE
RETURN
END IF
*
IF( NP.LT.2 )
$ RETURN
*
MYDIST2 = MYDIST
RMSSG = MYROW
CMSSG = MYCOL
I = 1
*
10 CONTINUE
*
IF( MOD( MYDIST, 2 ).NE.0 ) THEN
*
* If I am process that sends information
*
DIST = I * ( MYDIST - MOD( MYDIST, 2 ) )
*
* Figure coordinates of dest of message
*
IF( RSCOPE ) THEN
CMSSG = MOD( TCDEST + DIST, NP )
ELSE IF( CSCOPE ) THEN
RMSSG = MOD( TRDEST + DIST, NP )
ELSE
CMSSG = MOD( DEST + DIST, NP )
RMSSG = CMSSG / NPCOL
CMSSG = MOD( CMSSG, NPCOL )
END IF
*
CALL SGESD2D( ICTXT, N, 1, MINE, N, RMSSG, CMSSG )
*
GO TO 20
*
ELSE
*
* If I am a process receiving information, figure coordinates
* of source of message
*
DIST = MYDIST2 + I
IF( RSCOPE ) THEN
CMSSG = MOD( TCDEST + DIST, NP )
HISDIST = MOD( NP + CMSSG - TCDEST, NP )
ELSE IF( CSCOPE ) THEN
RMSSG = MOD( TRDEST + DIST, NP )
HISDIST = MOD( NP + RMSSG - TRDEST, NP )
ELSE
CMSSG = MOD( DEST + DIST, NP )
RMSSG = CMSSG / NPCOL
CMSSG = MOD( CMSSG, NPCOL )
HISDIST = MOD( NP + RMSSG*NPCOL+CMSSG - DEST, NP )
END IF
*
IF( MYDIST2.LT.HISDIST ) THEN
*
* If I have anyone sending to me
*
CALL SGERV2D( ICTXT, N, 1, HIS, N, RMSSG, CMSSG )
CALL SUBPTR( MINE, HIS )
*
END IF
MYDIST = MYDIST / 2
*
END IF
I = I * 2
*
IF( I.LT.NP )
$ GO TO 10
*
20 CONTINUE
*
IF( BCAST ) THEN
IF( MYDIST2.EQ.0 ) THEN
CALL SGEBS2D( ICTXT, SCOPE, ' ', N, 1, MINE, N )
ELSE
CALL SGEBR2D( ICTXT, SCOPE, ' ', N, 1, MINE, N,
$ TRDEST, TCDEST )
END IF
END IF
#endif
*
RETURN
*
* End of PSTREECOMB
*
END
*
SUBROUTINE SCOMBAMAX( V1, V2 )
*
* -- ScaLAPACK tools routine (version 1.5) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* May 1, 1997
*
* .. Array Arguments ..
REAL V1( 2 ), V2( 2 )
* ..
*
* Purpose
* == = ====
*
* SCOMBAMAX finds the element having max. absolute value as well
* as its corresponding globl index.
*
* Arguments
* == = ======
*
* V1 (local input/local output) REAL array of
* dimension 2. The first maximum absolute value element and
* its global index. V1(1) = AMAX, V1(2) = INDX.
*
* V2 (local input) REAL array of dimension 2.
* The second maximum absolute value element and its global
* index. V2(1) = AMAX, V2(2) = INDX.
*
* == = ==================================================================
*
* .. Intrinsic Functions ..
INTRINSIC ABS
* ..
* .. Executable Statements ..
*
IF( ABS( V1( 1 ) ).LT.ABS( V2( 1 ) ) ) THEN
V1( 1 ) = V2( 1 )
V1( 2 ) = V2( 2 )
END IF
*
RETURN
*
* End of SCOMBAMAX
*
END
*
SUBROUTINE SCOMBSSQ( V1, V2 )
*
* -- ScaLAPACK tools routine (version 1.5) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* May 1, 1997
*
* .. Array Arguments ..
REAL V1( 2 ), V2( 2 )
* ..
*
* Purpose
* == = ====
*
* SCOMBSSQ does a scaled sum of squares on two scalars.
*
* Arguments
* == = ======
*
* V1 (local input/local output) REAL array of
* dimension 2. The first scaled sum. V1(1) = SCALE,
* V1(2) = SUMSQ.
*
* V2 (local input) REAL array of dimension 2.
* The second scaled sum. V2(1) = SCALE, V2(2) = SUMSQ.
*
* == = ==================================================================
*
* .. Parameters ..
REAL ZERO
PARAMETER ( ZERO = 0.0E+0 )
* ..
* .. Executable Statements ..
*
IF( V1( 1 ).GE.V2( 1 ) ) THEN
IF( V1( 1 ).NE.ZERO )
$ V1( 2 ) = V1( 2 ) + ( V2( 1 ) / V1( 1 ) )**2 * V2( 2 )
ELSE
V1( 2 ) = V2( 2 ) + ( V1( 1 ) / V2( 1 ) )**2 * V1( 2 )
V1( 1 ) = V2( 1 )
END IF
*
RETURN
*
* End of SCOMBSSQ
*
END
*
SUBROUTINE SCOMBNRM2( X, Y )
*
* -- ScaLAPACK tools routine (version 1.5) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* May 1, 1997
*
* .. Scalar Arguments ..
REAL X, Y
* ..
*
* Purpose
* == = ====
*
* SCOMBNRM2 combines local norm 2 results, taking care not to cause
* unnecessary overflow.
*
* Arguments
* == = ======
*
* X (local input) REAL
* Y (local input) REAL
* X and Y specify the values x and y. X and Y are supposed to
* be >= 0.
*
* == = ==================================================================
*
* .. Parameters ..
REAL ONE, ZERO
PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
* ..
* .. Local Scalars ..
REAL W, Z
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN, SQRT
* ..
* .. Executable Statements ..
*
W = MAX( X, Y )
Z = MIN( X, Y )
*
IF( Z.EQ.ZERO ) THEN
X = W
ELSE
X = W*SQRT( ONE+( Z / W )**2 )
END IF
*
RETURN
*
* End of SCOMBNRM2
*
END

1036
configure vendored

File diff suppressed because it is too large Load Diff

@ -605,16 +605,16 @@ PAC_LAPACK(
############################################################################### ###############################################################################
# BLACS library presence checks # BLACS library presence checks
############################################################################### ###############################################################################
AC_LANG([C]) #AC_LANG([C])
if test x"$pac_cv_serial_mpi" == x"no" ; then #if test x"$pac_cv_serial_mpi" == x"no" ; then
save_FC="$FC"; #save_FC="$FC";
save_CC="$CC"; #save_CC="$CC";
FC="$MPIFC"; #FC="$MPIFC";
CC="$MPICC"; #CC="$MPICC";
PAC_CHECK_BLACS #PAC_CHECK_BLACS
FC="$save_FC"; #FC="$save_FC";
CC="$save_CC"; #CC="$save_CC";
fi #fi
PAC_MAKE_IS_GNUMAKE PAC_MAKE_IS_GNUMAKE
@ -705,7 +705,7 @@ AC_SUBST(INSTALL_INCLUDEDIR)
AC_SUBST(INSTALL_DOCSDIR) AC_SUBST(INSTALL_DOCSDIR)
AC_SUBST(BLAS_LIBS) AC_SUBST(BLAS_LIBS)
AC_SUBST(BLACS_LIBS) #AC_SUBST(BLACS_LIBS)
AC_SUBST(METIS_LIBS) AC_SUBST(METIS_LIBS)
AC_SUBST(LAPACK_LIBS) AC_SUBST(LAPACK_LIBS)
@ -714,7 +714,7 @@ AC_SUBST(FINCLUDES)
if test "X$psblas_make_gnumake" == "Xyes" ; then if test "X$psblas_make_gnumake" == "Xyes" ; then
PSBLASRULES=' PSBLASRULES='
PSBLDLIBS=$(BLACS) $(LAPACK) $(BLAS) $(METIS_LIB) $(LIBS) PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(LIBS)
CDEFINES=$(PSBCDEFINES) CDEFINES=$(PSBCDEFINES)
FDEFINES=$(PSBFDEFINES) FDEFINES=$(PSBFDEFINES)
# Warning : these rules are only valid with GNU make! # Warning : these rules are only valid with GNU make!
@ -752,7 +752,7 @@ $(.mod).o:
else else
PSBLASRULES=' PSBLASRULES='
PSBLDLIBS=$(BLACS) $(LAPACK) $(BLAS) $(METIS_LIB) $(LIBS) PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(LIBS)
CDEFINES=$(PSBCDEFINES) CDEFINES=$(PSBCDEFINES)
FDEFINES=$(PSBFDEFINES) FDEFINES=$(PSBFDEFINES)
@ -828,7 +828,7 @@ dnl FCFLAGS : ${FCFLAGS}
dnl ESSL/PESSL : ${psblas_cv_have_essl} / ${psblas_cv_have_pessl} dnl ESSL/PESSL : ${psblas_cv_have_essl} / ${psblas_cv_have_pessl}
BLAS : ${BLAS_LIBS} BLAS : ${BLAS_LIBS}
BLACS : ${BLACS_LIBS} dnl BLACS : ${BLACS_LIBS}
METIS detected : ${psblas_cv_have_metis} METIS detected : ${psblas_cv_have_metis}
dnl SuperLU detected : ${psblas_cv_have_superlu} dnl SuperLU detected : ${psblas_cv_have_superlu}

Loading…
Cancel
Save