Changelog
 LICENSE
 Make.inc.in
 README
 base/Makefile
 base/internals/psi_bld_tmphalo.f90
 base/internals/psi_bld_tmpovrl.f90
 base/internals/psi_crea_bnd_elem.f90
 base/internals/psi_crea_index.f90
 base/internals/psi_crea_ovr_elem.f90
 base/internals/psi_fnd_owner.F90
 base/modules/Makefile
 base/modules/psb_base_mod.f90
 base/modules/psb_desc_type.f90
 base/modules/psb_hash_mod.f90
 base/modules/psb_linmap_mod.f90
 base/modules/psb_linmap_type_mod.f90
 base/modules/psb_penv_mod.F90
 base/modules/psb_psblas_mod.f90
 base/modules/psb_realloc_mod.F90
 base/modules/psb_serial_mod.f90
 base/modules/psb_sort_mod.f90
 base/modules/psb_spmat_type.f03
 base/modules/psb_spmat_type.f90
 base/modules/psb_tools_mod.f90
 base/modules/psi_mod.f90
 base/psblas/Makefile
 base/psblas/psb_cspmm.f90
 base/psblas/psb_dspmm.f90
 base/psblas/psb_sspmm.f90
 base/psblas/psb_zspmm.f90
 base/serial/Makefile
 base/serial/aux/Makefile
 base/serial/psb_ccoins.f90
 base/serial/psb_ccsprt.f90
 base/serial/psb_cgelp.f90
 base/serial/psb_cipcoo2csc.f90
 base/serial/psb_cipcoo2csr.f90
 base/serial/psb_cipcsr2coo.f90
 base/serial/psb_cneigh.f90
 base/serial/psb_ctransc.f90
 base/serial/psb_ctransp.f90
 base/serial/psb_dcoins.f90
 base/serial/psb_dcsmm.f90
 base/serial/psb_dcsprt.f90
 base/serial/psb_dcsrp.f90
 base/serial/psb_dgelp.f90
 base/serial/psb_dipcoo2csc.f90
 base/serial/psb_dipcoo2csr.f90
 base/serial/psb_dipcsr2coo.f90
 base/serial/psb_dneigh.f90
 base/serial/psb_dtransp.f90
 base/serial/psb_getrow_mod.f90
 base/serial/psb_scoins.f90
 base/serial/psb_scsnmi.f90
 base/serial/psb_scsprt.f90
 base/serial/psb_sgelp.f90
 base/serial/psb_sipcoo2csc.f90
 base/serial/psb_sipcoo2csr.f90
 base/serial/psb_sipcsr2coo.f90
 base/serial/psb_sneigh.f90
 base/serial/psb_stransp.f90
 base/serial/psb_update_mod.f90
 base/serial/psb_zcoins.f90
 base/serial/psb_zcsprt.f90
 base/serial/psb_zcsrp.f90
 base/serial/psb_zgelp.f90
 base/serial/psb_zipcoo2csc.f90
 base/serial/psb_zipcoo2csr.f90
 base/serial/psb_zipcsr2coo.f90
 base/serial/psb_zneigh.f90
 base/serial/psb_ztransc.f90
 base/serial/psb_ztransp.f90
 base/tools/Makefile
 base/tools/psb_ccdbldext.F90
 base/tools/psb_cd_lstext.f90
 base/tools/psb_cd_reinit.f90
 base/tools/psb_cdals.f90
 base/tools/psb_cdren.f90
 base/tools/psb_dcdbldext.F90
 base/tools/psb_icdasb.F90
 base/tools/psb_inter_desc.f90
 base/tools/psb_linmap.f90
 base/tools/psb_map.f90
 base/tools/psb_scdbldext.F90
 base/tools/psb_zcdbldext.F90
 config/pac.m4
 configure.ac
 configure
 krylov/psb_scgstab.F90
 prec/psb_cdiagsc_bld.f90
 prec/psb_cprc_aply.f90
 prec/psb_cprecbld.f90
 prec/psb_ddiagsc_bld.f90
 prec/psb_dprc_aply.f90
 prec/psb_dprecbld.f90
 prec/psb_sdiagsc_bld.f90
 prec/psb_sprc_aply.f90
 prec/psb_sprecbld.f90
 prec/psb_zdiagsc_bld.f90
 prec/psb_zprc_aply.f90
 prec/psb_zprecbld.f90
 test/fileread/cf_sample.f90
 test/fileread/df_sample.f90
 test/fileread/sf_sample.f90
 test/fileread/zf_sample.f90
 test/pargen/ppde.f90
 test/pargen/runs/ppde.inp
 test/pargen/spde.f90
 util/psb_mat_dist_mod.f90

psblas3: 
first batch of changes to accommodate NAG compiler. Now the real work
is about to start...
psblas3-type-indexed
Salvatore Filippone 16 years ago
parent 9765e4a4ae
commit 8766c1003b

@ -1,6 +1,381 @@
2008/09/18: Defined psb_sizeof to be integer(8). Added support
into psb_sum, psb_amx and other reductions for long int
scalars.
2008/09/16: Implemented new scheme for index conversion.
Changed cdall with an option to suppress global checks.
2008/09/02: Improved psi_fnd_owner performace.
2008/09/01: Better timings in the pargen test cases.
2008/08/28: Changed CDALL in case of VL to handle overlapped indices.
2008/07/28: New sorting/reordering modules.
2008/07/24: Addded HTML version of user's guide.
2008/07/22: Fixed I/O for Harwell-Boeing and Matrix Market examples
2008/05/27: Merged single precision branch.
2008/04/28: Fixed trimming space in sparse matrix conversion.
Fixed performance issue in cdins.
2008/03/25: Fix performance bug in psi_idx_ins_cnv. Changed names of
some internal components of preconditioner data structure.
=======
2009/01/27: Renamed psb_transfer into psb_move_alloc.
2009/01/08: Require GNU Fortran 4.3 or later.
2008/11/04: Repackaged and streamlined linear maps.
2008/10/16: Fixed internal structure of psb_inter_desc.
2008/09/23: Fix borderline cases where one process does not own any
indices from the global space.
2008/09/18: Defined psb_sizeof to be integer(8). Added support
into psb_sum, psb_amx and other reductions for long int
scalars.
2008/09/16: Implemented new scheme for index conversion.
Changed cdall with an option to suppress global checks.
2008/09/02: Improved psi_fnd_owner performace.
2008/09/01: Better timings in the pargen test cases.
2008/08/28: Changed CDALL in case of VL to handle overlapped indices.
2008/07/28: New sorting/reordering modules.
2008/07/24: Addded HTML version of user's guide.
2008/07/22: Fixed I/O for Harwell-Boeing and Matrix Market examples
2008/05/27: Merged single precision branch.
2008/04/28: Fixed trimming space in sparse matrix conversion.
Fixed performance issue in cdins.
2008/03/25: Fix performance bug in psi_idx_ins_cnv. Changed names of
some internal components of preconditioner data structure.
>>>>>>> .merge-dx.r3587
2008/03/27: Merged the experimental branch for implementing the AVL tree
data structure in Fortran instead of relying on C and passing
functions around to perform comparisons. There seems to be
some performance advantage, although not very large.
2008/03/25: Merged in changes from the 2.2-maint branch re: error
messages, performance bug in psi_idx_ins_cnv.
2008/02/26: New psb_linmap_init, psb_linmap_ins, psb_linmap_asb for a
general linear operator mapping among index spaces.
2008/02/18: Branched off for Version 2.2
2008/02/08: Merged changes from intermesh branch: we now have an
inter_desc_type object. Currently we only implement the
version needed for aggregation algorithms in the algebraic
multigrid preconditioners, but we'll define more general
(linear) maps soon enough.
2008/01/25: Various changes to variables controlling conditional
compilation on the Fortran side: removed NETLIB_BLACS, now
HAVE_METIS HAVE_ESSL_BLACS HAVE_KSENDID.
Files impacted: Make.inc.XXX, base/modules/psb_penv_mod,
util/psb_metispart_mod
2008/01/18: Centralized convergence checks. Still partial for RGMRES.
2008/01/14: Merged changes for handling of transpose vs. overlap.
2008/01/10: Changed name of GMRESR into RGMRES for consistency.
2007/12/21: Merged in debug infrastructure, internal and html docs.
2007/11/14: Fix INTENT(IN) on X vector in preconditioner routines.
2007/10/15: Repackaged the sorting routines in a submodule of their
own, adding some heap management and heapsort utilities for the
benefit of the multilevel preconditioners.
2007/09/28: Moved gelp and csrp to serial. Changed interface to
sphalo: the new one makes more sense.
Updated documentation.
2007/09/14: Second round of serial changes: merged into trunk, fixed
JAD regeneration and srch_upd now works.
2007/09/10: First round of serial changes: implemented serial
psb_spcnv unifying multiple functionalities.
2007/09/04: Implemented RGMRES for complex data.
2007/06/04: Fixed implementation of fctint and coins: assume size
arrays caused troubles on some compilers. Documentation of
set_large_threshold.
2007/05/22: Defined psb_precinit.
2007/05/15: Defined psb_sizeof.
2007/05/15: Merged in various fixes coming from tests on SP5 and
HP-Itanium.
2007/04/08: Changed the implementation of psb_sp_getrow & friends.
2007/03/27: Merged in changes for enabling compilation on SUN.
2007/02/22: Fixed various misalignments between real and complex.
Defined new psb_sp_clip routines.
Fixed psb_rwextd.
Changed the USE statements, minimizing size of modules and
maximizing consistency checks.
2007/02/01: Merged serial version: we provide a minimal fake mpi to
allow compiling and running without mpi and blacs. Only
tested with gnu42 so far.
2007/01/23: Defined new field ext_index in desc_type, and
fixed long standing inconsistency in usage of overlap for
AS preconditioners. Modified halo to accept selector for
halo_index vs. ext_index.
2007/01/11: Migrated repository to SVN.
2007/01/11: MLD2P4 has been moved to the new org. Now tackling the
test dirs.
2007/01/09: First try at reorganizing directories. Subdir MLD2P4 still
to be fixed. Documentation still to be updated.
2006/12/11: Documented options in glob_to_loc.
2006/12/06: Fixed raw aggregation.
2006/12/05: Taken out extra interfaces; inserted use modules with ONLY
clauses where appropriate.
2006/11/30: Fixed a bug in raw aggregation. Note: raw aggregation
gives different results from smoothed with omega=0.0,
because in the latter we have explicitly stored zero
coefficients that would be absent in the first, thus
generating different ILU factorizations.
2006/11/28: Merged the mods for descriptors of large index spaces to
avoid having the GLOB_TO_LOC array. Took the chance to
reorganize the descriptor build routines and define some
access functions for descriptor features and entries, so
as not to use the descriptor components directly. Tested
with AS, 2- and 3- level Post smoothers.
2006/11/09: The allocatable version works, but under gcc42 there is a
compiler bug when using -fbounds-check.
2006/11/08: Merged the allocatable version; hope everything works!
2006/11/08: Branched version psblas2-2-0-maint, and defined tag
2.0.2.6
2006/11/02: Done in the allocatable branch: repackaging of cdasb and
friends, taking out AVL trees where they were not
absolutely needed, and new dcsrmv routine.
2006/11/01: Merged changes in the handling of data exchange.
2006/10/03: Merged in the multilevel preconditioner stuff. This is
still experimental, especially the interfaces are not
stable yet.
2006/10/03: Declared version 2.0.2.5 for reference purposes.
2006/10/03: Fixed a bunch of minor bugs, incuding the sorting routines
imsr and imsrx. Added a default call to blacs_exit inside
psb_exit fixed a bad termination in test/pargen/ppde90.f90
2006/09/02: Declared version 2.0.2, after having fixed a lot of
details in the environment routines.
2006/07/25: Defined a new psb_wtime function. Modified precset to
have a non-optional INFO dummy argument.
2006/07/06: Fixed bug in swaptran. Added psb_krylov generic interface.
2006/07/04: Ooops, the GetRow mod in SMMP is a performance hit.
Need to investigate further.
2006/06/21: Bug fix in hb_read when dealing with symmetric matrices.
2006/06/20: Rewritten symbmm and numbmm from SMMP to be intependent of
CSR storage by using GetRow. Still need to test for
performance.
2006/06/16: Defined GetRow. This way we may close the mat objects.
Next we will rewrite SMMP to only make use of GetRow,
not to rely on CSR storage format.
2006/05/29: Added BLACS-like routines for data communication,
broadcasts, reductions, send/receive.
2006/05/25: Added environment management routines.
2006/05/03: Bug fixes, plus some change in the internals for SPINS,
preparing hooks for insertion with local numbering.
2006/04/24: Minor changes to the interface of dense tools routines,
trying to achieve a uniform look & feel.
Rewritten documentation; it is now reasonable, though not
perfect, except for the preconditioner routines.
We can now declare RC3.
2006/04/21: A bunch of fixes related to various matrix initialization
problems that were revealed while testing on SP5.
2006/04/18: Changed interface to spasb and csdp: better handling of
regeneration. To be tested further for sophisticated uses.
2006/03/31: We declare RC2 now. Improved I/O routines in test/Fileread.
2006/03/24: We have a complex version now, working (not necessarily bug free).
2006/03/15: Started move to complex version.
2006/03/01: Complete restructure of PREC section.
2006/02/01: New naming scheme.
2006/01/01: New multilevel preconditioning wih smoothed aggregation.
2005/09 : Now enabled UMFPACK complete factorization as basis for AS.
2005/05/04: Now enabled SuperLU complete factorization as basis for AS.
2005/04/29: First version with decoupled 2-level.
2005/04/06: Started work on decoupling the preconditioner aggregation
for 2-level from the main factorization.
2005/03/30: First version of new DSC/SP allocate/insert/assembly
routines.
2005/03/17: First version of RGMRES. To be refined.
2005/03/08: dSwapTran aligned with dSwapData. Taken out SwapOverlap.
also moved onto iSwapX.
2005/03/07: dSwapData rewritten to achieve: 1. better performance;
2. more flexible functionality. It is now possible to
avoid SwapOvrlap entirely, relying on just SwapData.
SwapTran is still alive, since it reads the descriptors in
"transpose" mode. Also, added work areas to preconditioner
routine, to avoid excessive allocation in the halo/overlap
exchange.
2005/03/04: Had to put in a workaround for a gfortran bug:
tolower/toupper cannot be functions.
2005/02/09: Explicit storage choice for the smoother. This seems
to be changing a little bit the actual preconditioner.
To be evaluated further.
2005/02/08: Renamed F90_PSPREC to PSB_PRCAPLY and Preconditioner to
PSB_PRCBLD. Changed the way PRCAPLY decides what to do.
Still needs a PSB_PRCSET to be called before PRCBLD.
2005/01/28: Started moving functionalities to a SERIAL F90 layer. Also
defined a new COMM layer, to enable implementing SPMM
directly in F90.
2005/01/20: Finally taken out a direct call to the F77 DCSDP from
SPASB.
2005/01/18: After much work, we now have 2-level Additive Schwarz
prototype implemented and working. We now start a major
code cleanup that will take some time. Mainly we want to
move a lot of the serial F77 functionality into a new F95
serial layer, to simplify the parallel F95 code.
2004/11/25: Following the introduction of Additive Shwarz and
variants, we have now renamed DECOMP_ and friends as
DESC_; this makes things more readable. Sooner or later
we're going to merge this into mainline, but this version
is still very much in a state of flux.
2004/07/18: For use with gfortran we need to declare the pointer
components with NULL() initialization. This rules out
VAST and PGI.
2004/07/15: First development version with gfortran from the current
snapshot of gcc 3.5.0.
It is now possible in PSI_dSwapData to opt for
SEND|RECEIVE|SYNC data exchange; plan is to extend to all
data exchange functions, plus making it available as an
option from the F90 level.
2004/07/06: Merged in a lot of stuff coming mainly from the ASM
development; full merge will have to wait a little more.
Among other things:
use of psimod
new choice parms for overlap
new data exchange for swapdata, to be extended.
multicolumn CSMM.
use psrealloc
new format for marking a matrix as suitable for update.
2003/12/09: Changed DSALLOC and DSASB to make sure whenever a dense
matrix is allocated it is also zeroed out.
2003/10/13: Added call to BLACS_SET in the solvers to ensure global
heterogeneous coherence in the combine operations.
2003/09/30: Added LOC_TO_GLOB and GLOB_TO_LOC support routines.
2003/09/30: Changed interface for smart update capabilities: choose
with optional parameters in ASB routines.
2003/09/16: IFC 7.0 had a strange behaviour in the test programs:
sometimes the declaration of PARTS dummy argument with an
INTERFACE would not work, requiring an EXTERNAL
declaration. The proper INTERFACE works now with 7.1.
2003/03/10: Halo data exchange in F90_PSHALO can now be applied to
integer data; create appropriate support routines.
2002/12/05: Initial version of Fileread sample programs.
2002/11/19: Fixes for JAD preconditioner.
2002/11/19: Methods for patterns: create a descriptor without a
matrix.
2001/11/16: Reviewed the interfaces: in the tools section we really
need the POINTER attribute for dense vectors, but not in
the computational routines; taking it out allows more
flexibility.
2001/09/16: Smart update capabilities.
2001/03/16: Renumbering routines.
2001/01/14: Added extensions to compute multiple DOTs and AMAXs at once;
=======
Changelog. A lot less detailed than usual, at least for past
history.
2009/01/27: Renamed psb_transfer into psb_move_alloc.
2009/01/08: Require GNU Fortran 4.3 or later.
2008/11/04: Repackaged and streamlined linear maps.
2008/10/16: Fixed internal structure of psb_inter_desc.
2008/09/23: Fix borderline cases where one process does not own any
indices from the global space.
2008/09/18: Defined psb_sizeof to be integer(8). Added support
into psb_sum, psb_amx and other reductions for long int
scalars.
@ -328,3 +703,4 @@ history.
2001/01/14: Added extensions to compute multiple DOTs and AMAXs at once;
>>>>>>> .merge-dx.r3592

@ -1,5 +1,6 @@
Parallel Sparse BLAS v2.3
(C) Copyright 2006/2007/2008
Parallel Sparse BLAS v 3.0
(C) Copyright 2006/2007/2008/2009/2010
Salvatore Filippone University of Rome Tor Vergata
Alfredo Buttari University of Rome Tor Vergata

@ -1,4 +1,3 @@
# This is Make.inc file generated automatically by the PSBLAS configure script.
# It should be ready to use, included by Makefile.
# If it gives problems, consider editing it.
@ -21,6 +20,7 @@ FCOPT=@FCOPT@
CCOPT=@CCOPT@
FMFLAG=@FMFLAG@
FIFLAG=@FIFLAG@
EXTRA_OPT=@EXTRA_OPT@
# These three should be always set!
MPF90=@MPF90@

@ -1,4 +1,4 @@
This directory contains the PSBLAS library, version 2.3
This directory contains the PSBLAS library, version 3.0
Version 1.0 of the library was described in:
@ -16,16 +16,6 @@ compiling with other compiler/operating systems please let us know.
LINUX:
On Linux we work with the GCC compiler; note that we require version
4.2.0 (or later) as it contains support for ALLOCATABLEs (as
specified in TR15581).
For the Intel compilers, we recommend version 9.1 or later.
IBM SP:
The library has been tested on an IBM SP5, with XLC and XLF
version 10.1 and the IBM ESSL/PESSL versions of the BLAS and the
BLACS.
UTILITIES
@ -149,4 +139,4 @@ Dario Pascucci
k

@ -5,7 +5,7 @@ LIBDIR=../lib
LIBNAME=$(BASELIBNAME)
LIBMOD=psb_base_mod$(.mod)
lib:
(cd modules; make lib LIBNAME=$(BASELIBNAME))
(cd modules; make lib LIBNAME=$(BASELIBNAME) F90=$(MPF90) F90COPT="$(F90COPT) $(MPI_OPT)")
(cd comm; make lib LIBNAME=$(BASELIBNAME))
(cd internals; make lib LIBNAME=$(BASELIBNAME))
(cd tools; make lib LIBNAME=$(BASELIBNAME))
@ -24,4 +24,3 @@ clean:
veryclean: clean
/bin/rm -f $(HERE)/$(LIBNAME) $(LIBMOD) *$(.mod)

@ -133,7 +133,7 @@ subroutine psi_bld_tmphalo(desc,info)
lhalo = j
nhalo = (lhalo-1)/3
call psb_transfer(tmphl,desc%halo_index,info)
call psb_move_alloc(tmphl,desc%halo_index,info)
call psb_erractionrestore(err_act)
return

@ -136,8 +136,8 @@ subroutine psi_bld_tmpovrl(iv,desc,info)
enddo
l_ov_ix = l_ov_ix + 1
ov_idx(l_ov_ix) = -1
call psb_transfer(ov_idx,desc%ovrlap_index,info)
if (info == 0) call psb_transfer(ov_el,desc%ovrlap_elem,info)
call psb_move_alloc(ov_idx,desc%ovrlap_index,info)
if (info == 0) call psb_move_alloc(ov_el,desc%ovrlap_elem,info)
call psb_erractionrestore(err_act)

@ -52,7 +52,7 @@ subroutine psi_crea_bnd_elem(bndel,desc_a,info)
implicit none
integer, allocatable :: bndel(:)
type(psb_desc_type) :: desc_a
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, allocatable :: work(:)
@ -86,7 +86,7 @@ subroutine psi_crea_bnd_elem(bndel,desc_a,info)
call psb_msort_unique(work(1:i),j)
if (.true.) then
if (j>0) then
if (j>=0) then
call psb_realloc(j,bndel,info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='Allocate')

@ -64,7 +64,7 @@ subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info,nxch,nsnd,nrcv
integer, intent(in) :: index_in(:)
integer, allocatable :: index_out(:)
integer, allocatable, intent(inout) :: index_out(:)
logical :: glob_idx
! ....local scalars...

@ -134,7 +134,7 @@ subroutine psi_crea_ovr_elem(me,desc_overlap,ovr_elem,info)
nel = ix
call psb_realloc(nel,3,telem,info)
call psb_transfer(telem,ovr_elem,info)
call psb_move_alloc(telem,ovr_elem,info)
call psb_erractionrestore(err_act)
return

@ -74,7 +74,7 @@ subroutine psi_fnd_owner(nv,idx,iprc,desc,info)
integer :: i,n_row,n_col,err_act,ih,icomm,hsize,ip,isz,k,j,&
& last_ih, last_j
integer :: ictxt,np,me
logical, parameter :: gettime=.true.
logical, parameter :: gettime=.false.
real(psb_dpk_) :: t0, t1, t2, t3, t4, tamx, tidx
character(len=20) :: name
@ -237,7 +237,7 @@ subroutine psi_fnd_owner(nv,idx,iprc,desc,info)
do
if (j > size(answers,1)) then
! Last resort attempt.
call ibsrch(j,ih,size(answers,1),answers(:,1))
j = psb_ibsrch(ih,size(answers,1),answers(:,1))
if (j == -1) then
write(0,*) me,'psi_fnd_owner: searching for ',ih, &
& 'not found : ',size(answers,1),':',answers(:,1)
@ -249,7 +249,7 @@ subroutine psi_fnd_owner(nv,idx,iprc,desc,info)
if (answers(j,1) == ih) exit
if (answers(j,1) > ih) then
k = j
call ibsrch(j,ih,k,answers(1:k,1))
j = psb_ibsrch(ih,k,answers(1:k,1))
if (j == -1) then
write(0,*) me,'psi_fnd_owner: searching for ',ih, &
& 'not found : ',size(answers,1),':',answers(:,1)

@ -1,22 +1,21 @@
include ../../Make.inc
MODULES = psb_realloc_mod.o psb_string_mod.o psb_spmat_type.o \
psb_desc_type.o psb_sort_mod.o\
psb_desc_type.o psb_sort_mod.o psb_penv_mod.o \
psb_serial_mod.o psb_tools_mod.o psb_blacs_mod.o \
psb_error_mod.o psb_const_mod.o psb_inter_desc_type.o \
psb_error_mod.o psb_const_mod.o psb_linmap_type_mod.o \
psb_comm_mod.o psb_psblas_mod.o psi_serial_mod.o psi_mod.o \
psb_check_mod.o psb_gps_mod.o psb_inter_desc_mod.o psb_hash_mod.o
psb_check_mod.o psb_gps_mod.o psb_linmap_mod.o psb_hash_mod.o
LIBMOD=psb_base_mod$(.mod)
MPFOBJS=psb_penv_mod.o
OBJS = error.o psb_base_mod.o $(EXTRA_COBJS) cutil.o
LIBDIR=..
CINCLUDES=-I.
FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG).
lib: mpfobjs $(MODULES) $(OBJS) $(LIBMOD)
lib: blacsmod $(MODULES) $(OBJS) $(LIBMOD)
$(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME)
/bin/cp -p $(LIBMOD) $(LIBDIR)
@ -28,22 +27,23 @@ psb_error_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
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
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
psb_desc_type.o: psb_const_mod.o psb_error_mod.o psb_penv_mod.o psb_realloc_mod.o psb_hash_mod.o
psb_inter_desc_type.o: psb_desc_type.o psb_spmat_type.o psb_error_mod.o psb_serial_mod.o psb_comm_mod.o
psb_inter_desc_mod.o: psb_inter_desc_type.o
psb_linmap_mod.o: psb_linmap_type_mod.o
psb_linmap_type_mod.o: psb_desc_type.o psb_spmat_type.o psb_error_mod.o psb_serial_mod.o psb_comm_mod.o
psb_check_mod.o: psb_desc_type.o
psb_serial_mod.o: psb_spmat_type.o psb_string_mod.o psb_sort_mod.o psi_serial_mod.o
psb_sort_mod.o: psb_error_mod.o psb_realloc_mod.o psb_const_mod.o
psb_methd_mod.o: psb_serial_mod.o psb_desc_type.o psb_prec_type.o
psb_tools_mod.o: psb_spmat_type.o psb_desc_type.o psi_mod.o psb_gps_mod.o psb_inter_desc_mod.o
psb_tools_mod.o: psb_spmat_type.o psb_desc_type.o psi_mod.o psb_gps_mod.o psb_linmap_mod.o
psb_gps_mod.o: psb_realloc_mod.o
psb_hash_mod.o: psb_const_mod.o psb_realloc_mod.o
psb_base_mod.o: $(MODULES)
mpfobjs:
(make $(MPFOBJS) F90="$(MPF90)" FC="$(MPF90)" FCOPT="$(F90COPT)")
blacsmod:
(make psb_blacs_mod.o F90COPT="$(F90COPT) $(EXTRA_OPT)")
clean:
/bin/rm -f $(MODULES) $(OBJS) $(MPFOBJS) *$(.mod)

@ -35,15 +35,10 @@ module psb_base_mod
use psb_penv_mod
use psb_check_mod
use psb_descriptor_type
use psb_inter_desc_mod
use psb_linmap_mod
use psb_serial_mod
use psb_comm_mod
use psb_psblas_mod
use psb_gps_mod
use psb_tools_mod
end module psb_base_mod

@ -359,7 +359,7 @@ module psb_descriptor_type
end interface
interface psb_transfer
interface psb_move_alloc
module procedure psb_cdtransfer, psb_idxmap_transfer
end interface
@ -988,36 +988,29 @@ contains
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
ictxt=psb_cd_get_context(desc_in)
! Should not require ictxt to be present: this
! function might be called even when desc_in is
! empty.
call psb_info(ictxt, me, np)
if (debug_level >= psb_debug_outer_)&
& write(debug_unit,*) me,' ',trim(name),': start.'
if (np == -1) then
info = 2010
call psb_errpush(info,name)
goto 9999
endif
call psb_transfer( desc_in%matrix_data , desc_out%matrix_data , info)
call psb_move_alloc( desc_in%matrix_data , desc_out%matrix_data , info)
if (info == 0) &
& call psb_transfer( desc_in%halo_index , desc_out%halo_index , info)
& call psb_move_alloc( desc_in%halo_index , desc_out%halo_index , info)
if (info == 0) &
& call psb_transfer( desc_in%bnd_elem , desc_out%bnd_elem , info)
& call psb_move_alloc( desc_in%bnd_elem , desc_out%bnd_elem , info)
if (info == 0) &
& call psb_transfer( desc_in%ovrlap_elem , desc_out%ovrlap_elem , info)
& call psb_move_alloc( desc_in%ovrlap_elem , desc_out%ovrlap_elem , info)
if (info == 0) &
& call psb_transfer( desc_in%ovrlap_index, desc_out%ovrlap_index , info)
& call psb_move_alloc( desc_in%ovrlap_index, desc_out%ovrlap_index , info)
if (info == 0) &
& call psb_transfer( desc_in%ovr_mst_idx , desc_out%ovr_mst_idx , info)
& call psb_move_alloc( desc_in%ovr_mst_idx , desc_out%ovr_mst_idx , info)
if (info == 0) &
& call psb_transfer( desc_in%ext_index , desc_out%ext_index , info)
& call psb_move_alloc( desc_in%ext_index , desc_out%ext_index , info)
if (info == 0) &
& call psb_transfer( desc_in%lprm , desc_out%lprm , info)
& call psb_move_alloc( desc_in%lprm , desc_out%lprm , info)
if (info == 0) &
& call psb_transfer( desc_in%idx_space , desc_out%idx_space , info)
& call psb_move_alloc( desc_in%idx_space , desc_out%idx_space , info)
if (info == 0) &
& call psb_transfer(desc_in%idxmap, desc_out%idxmap,info)
& call psb_move_alloc(desc_in%idxmap, desc_out%idxmap,info)
if (info /= 0) then
info = 4010
call psb_errpush(info,name)
@ -1035,7 +1028,7 @@ contains
if (err_act == psb_act_ret_) then
return
else
call psb_error(ictxt)
call psb_error()
end if
return
@ -1072,15 +1065,15 @@ contains
map_out%hashvmask = map_in%hashvmask
if (info == 0) &
& call psb_transfer( map_in%loc_to_glob , map_out%loc_to_glob , info)
& call psb_move_alloc( map_in%loc_to_glob , map_out%loc_to_glob , info)
if (info == 0) &
& call psb_transfer( map_in%glob_to_loc , map_out%glob_to_loc , info)
& call psb_move_alloc( map_in%glob_to_loc , map_out%glob_to_loc , info)
if (info == 0) &
& call psb_transfer( map_in%hashv , map_out%hashv , info)
& call psb_move_alloc( map_in%hashv , map_out%hashv , info)
if (info == 0) &
& call psb_transfer( map_in%glb_lc , map_out%glb_lc , info)
& call psb_move_alloc( map_in%glb_lc , map_out%glb_lc , info)
if (info == 0) &
& call psb_transfer( map_in%hash , map_out%hash , info)
& call psb_move_alloc( map_in%hash , map_out%hash , info)
if (info /= 0) then
info = 4010
@ -1270,6 +1263,7 @@ contains
end subroutine psb_map_l2g_v2
Subroutine psb_cd_get_recv_idx(tmp,desc,data,info,toglob)
use psb_error_mod

@ -72,7 +72,7 @@ module psb_hash_mod
end interface
interface psb_transfer
interface psb_move_alloc
module procedure HashTransfer
end interface
@ -149,7 +149,7 @@ contains
hashout%nk = hashin%nk
hashout%nsrch = hashin%nsrch
hashout%nacc = hashin%nacc
call psb_transfer(hashin%table, hashout%table,info)
call psb_move_alloc(hashin%table, hashout%table,info)
end subroutine HashTransfer

@ -0,0 +1,661 @@
!!$
!!$ Parallel Sparse BLAS version 2.2
!!$ (C) Copyright 2006/2007/2008
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! package: psb_linmap_mod
! Defines facilities for mapping between vectors belonging
! to different spaces.
!
module psb_linmap_mod
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type, &
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_, psb_sizeof
use psb_descriptor_type
use psb_linmap_type_mod
interface psb_map_X2Y
subroutine psb_s_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_slinmap_type), intent(in) :: map
real(psb_spk_), intent(in) :: alpha,beta
real(psb_spk_), intent(inout) :: x(:)
real(psb_spk_), intent(out) :: y(:)
integer, intent(out) :: info
real(psb_spk_), optional :: work(:)
end subroutine psb_s_map_X2Y
subroutine psb_d_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_dlinmap_type), intent(in) :: map
real(psb_dpk_), intent(in) :: alpha,beta
real(psb_dpk_), intent(inout) :: x(:)
real(psb_dpk_), intent(out) :: y(:)
integer, intent(out) :: info
real(psb_dpk_), optional :: work(:)
end subroutine psb_d_map_X2Y
subroutine psb_c_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_clinmap_type), intent(in) :: map
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(inout) :: x(:)
complex(psb_spk_), intent(out) :: y(:)
integer, intent(out) :: info
complex(psb_spk_), optional :: work(:)
end subroutine psb_c_map_X2Y
subroutine psb_z_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_zlinmap_type), intent(in) :: map
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(inout) :: x(:)
complex(psb_dpk_), intent(out) :: y(:)
integer, intent(out) :: info
complex(psb_dpk_), optional :: work(:)
end subroutine psb_z_map_X2Y
end interface
interface psb_map_Y2X
subroutine psb_s_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_slinmap_type), intent(in) :: map
real(psb_spk_), intent(in) :: alpha,beta
real(psb_spk_), intent(inout) :: x(:)
real(psb_spk_), intent(out) :: y(:)
integer, intent(out) :: info
real(psb_spk_), optional :: work(:)
end subroutine psb_s_map_Y2X
subroutine psb_d_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_dlinmap_type), intent(in) :: map
real(psb_dpk_), intent(in) :: alpha,beta
real(psb_dpk_), intent(inout) :: x(:)
real(psb_dpk_), intent(out) :: y(:)
integer, intent(out) :: info
real(psb_dpk_), optional :: work(:)
end subroutine psb_d_map_Y2X
subroutine psb_c_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_clinmap_type), intent(in) :: map
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(inout) :: x(:)
complex(psb_spk_), intent(out) :: y(:)
integer, intent(out) :: info
complex(psb_spk_), optional :: work(:)
end subroutine psb_c_map_Y2X
subroutine psb_z_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_linmap_type_mod
implicit none
type(psb_zlinmap_type), intent(in) :: map
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(inout) :: x(:)
complex(psb_dpk_), intent(out) :: y(:)
integer, intent(out) :: info
complex(psb_dpk_), optional :: work(:)
end subroutine psb_z_map_Y2X
end interface
interface psb_is_ok_map
module procedure psb_is_ok_slinmap, psb_is_ok_dlinmap, &
& psb_is_ok_clinmap, psb_is_ok_zlinmap
end interface
interface psb_get_map_kind
module procedure psb_get_smap_kind, psb_get_dmap_kind, &
& psb_get_cmap_kind, psb_get_zmap_kind
end interface
interface psb_set_map_kind
module procedure psb_set_smap_kind, psb_set_dmap_kind, &
& psb_set_cmap_kind, psb_set_zmap_kind
end interface
interface psb_is_asb_map
module procedure psb_is_asb_slinmap, psb_is_asb_dlinmap, &
& psb_is_asb_clinmap, psb_is_asb_zlinmap
end interface
interface psb_linmap_sub
module procedure psb_s_linmap_sub, psb_d_linmap_sub, &
& psb_c_linmap_sub, psb_z_linmap_sub
end interface
interface psb_move_alloc
module procedure psb_slinmap_transfer, psb_dlinmap_transfer, &
& psb_clinmap_transfer, psb_zlinmap_transfer
end interface
interface psb_linmap
function psb_s_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_slinmap_type) :: psb_s_linmap
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_sspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
end function psb_s_linmap
function psb_d_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_dlinmap_type) :: psb_d_linmap
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_dspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
end function psb_d_linmap
function psb_c_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_clinmap_type) :: psb_c_linmap
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_cspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
end function psb_c_linmap
function psb_z_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_zlinmap_type) :: psb_z_linmap
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_zspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
end function psb_z_linmap
end interface
interface psb_sizeof
module procedure psb_slinmap_sizeof, psb_dlinmap_sizeof, &
& psb_clinmap_sizeof, psb_zlinmap_sizeof
end interface
contains
function psb_get_smap_kind(map)
implicit none
type(psb_slinmap_type), intent(in) :: map
Integer :: psb_get_smap_kind
if (allocated(map%itd_data)) then
psb_get_smap_kind = map%itd_data(psb_map_kind_)
else
psb_get_smap_kind = -1
end if
end function psb_get_smap_kind
function psb_get_dmap_kind(map)
implicit none
type(psb_dlinmap_type), intent(in) :: map
Integer :: psb_get_dmap_kind
if (allocated(map%itd_data)) then
psb_get_dmap_kind = map%itd_data(psb_map_kind_)
else
psb_get_dmap_kind = -1
end if
end function psb_get_dmap_kind
function psb_get_cmap_kind(map)
implicit none
type(psb_clinmap_type), intent(in) :: map
Integer :: psb_get_cmap_kind
if (allocated(map%itd_data)) then
psb_get_cmap_kind = map%itd_data(psb_map_kind_)
else
psb_get_cmap_kind = -1
end if
end function psb_get_cmap_kind
function psb_get_zmap_kind(map)
implicit none
type(psb_zlinmap_type), intent(in) :: map
Integer :: psb_get_zmap_kind
if (allocated(map%itd_data)) then
psb_get_zmap_kind = map%itd_data(psb_map_kind_)
else
psb_get_zmap_kind = -1
end if
end function psb_get_zmap_kind
subroutine psb_set_smap_kind(map_kind,map)
implicit none
integer, intent(in) :: map_kind
type(psb_slinmap_type), intent(inout) :: map
map%itd_data(psb_map_kind_) = map_kind
end subroutine psb_set_smap_kind
subroutine psb_set_dmap_kind(map_kind,map)
implicit none
integer, intent(in) :: map_kind
type(psb_dlinmap_type), intent(inout) :: map
map%itd_data(psb_map_kind_) = map_kind
end subroutine psb_set_dmap_kind
subroutine psb_set_cmap_kind(map_kind,map)
implicit none
integer, intent(in) :: map_kind
type(psb_clinmap_type), intent(inout) :: map
map%itd_data(psb_map_kind_) = map_kind
end subroutine psb_set_cmap_kind
subroutine psb_set_zmap_kind(map_kind,map)
implicit none
integer, intent(in) :: map_kind
type(psb_zlinmap_type), intent(inout) :: map
map%itd_data(psb_map_kind_) = map_kind
end subroutine psb_set_zmap_kind
function psb_is_asb_slinmap(map) result(this)
implicit none
type(psb_slinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_asb_desc(map%p_desc_X).and.psb_is_asb_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_asb_desc(map%desc_X).and.psb_is_asb_desc(map%desc_Y)
end select
end function psb_is_asb_slinmap
function psb_is_asb_dlinmap(map) result(this)
implicit none
type(psb_dlinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_asb_desc(map%p_desc_X).and.psb_is_asb_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_asb_desc(map%desc_X).and.psb_is_asb_desc(map%desc_Y)
end select
end function psb_is_asb_dlinmap
function psb_is_asb_clinmap(map) result(this)
implicit none
type(psb_clinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_asb_desc(map%p_desc_X).and.psb_is_asb_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_asb_desc(map%desc_X).and.psb_is_asb_desc(map%desc_Y)
end select
end function psb_is_asb_clinmap
function psb_is_asb_zlinmap(map) result(this)
implicit none
type(psb_zlinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_asb_desc(map%p_desc_X).and.psb_is_asb_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_asb_desc(map%desc_X).and.psb_is_asb_desc(map%desc_Y)
end select
end function psb_is_asb_zlinmap
function psb_is_ok_slinmap(map) result(this)
implicit none
type(psb_slinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_ok_desc(map%p_desc_X).and.psb_is_ok_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_ok_desc(map%desc_X).and.psb_is_ok_desc(map%desc_Y)
end select
end function psb_is_ok_slinmap
function psb_is_ok_dlinmap(map) result(this)
implicit none
type(psb_dlinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_ok_desc(map%p_desc_X).and.psb_is_ok_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_ok_desc(map%desc_X).and.psb_is_ok_desc(map%desc_Y)
end select
end function psb_is_ok_dlinmap
function psb_is_ok_clinmap(map) result(this)
implicit none
type(psb_clinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_ok_desc(map%p_desc_X).and.psb_is_ok_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_ok_desc(map%desc_X).and.psb_is_ok_desc(map%desc_Y)
end select
end function psb_is_ok_clinmap
function psb_is_ok_zlinmap(map) result(this)
implicit none
type(psb_zlinmap_type), intent(in) :: map
logical :: this
this = .false.
if (.not.allocated(map%itd_data)) return
select case(psb_get_map_kind(map))
case (psb_map_aggr_)
if (.not.associated(map%p_desc_X)) return
if (.not.associated(map%p_desc_Y)) return
this = &
& psb_is_ok_desc(map%p_desc_X).and.psb_is_ok_desc(map%p_desc_Y)
case(psb_map_gen_linear_)
this = &
& psb_is_ok_desc(map%desc_X).and.psb_is_ok_desc(map%desc_Y)
end select
end function psb_is_ok_zlinmap
function psb_slinmap_sizeof(map) result(val)
implicit none
type(psb_slinmap_type), intent(in) :: map
integer(psb_long_int_k_) :: val
val = 0
if (allocated(map%itd_data)) &
& val = val + psb_sizeof_int*size(map%itd_data)
if (allocated(map%iaggr)) &
& val = val + psb_sizeof_int*size(map%iaggr)
if (allocated(map%naggr)) &
& val = val + psb_sizeof_int*size(map%naggr)
val = val + psb_sizeof(map%desc_X)
val = val + psb_sizeof(map%desc_Y)
val = val + psb_sizeof(map%map_X2Y)
val = val + psb_sizeof(map%map_Y2X)
end function psb_slinmap_sizeof
function psb_dlinmap_sizeof(map) result(val)
implicit none
type(psb_dlinmap_type), intent(in) :: map
integer(psb_long_int_k_) :: val
val = 0
if (allocated(map%itd_data)) &
& val = val + psb_sizeof_int*size(map%itd_data)
if (allocated(map%iaggr)) &
& val = val + psb_sizeof_int*size(map%iaggr)
if (allocated(map%naggr)) &
& val = val + psb_sizeof_int*size(map%naggr)
val = val + psb_sizeof(map%desc_X)
val = val + psb_sizeof(map%desc_Y)
val = val + psb_sizeof(map%map_X2Y)
val = val + psb_sizeof(map%map_Y2X)
end function psb_dlinmap_sizeof
function psb_clinmap_sizeof(map) result(val)
implicit none
type(psb_clinmap_type), intent(in) :: map
integer(psb_long_int_k_) :: val
val = 0
if (allocated(map%itd_data)) &
& val = val + psb_sizeof_int*size(map%itd_data)
if (allocated(map%iaggr)) &
& val = val + psb_sizeof_int*size(map%iaggr)
if (allocated(map%naggr)) &
& val = val + psb_sizeof_int*size(map%naggr)
val = val + psb_sizeof(map%desc_X)
val = val + psb_sizeof(map%desc_Y)
val = val + psb_sizeof(map%map_X2Y)
val = val + psb_sizeof(map%map_Y2X)
end function psb_clinmap_sizeof
function psb_zlinmap_sizeof(map) result(val)
implicit none
type(psb_zlinmap_type), intent(in) :: map
integer(psb_long_int_k_) :: val
val = 0
if (allocated(map%itd_data)) &
& val = val + psb_sizeof_int*size(map%itd_data)
if (allocated(map%iaggr)) &
& val = val + psb_sizeof_int*size(map%iaggr)
if (allocated(map%naggr)) &
& val = val + psb_sizeof_int*size(map%naggr)
val = val + psb_sizeof(map%desc_X)
val = val + psb_sizeof(map%desc_Y)
val = val + psb_sizeof(map%map_X2Y)
val = val + psb_sizeof(map%map_Y2X)
end function psb_zlinmap_sizeof
subroutine psb_s_linmap_sub(out_map,map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_slinmap_type), intent(out) :: out_map
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_sspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
out_map = psb_linmap(map_kind,desc_X,desc_Y,map_X2Y,map_Y2X,iaggr,naggr)
end subroutine psb_s_linmap_sub
subroutine psb_d_linmap_sub(out_map,map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_dlinmap_type), intent(out) :: out_map
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_dspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
out_map = psb_linmap(map_kind,desc_X,desc_Y,map_X2Y,map_Y2X,iaggr,naggr)
end subroutine psb_d_linmap_sub
subroutine psb_c_linmap_sub(out_map,map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_clinmap_type), intent(out) :: out_map
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_cspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
out_map = psb_linmap(map_kind,desc_X,desc_Y,map_X2Y,map_Y2X,iaggr,naggr)
end subroutine psb_c_linmap_sub
subroutine psb_z_linmap_sub(out_map,map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr)
use psb_linmap_type_mod
implicit none
type(psb_zlinmap_type), intent(out) :: out_map
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_zspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
out_map = psb_linmap(map_kind,desc_X,desc_Y,map_X2Y,map_Y2X,iaggr,naggr)
end subroutine psb_z_linmap_sub
subroutine psb_slinmap_transfer(mapin,mapout,info)
use psb_spmat_type
use psb_descriptor_type
implicit none
type(psb_slinmap_type) :: mapin,mapout
integer, intent(out) :: info
call psb_move_alloc(mapin%itd_data,mapout%itd_data,info)
call psb_move_alloc(mapin%iaggr,mapout%iaggr,info)
call psb_move_alloc(mapin%naggr,mapout%naggr,info)
mapout%p_desc_X => mapin%p_desc_X
mapin%p_desc_X => null()
mapout%p_desc_Y => mapin%p_desc_Y
mapin%p_desc_Y => null()
call psb_move_alloc(mapin%desc_X,mapout%desc_X,info)
call psb_move_alloc(mapin%desc_Y,mapout%desc_Y,info)
call psb_move_alloc(mapin%map_X2Y,mapout%map_X2Y,info)
call psb_move_alloc(mapin%map_Y2X,mapout%map_Y2X,info)
end subroutine psb_slinmap_transfer
subroutine psb_dlinmap_transfer(mapin,mapout,info)
use psb_spmat_type
use psb_descriptor_type
implicit none
type(psb_dlinmap_type) :: mapin,mapout
integer, intent(out) :: info
call psb_move_alloc(mapin%itd_data,mapout%itd_data,info)
call psb_move_alloc(mapin%iaggr,mapout%iaggr,info)
call psb_move_alloc(mapin%naggr,mapout%naggr,info)
mapout%p_desc_X => mapin%p_desc_X
mapin%p_desc_X => null()
mapout%p_desc_Y => mapin%p_desc_Y
mapin%p_desc_Y => null()
call psb_move_alloc(mapin%desc_X,mapout%desc_X,info)
call psb_move_alloc(mapin%desc_Y,mapout%desc_Y,info)
call psb_move_alloc(mapin%map_X2Y,mapout%map_X2Y,info)
call psb_move_alloc(mapin%map_Y2X,mapout%map_Y2X,info)
end subroutine psb_dlinmap_transfer
subroutine psb_clinmap_transfer(mapin,mapout,info)
use psb_spmat_type
use psb_descriptor_type
implicit none
type(psb_clinmap_type) :: mapin,mapout
integer, intent(out) :: info
call psb_move_alloc(mapin%itd_data,mapout%itd_data,info)
call psb_move_alloc(mapin%iaggr,mapout%iaggr,info)
call psb_move_alloc(mapin%naggr,mapout%naggr,info)
mapout%p_desc_X => mapin%p_desc_X
mapin%p_desc_X => null()
mapout%p_desc_Y => mapin%p_desc_Y
mapin%p_desc_Y => null()
call psb_move_alloc(mapin%desc_X,mapout%desc_X,info)
call psb_move_alloc(mapin%desc_Y,mapout%desc_Y,info)
call psb_move_alloc(mapin%map_X2Y,mapout%map_X2Y,info)
call psb_move_alloc(mapin%map_Y2X,mapout%map_Y2X,info)
end subroutine psb_clinmap_transfer
subroutine psb_zlinmap_transfer(mapin,mapout,info)
use psb_spmat_type
use psb_descriptor_type
implicit none
type(psb_zlinmap_type) :: mapin,mapout
integer, intent(out) :: info
call psb_move_alloc(mapin%itd_data,mapout%itd_data,info)
call psb_move_alloc(mapin%iaggr,mapout%iaggr,info)
call psb_move_alloc(mapin%naggr,mapout%naggr,info)
mapout%p_desc_X => mapin%p_desc_X
mapin%p_desc_X => null()
mapout%p_desc_Y => mapin%p_desc_Y
mapin%p_desc_Y => null()
call psb_move_alloc(mapin%desc_X,mapout%desc_X,info)
call psb_move_alloc(mapin%desc_Y,mapout%desc_Y,info)
call psb_move_alloc(mapin%map_X2Y,mapout%map_X2Y,info)
call psb_move_alloc(mapin%map_Y2X,mapout%map_Y2X,info)
end subroutine psb_zlinmap_transfer
end module psb_linmap_mod

@ -0,0 +1,86 @@
!!$
!!$ Parallel Sparse BLAS version 2.2
!!$ (C) Copyright 2006/2007/2008
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! package: psb_linmap_type_mod
! Defines data types for mapping between vectors belonging
! to different spaces.
!
module psb_linmap_type_mod
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type, &
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_, psb_sizeof
use psb_descriptor_type, only: psb_desc_type
! Inter-descriptor mapping data structures.
integer, parameter :: psb_map_kind_ = 1
integer, parameter :: psb_map_data_ = 2
integer, parameter :: psb_map_integer_ = 1
integer, parameter :: psb_map_single_ = 2
integer, parameter :: psb_map_double_ = 3
integer, parameter :: psb_map_complex_ = 4
integer, parameter :: psb_map_double_complex_ = 5
integer, parameter :: psb_itd_data_size_=20
type psb_slinmap_type
integer, allocatable :: itd_data(:), iaggr(:), naggr(:)
type(psb_desc_type), pointer :: p_desc_X=>null(), p_desc_Y=>null()
type(psb_desc_type) :: desc_X, desc_Y
type(psb_sspmat_type) :: map_X2Y, map_Y2X
end type psb_slinmap_type
type psb_dlinmap_type
integer, allocatable :: itd_data(:), iaggr(:), naggr(:)
type(psb_desc_type), pointer :: p_desc_X=>null(), p_desc_Y=>null()
type(psb_desc_type) :: desc_X, desc_Y
type(psb_dspmat_type) :: map_X2Y, map_Y2X
end type psb_dlinmap_type
type psb_clinmap_type
integer, allocatable :: itd_data(:), iaggr(:), naggr(:)
type(psb_desc_type), pointer :: p_desc_X=>null(), p_desc_Y=>null()
type(psb_desc_type) :: desc_X, desc_Y
type(psb_cspmat_type) :: map_X2Y, map_Y2X
end type psb_clinmap_type
type psb_zlinmap_type
integer, allocatable :: itd_data(:), iaggr(:), naggr(:)
type(psb_desc_type), pointer :: p_desc_X=>null(), p_desc_Y=>null()
type(psb_desc_type) :: desc_X, desc_Y
type(psb_zspmat_type) :: map_X2Y, map_Y2X
end type psb_zlinmap_type
end module psb_linmap_type_mod

@ -134,7 +134,7 @@ module psb_penv_mod
interface psb_sum
module procedure psb_isums, psb_isumv, psb_isumm,&
& psb_i8sums, &
& psb_i8sums, psb_i8sumv,&
& psb_ssums, psb_ssumv, psb_ssumm,&
& psb_csums, psb_csumv, psb_csumm,&
& psb_dsums, psb_dsumv, psb_dsumm,&
@ -2331,6 +2331,46 @@ contains
subroutine psb_i8sumv(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
#ifdef MPI_H
include 'mpif.h'
#endif
integer, intent(in) :: ictxt
integer(psb_long_int_k_), intent(inout) :: dat(:)
integer, intent(in), optional :: root
integer :: mpi_int8_type, info, icomm
integer :: root_, iam, np, isz
integer(psb_long_int_k_), allocatable :: dat_(:)
if (present(root)) then
root_ = root
else
root_ = -1
endif
call psb_info(ictxt,iam,np)
call psb_get_mpicomm(ictxt,icomm)
mpi_int8_type = mpi_integer8
isz = size(dat)
allocate(dat_(isz),stat=info)
if (root_ == -1) then
dat_=dat
call mpi_allreduce(dat_,dat,isz,mpi_int8_type,mpi_sum,icomm,info)
else
if (iam==root_) then
dat_=dat
call mpi_reduce(dat_,dat,isz,mpi_int8_type,mpi_sum,root_,icomm,info)
else
call mpi_reduce(dat,dat_,isz,mpi_int8_type,mpi_sum,root_,icomm,info)
end if
endif
end subroutine psb_i8sumv
subroutine psb_i8sums(ictxt,dat,root)
#ifdef MPI_MOD
use mpi

@ -94,23 +94,6 @@ module psb_psblas_mod
end function psb_zdot
end interface
interface psb_gexdot
function psb_sxdotv(x, y, desc_a,info)
use psb_descriptor_type
real(psb_dpk_) :: psb_sxdotv
real(psb_spk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
end function psb_sxdotv
function psb_sxdot(x, y, desc_a, info, jx, jy)
use psb_descriptor_type
real(psb_dpk_) :: psb_sxdot
real(psb_spk_), intent(in) :: x(:,:), y(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, optional, intent(in) :: jx, jy
integer, intent(out) :: info
end function psb_sxdot
end interface
interface psb_gedots
subroutine psb_sdotvs(res,x, y, desc_a, info)

@ -55,17 +55,17 @@ module psb_realloc_mod
module procedure psb_dreallocatec2
end Interface
interface psb_transfer
module procedure psb_stransfer1d
module procedure psb_stransfer2d
module procedure psb_dtransfer1d
module procedure psb_dtransfer2d
module procedure psb_itransfer1d
module procedure psb_itransfer2d
module procedure psb_ctransfer1d
module procedure psb_ctransfer2d
module procedure psb_ztransfer1d
module procedure psb_ztransfer2d
interface psb_move_alloc
module procedure psb_smove_alloc1d
module procedure psb_smove_alloc2d
module procedure psb_dmove_alloc1d
module procedure psb_dmove_alloc2d
module procedure psb_imove_alloc1d
module procedure psb_imove_alloc2d
module procedure psb_cmove_alloc1d
module procedure psb_cmove_alloc2d
module procedure psb_zmove_alloc1d
module procedure psb_zmove_alloc2d
end interface
Interface psb_safe_ab_cpy
@ -1593,9 +1593,9 @@ Contains
goto 9999
end if
tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim))
if (debug) write(0,*) 'reallocate : calling transfer '
call psb_transfer(tmp,rrax,info)
if (debug) write(0,*) 'reallocate : from transfer ',info
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
@ -1672,7 +1672,7 @@ Contains
goto 9999
end if
tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim))
call psb_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -1746,7 +1746,7 @@ Contains
goto 9999
end if
tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim))
call psb_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -1820,7 +1820,7 @@ Contains
goto 9999
end if
tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim))
call psb_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
end if
else
dim = 0
@ -1893,7 +1893,7 @@ Contains
goto 9999
end if
tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim))
call psb_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
end if
else
dim = 0
@ -1984,7 +1984,7 @@ Contains
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_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -2076,7 +2076,7 @@ Contains
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_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -2168,7 +2168,7 @@ Contains
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_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -2260,7 +2260,7 @@ Contains
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_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -2351,7 +2351,7 @@ Contains
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_transfer(tmp,rrax,info)
call psb_move_alloc(tmp,rrax,info)
End If
else
dim = 0
@ -2625,7 +2625,7 @@ Contains
return
End Subroutine psb_dreallocate2i1z
Subroutine psb_stransfer1d(vin,vout,info)
Subroutine psb_smove_alloc1d(vin,vout,info)
use psb_error_mod
real(psb_spk_), allocatable, intent(inout) :: vin(:),vout(:)
integer, intent(out) :: info
@ -2637,7 +2637,7 @@ Contains
if (allocated(vin)) then
call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'transfer: Clearing output'
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
@ -2651,9 +2651,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_stransfer1d
end Subroutine psb_smove_alloc1d
Subroutine psb_stransfer2d(vin,vout,info)
Subroutine psb_smove_alloc2d(vin,vout,info)
use psb_error_mod
real(psb_spk_), allocatable, intent(inout) :: vin(:,:),vout(:,:)
integer, intent(out) :: info
@ -2678,9 +2678,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_stransfer2d
end Subroutine psb_smove_alloc2d
Subroutine psb_dtransfer1d(vin,vout,info)
Subroutine psb_dmove_alloc1d(vin,vout,info)
use psb_error_mod
real(psb_dpk_), allocatable, intent(inout) :: vin(:),vout(:)
integer, intent(out) :: info
@ -2692,7 +2692,7 @@ Contains
if (allocated(vin)) then
call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'transfer: Clearing output'
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
@ -2706,9 +2706,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_dtransfer1d
end Subroutine psb_dmove_alloc1d
Subroutine psb_dtransfer2d(vin,vout,info)
Subroutine psb_dmove_alloc2d(vin,vout,info)
use psb_error_mod
real(psb_dpk_), allocatable, intent(inout) :: vin(:,:),vout(:,:)
integer, intent(out) :: info
@ -2733,9 +2733,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_dtransfer2d
end Subroutine psb_dmove_alloc2d
Subroutine psb_ctransfer1d(vin,vout,info)
Subroutine psb_cmove_alloc1d(vin,vout,info)
use psb_error_mod
complex(psb_spk_), allocatable, intent(inout) :: vin(:),vout(:)
integer, intent(out) :: info
@ -2758,9 +2758,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_ctransfer1d
end Subroutine psb_cmove_alloc1d
Subroutine psb_ctransfer2d(vin,vout,info)
Subroutine psb_cmove_alloc2d(vin,vout,info)
use psb_error_mod
complex(psb_spk_), allocatable, intent(inout) :: vin(:,:),vout(:,:)
integer, intent(out) :: info
@ -2785,9 +2785,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_ctransfer2d
end Subroutine psb_cmove_alloc2d
Subroutine psb_ztransfer1d(vin,vout,info)
Subroutine psb_zmove_alloc1d(vin,vout,info)
use psb_error_mod
complex(psb_dpk_), allocatable, intent(inout) :: vin(:),vout(:)
integer, intent(out) :: info
@ -2810,9 +2810,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_ztransfer1d
end Subroutine psb_zmove_alloc1d
Subroutine psb_ztransfer2d(vin,vout,info)
Subroutine psb_zmove_alloc2d(vin,vout,info)
use psb_error_mod
complex(psb_dpk_), allocatable, intent(inout) :: vin(:,:),vout(:,:)
integer, intent(out) :: info
@ -2837,9 +2837,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_ztransfer2d
end Subroutine psb_zmove_alloc2d
Subroutine psb_itransfer1d(vin,vout,info)
Subroutine psb_imove_alloc1d(vin,vout,info)
use psb_error_mod
integer, allocatable, intent(inout) :: vin(:),vout(:)
integer, intent(out) :: info
@ -2850,7 +2850,7 @@ Contains
if (allocated(vin)) then
call move_alloc(vin,vout)
else if (allocated(vout)) then
!!$ write(0,*) 'transfer: Clearing output'
!!$ write(0,*) 'move_alloc: Clearing output'
deallocate(vout)
end if
#else
@ -2863,9 +2863,9 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_itransfer1d
end Subroutine psb_imove_alloc1d
Subroutine psb_itransfer2d(vin,vout,info)
Subroutine psb_imove_alloc2d(vin,vout,info)
use psb_error_mod
integer, allocatable, intent(inout) :: vin(:,:),vout(:,:)
integer, intent(out) :: info
@ -2890,6 +2890,6 @@ Contains
vout = vin
deallocate(vin,stat=info)
#endif
end Subroutine psb_itransfer2d
end Subroutine psb_imove_alloc2d
end module psb_realloc_mod

@ -591,56 +591,60 @@ module psb_serial_mod
subroutine psb_stransp(a,b,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_sspmat_type) :: a,b
type(psb_sspmat_type), intent(in) :: a
type(psb_sspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_stransp
subroutine psb_dtransp(a,b,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_dspmat_type) :: a,b
type(psb_dspmat_type), intent(in) :: a
type(psb_dspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_dtransp
subroutine psb_ctransp(a,b,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_cspmat_type) :: a,b
type(psb_cspmat_type), intent(in) :: a
type(psb_cspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_ctransp
subroutine psb_ztransp(a,b,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_zspmat_type) :: a,b
type(psb_zspmat_type), intent(in) :: a
type(psb_zspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_ztransp
subroutine psb_stransp1(a,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_sspmat_type) :: a
type(psb_sspmat_type), intent(inout) :: a
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_stransp1
subroutine psb_dtransp1(a,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_dspmat_type) :: a
type(psb_dspmat_type), intent(inout) :: a
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_dtransp1
subroutine psb_ctransp1(a,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_cspmat_type) :: a
type(psb_cspmat_type), intent(inout) :: a
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_ctransp1
subroutine psb_ztransp1(a,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_zspmat_type) :: a
type(psb_zspmat_type), intent(inout) :: a
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_ztransp1
@ -650,14 +654,16 @@ module psb_serial_mod
subroutine psb_ctransc(a,b,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_cspmat_type) :: a,b
type(psb_cspmat_type), intent(in) :: a
type(psb_cspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_ctransc
subroutine psb_ztransc(a,b,c,fmt)
use psb_spmat_type, only : psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_zspmat_type) :: a,b
type(psb_zspmat_type), intent(in) :: a
type(psb_zspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
end subroutine psb_ztransc

@ -138,8 +138,66 @@ module psb_sort_mod
module procedure psb_issrch
end interface
interface psb_isaperm
module procedure psb_isaperm
end interface
contains
logical function psb_isaperm(n,eip)
implicit none
integer, intent(in) :: n
integer, intent(in) :: eip(n)
integer, allocatable :: ip(:)
integer i,j,m, info
psb_isaperm = .true.
if (n <= 0) return
allocate(ip(n), stat=info)
if (info /= 0) return
!
! sanity check first
!
do i=1, n
ip(i) = eip(i)
if ((ip(i) < 1).or.(ip(i) > n)) then
write(0,*) 'Out of bounds in isaperm' ,ip(i), n
psb_isaperm = .false.
return
endif
enddo
!
! now work through the cycles, by marking each successive item as negative.
! no cycle should intersect with any other, hence the >= 1 check.
!
do m = 1, n
i = ip(m)
if (i < 0) then
ip(m) = -i
else if (i /= m) then
j = ip(i)
ip(i) = -j
i = j
do while ((j >= 1).and.(j /= m))
j = ip(i)
ip(i) = -j
i = j
enddo
ip(m) = iabs(ip(m))
if (j /= m) then
psb_isaperm = .false.
goto 9999
endif
end if
enddo
9999 continue
return
end function psb_isaperm
function psb_ibsrch(key,n,v) result(ipos)
implicit none
integer ipos, key, n
@ -156,7 +214,7 @@ contains
if (key.eq.v(m)) then
ipos = m
lb = ub + 1
else if (key.lt.v(m)) then
else if (key < v(m)) then
ub = m-1
else
lb = m + 1

@ -194,7 +194,7 @@ module psb_spmat_type
& psb_dsp_getifld, psb_zsp_getifld
end interface
interface psb_sp_transfer
interface psb_move_alloc
module procedure psb_ssp_transfer, psb_csp_transfer,&
& psb_dsp_transfer, psb_zsp_transfer
end interface
@ -274,56 +274,56 @@ module psb_spmat_type
interface psb_csmm
subroutine psb_scsmv(alpha,a,b,beta,c,info,trans)
import :: psb_sspmat_type, psb_spk_
type(psb_sspmat_type) :: a
class(psb_sspmat_type) :: a
real(psb_spk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans
end subroutine psb_scsmv
subroutine psb_scsmm(alpha,a,b,beta,c,info,trans)
import :: psb_sspmat_type, psb_spk_
type(psb_sspmat_type) :: a
class(psb_sspmat_type) :: a
real(psb_spk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans
end subroutine psb_scsmm
subroutine psb_dcsmv(alpha,a,b,beta,c,info,trans)
import :: psb_dspmat_type, psb_dpk_
type(psb_dspmat_type) :: a
class(psb_dspmat_type) :: a
real(psb_dpk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans
end subroutine psb_dcsmv
subroutine psb_dcsmm(alpha,a,b,beta,c,info,trans)
import :: psb_dspmat_type, psb_dpk_
type(psb_dspmat_type) :: a
class(psb_dspmat_type) :: a
real(psb_dpk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans
end subroutine psb_dcsmm
subroutine psb_ccsmv(alpha,a,b,beta,c,info,trans)
import :: psb_cspmat_type, psb_spk_
type(psb_cspmat_type) :: a
class(psb_cspmat_type) :: a
complex(psb_spk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans
end subroutine psb_ccsmv
subroutine psb_ccsmm(alpha,a,b,beta,c,info,trans)
import :: psb_cspmat_type, psb_spk_
type(psb_cspmat_type) :: a
class(psb_cspmat_type) :: a
complex(psb_spk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans
end subroutine psb_ccsmm
subroutine psb_zcsmv(alpha,a,b,beta,c,info,trans)
import :: psb_zspmat_type, psb_dpk_
type(psb_zspmat_type) :: a
class(psb_zspmat_type) :: a
complex(psb_dpk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans
end subroutine psb_zcsmv
subroutine psb_zcsmm(alpha,a,b,beta,c,info,trans)
import :: psb_zspmat_type, psb_dpk_
type(psb_zspmat_type) :: a
class(psb_zspmat_type) :: a
complex(psb_dpk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans
@ -334,7 +334,7 @@ module psb_spmat_type
subroutine psb_scssm(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_sspmat_type) :: t
class(psb_sspmat_type) :: t
real(psb_spk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans, unitd
@ -343,7 +343,7 @@ module psb_spmat_type
subroutine psb_scssv(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_sspmat_type) :: t
class(psb_sspmat_type) :: t
real(psb_spk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans, unitd
@ -352,7 +352,7 @@ module psb_spmat_type
subroutine psb_dcssm(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_dspmat_type) :: t
class(psb_dspmat_type) :: t
real(psb_dpk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans, unitd
@ -361,7 +361,7 @@ module psb_spmat_type
subroutine psb_dcssv(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_dspmat_type) :: t
class(psb_dspmat_type) :: t
real(psb_dpk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans, unitd
@ -370,7 +370,7 @@ module psb_spmat_type
subroutine psb_ccssm(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_cspmat_type) :: t
class(psb_cspmat_type) :: t
complex(psb_spk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans, unitd
@ -379,7 +379,7 @@ module psb_spmat_type
subroutine psb_ccssv(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_cspmat_type) :: t
class(psb_cspmat_type) :: t
complex(psb_spk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans, unitd
@ -388,7 +388,7 @@ module psb_spmat_type
subroutine psb_zcssm(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_zspmat_type) :: t
class(psb_zspmat_type) :: t
complex(psb_dpk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans, unitd
@ -397,7 +397,7 @@ module psb_spmat_type
subroutine psb_zcssv(alpha,t,b,beta,c,info,trans,unitd,d)
import :: psb_sspmat_type, psb_dspmat_type,&
& psb_cspmat_type, psb_zspmat_type, psb_spk_, psb_dpk_
type(psb_zspmat_type) :: t
class(psb_zspmat_type) :: t
complex(psb_dpk_) :: alpha, beta, b(:), c(:)
integer :: info
character, optional :: trans, unitd
@ -613,17 +613,7 @@ contains
psb_get_zsp_nnz_row = 0
end if
end function psb_get_zsp_nnz_row
!!$
!!$ subroutine psb_nullify_base_sp(mat)
!!$ implicit none
!!$ class(psb_base_spmat_type), intent(inout) :: mat
!!$ mat%infoa(:)=0
!!$ mat%m=0
!!$ mat%k=0
!!$ mat%fida=''
!!$ mat%descra=''
!!$
!!$ end subroutine psb_nullify_base_sp
subroutine psb_nullify_ssp(mat)
implicit none
@ -949,11 +939,11 @@ contains
info = 0
call psb_transfer( a%aspk, b%aspk , info)
call psb_transfer( a%ia1 , b%ia1 , info)
call psb_transfer( a%ia2 , b%ia2 , info)
call psb_transfer( a%pl , b%pl , info)
call psb_transfer( a%pr , b%pr , info)
call psb_move_alloc( a%aspk, b%aspk , info)
call psb_move_alloc( a%ia1 , b%ia1 , info)
call psb_move_alloc( a%ia2 , b%ia2 , info)
call psb_move_alloc( a%pl , b%pl , info)
call psb_move_alloc( a%pr , b%pr , info)
b%infoa(:) = a%infoa(:)
b%fida = a%fida
b%descra = a%descra
@ -1098,11 +1088,9 @@ contains
integer(psb_long_int_k_) :: val
val = psb_sizeof_int*size(a%infoa)
if (allocated(a%aspk)) then
val = val + psb_sizeof_sp * size(a%aspk)
endif
if (allocated(a%ia1)) then
val = val + psb_sizeof_int * size(a%ia1)
endif
@ -1478,11 +1466,11 @@ contains
info = 0
call psb_transfer( a%aspk, b%aspk , info)
call psb_transfer( a%ia1 , b%ia1 , info)
call psb_transfer( a%ia2 , b%ia2 , info)
call psb_transfer( a%pl , b%pl , info)
call psb_transfer( a%pr , b%pr , info)
call psb_move_alloc( a%aspk, b%aspk , info)
call psb_move_alloc( a%ia1 , b%ia1 , info)
call psb_move_alloc( a%ia2 , b%ia2 , info)
call psb_move_alloc( a%pl , b%pl , info)
call psb_move_alloc( a%pr , b%pr , info)
b%infoa(:) = a%infoa(:)
b%fida = a%fida
b%descra = a%descra
@ -1986,11 +1974,11 @@ contains
info = 0
call psb_transfer( a%aspk, b%aspk , info)
call psb_transfer( a%ia1 , b%ia1 , info)
call psb_transfer( a%ia2 , b%ia2 , info)
call psb_transfer( a%pl , b%pl , info)
call psb_transfer( a%pr , b%pr , info)
call psb_move_alloc( a%aspk, b%aspk , info)
call psb_move_alloc( a%ia1 , b%ia1 , info)
call psb_move_alloc( a%ia2 , b%ia2 , info)
call psb_move_alloc( a%pl , b%pl , info)
call psb_move_alloc( a%pr , b%pr , info)
b%infoa(:) = a%infoa(:)
b%fida = a%fida
b%descra = a%descra
@ -2479,11 +2467,11 @@ contains
info = 0
call psb_transfer( a%aspk, b%aspk , info)
call psb_transfer( a%ia1 , b%ia1 , info)
call psb_transfer( a%ia2 , b%ia2 , info)
call psb_transfer( a%pl , b%pl , info)
call psb_transfer( a%pr , b%pr , info)
call psb_move_alloc( a%aspk, b%aspk , info)
call psb_move_alloc( a%ia1 , b%ia1 , info)
call psb_move_alloc( a%ia2 , b%ia2 , info)
call psb_move_alloc( a%pl , b%pl , info)
call psb_move_alloc( a%pr , b%pr , info)
b%infoa(:) = a%infoa(:)
b%fida = a%fida
b%descra = a%descra
@ -2674,6 +2662,7 @@ contains
use psb_const_mod
use psb_error_mod
use psb_string_mod
use psb_sort_mod
implicit none
type(psb_sspmat_type), intent(in), target :: a
@ -2730,7 +2719,7 @@ contains
if (a%infoa(psb_srtd_) == psb_isrtdcoo_) then
! In this case we can do a binary search.
nz = a%infoa(psb_nnz_)
call ibsrch(ip,irw,nz,a%ia1)
ip = psb_ibsrch(irw,nz,a%ia1)
jp = ip
! expand [ip,jp] to contain all row entries.
do
@ -2833,6 +2822,7 @@ contains
use psb_const_mod
use psb_error_mod
use psb_string_mod
use psb_sort_mod
implicit none
type(psb_dspmat_type), intent(in), target :: a
@ -2889,7 +2879,7 @@ contains
if (a%infoa(psb_srtd_) == psb_isrtdcoo_) then
! In this case we can do a binary search.
nz = a%infoa(psb_nnz_)
call ibsrch(ip,irw,nz,a%ia1)
ip = psb_ibsrch(irw,nz,a%ia1)
jp = ip
! expand [ip,jp] to contain all row entries.
do
@ -2992,6 +2982,7 @@ contains
use psb_const_mod
use psb_error_mod
use psb_string_mod
use psb_sort_mod
implicit none
type(psb_cspmat_type), intent(in), target :: a
@ -3043,7 +3034,7 @@ contains
if (a%infoa(psb_srtd_) == psb_isrtdcoo_) then
! In this case we can do a binary search.
nz = a%infoa(psb_nnz_)
call ibsrch(ip,irw,nz,a%ia1)
ip = psb_ibsrch(irw,nz,a%ia1)
jp = ip
! expand [ip,jp] to contain all row entries.
do
@ -3143,6 +3134,7 @@ contains
end subroutine psb_cspinfo
subroutine psb_zspinfo(ireq,a,ires,info,iaux)
use psb_sort_mod
use psb_const_mod
use psb_error_mod
use psb_string_mod
@ -3197,7 +3189,7 @@ contains
if (a%infoa(psb_srtd_) == psb_isrtdcoo_) then
! In this case we can do a binary search.
nz = a%infoa(psb_nnz_)
call ibsrch(ip,irw,nz,a%ia1)
ip = psb_ibsrch(irw,nz,a%ia1)
jp = ip
! expand [ip,jp] to contain all row entries.
do

File diff suppressed because it is too large Load Diff

@ -666,7 +666,7 @@ Module psb_tools_mod
type(psb_desc_type), intent(inout) :: desc_ac
type(psb_sspmat_type), intent(inout) :: a
integer, intent(in) :: nz,ia(:),ja(:)
real(kind(1.d0)), intent(in) :: val(:)
real(psb_spk_), intent(in) :: val(:)
integer, intent(out) :: info
end subroutine psb_sspins_2desc
subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild)
@ -859,6 +859,16 @@ Module psb_tools_mod
end subroutine psb_get_ovrlap
end interface
interface psb_icdasb
subroutine psb_icdasb(desc,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
interface psb_linmap_init
module procedure psb_dlinmap_init, psb_zlinmap_init
end interface
@ -1136,15 +1146,6 @@ contains
subroutine psb_cdasb(desc,info)
use psb_descriptor_type
interface
subroutine psb_icdasb(desc,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
Type(psb_desc_type), intent(inout) :: desc
integer, intent(out) :: info

@ -80,7 +80,7 @@ module psi_mod
use psb_descriptor_type, only : psb_desc_type, psb_spk_, psb_dpk_
type(psb_desc_type) :: desc
integer :: index_in(:),dep_list(:)
integer,allocatable, intent(inout) :: desc_index(:)
integer,allocatable :: desc_index(:)
integer :: length_dl,nsnd,nrcv,info
logical :: isglob_in
end subroutine psi_desc_index
@ -584,6 +584,10 @@ module psi_mod
module procedure psi_cnv_dsc
end interface
interface psi_renum_index
module procedure psi_renum_index
end interface
interface psi_inner_cnv
module procedure psi_inner_cnv1, psi_inner_cnv2,&
& psi_inner_cnvs, psi_inner_cnvs2
@ -617,6 +621,83 @@ module psi_mod
contains
subroutine psi_renum_index(iperm,idx,info)
use psb_serial_mod
implicit none
integer, intent(out) :: info
integer, intent(in) :: iperm(:)
integer, intent(inout) :: idx(:)
integer :: i,j,k,nh
i=1
k=idx(i)
do while (k /= -1)
i = i+1
nh = idx(i)
do j = i+1, i+nh
idx(j) = iperm(idx(j))
enddo
i = i + nh + 1
nh = idx(i)
do j = i+1, i+nh
idx(j) = iperm(idx(j))
enddo
i = i + nh + 1
k = idx(i)
enddo
end subroutine psi_renum_index
subroutine psi_renum_idxmap(nc,iperm,idxmap,info)
use psb_serial_mod
implicit none
integer, intent(out) :: info
integer, intent(in) :: nc,iperm(:)
type(psb_idxmap_type), intent(inout) :: idxmap
integer, allocatable :: itmp(:)
integer :: i,j,k,nh
if (nc > size(iperm)) then
info = 2
return
endif
if (idxmap%state == psb_desc_large_) then
allocate(itmp(size(idxmap%loc_to_glob)), stat=i)
if (i/=0) then
info = 4001
return
end if
do i=1,nc
itmp(i) = idxmap%loc_to_glob(iperm(i))
end do
do i=1, size(idxmap%glb_lc,1)
idxmap%glb_lc(i,2) = iperm(idxmap%glb_lc(i,2))
end do
do i=1, nc
idxmap%loc_to_glob(i) = itmp(i)
end do
else
do i=1, nc
idxmap%glob_to_loc(idxmap%loc_to_glob(iperm(i))) = i
enddo
do i=1,size(idxmap%glob_to_loc)
j = idxmap%glob_to_loc(i)
if (j>0) then
idxmap%loc_to_glob(j) = i
endif
enddo
end if
end subroutine psi_renum_idxmap
subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info)
use psb_realloc_mod
@ -662,7 +743,7 @@ contains
call psb_errpush(4010,name,a_err='psi_crea_index')
goto 9999
end if
call psb_transfer(idx_out,cdesc%halo_index,info)
call psb_move_alloc(idx_out,cdesc%halo_index,info)
cdesc%matrix_data(psb_thal_xch_) = nxch
cdesc%matrix_data(psb_thal_snd_) = nsnd
cdesc%matrix_data(psb_thal_rcv_) = nrcv
@ -678,7 +759,7 @@ contains
call psb_errpush(4010,name,a_err='psi_crea_index')
goto 9999
end if
call psb_transfer(idx_out,cdesc%ext_index,info)
call psb_move_alloc(idx_out,cdesc%ext_index,info)
cdesc%matrix_data(psb_text_xch_) = nxch
cdesc%matrix_data(psb_text_snd_) = nsnd
cdesc%matrix_data(psb_text_rcv_) = nrcv
@ -692,9 +773,9 @@ contains
call psb_errpush(4010,name,a_err='psi_crea_index')
goto 9999
end if
call psb_transfer(idx_out,cdesc%ovrlap_index,info)
call psb_move_alloc(idx_out,cdesc%ovrlap_index,info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psb_transfer')
call psb_errpush(4010,name,a_err='psb_move_alloc')
goto 9999
end if
@ -720,9 +801,9 @@ contains
call psb_errpush(4010,name,a_err='psi_bld_ovr_mst')
goto 9999
end if
call psb_transfer(idx_out,cdesc%ovr_mst_idx,info)
call psb_move_alloc(idx_out,cdesc%ovr_mst_idx,info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psb_transfer')
call psb_errpush(4010,name,a_err='psb_move_alloc')
goto 9999
end if
@ -732,7 +813,7 @@ contains
! finally bnd_elem
call psi_crea_bnd_elem(idx_out,cdesc,info)
if (info == 0) call psb_transfer(idx_out,cdesc%bnd_elem,info)
if (info == 0) call psb_move_alloc(idx_out,cdesc%bnd_elem,info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psi_crea_bnd_elem')

@ -8,7 +8,6 @@ OBJS= psb_ddot.o psb_damax.o psb_dasum.o psb_daxpby.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_snrm2.o psb_snrmi.o psb_sspmm.o psb_sspsm.o\
psb_sxdot.o\
psb_camax.o psb_casum.o psb_caxpby.o psb_cdot.o \
psb_cnrm2.o psb_cnrmi.o psb_cspmm.o psb_cspsm.o

@ -242,7 +242,7 @@ subroutine psb_cspmm(alpha,a,x,beta,y,desc_a,info,&
blk: do i=1, ik, nb
ib=ib1
ib1 = max(0,min(nb,(ik)-(i-1+ib)))
xp => x(iix:lldx,jjx+i+ib-1:jjx+i+ib+ib1-2)
xp => x(iix:lldx,jjx+i-1+ib:jjx+i-1+ib+ib1-1)
if ((ib1 > 0).and.(doswap_)) &
& call psi_swapdata(psb_swap_send_,ib1,&
& czero,xp,desc_a,iwork,info)
@ -250,8 +250,8 @@ subroutine psb_cspmm(alpha,a,x,beta,y,desc_a,info,&
if(info /= 0) exit blk
! local Matrix-vector product
call a%csmm(alpha,x(:,jjx+i-1:jjx+i+ib-1),&
& beta,y(:,jjy+i-1:jjy+i+ib-1),info,trans=trans_)
call a%csmm(alpha,x(:,jjx+i-1:jjx+i-1+ib-1),&
& beta,y(:,jjy+i-1:jjy+i-1+ib-1),info,trans=trans_)
if(info /= 0) exit blk
@ -306,6 +306,8 @@ subroutine psb_cspmm(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x(:,1:ik),xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)
@ -622,6 +624,8 @@ subroutine psb_cspmv(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x,xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)

@ -242,7 +242,7 @@ subroutine psb_dspmm(alpha,a,x,beta,y,desc_a,info,&
blk: do i=1, ik, nb
ib=ib1
ib1 = max(0,min(nb,(ik)-(i-1+ib)))
xp => x(iix:lldx,jjx+i+ib-1:jjx+i+ib+ib1-2)
xp => x(iix:lldx,jjx+i-1+ib:jjx+i-1+ib+ib1-1)
if ((ib1 > 0).and.(doswap_)) &
& call psi_swapdata(psb_swap_send_,ib1,&
& dzero,xp,desc_a,iwork,info)
@ -250,8 +250,8 @@ subroutine psb_dspmm(alpha,a,x,beta,y,desc_a,info,&
if(info /= 0) exit blk
! local Matrix-vector product
call a%csmm(alpha,x(:,jjx+i-1:jjx+i+ib-1),&
& beta,y(:,jjy+i-1:jjy+i+ib-1),info,trans=trans_)
call a%csmm(alpha,x(:,jjx+i-1:jjx+i-1+ib-1),&
& beta,y(:,jjy+i-1:jjy+i-1+ib-1),info,trans=trans_)
if(info /= 0) exit blk
@ -305,6 +305,8 @@ subroutine psb_dspmm(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x(:,1:ik),xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)
@ -620,6 +622,8 @@ subroutine psb_dspmv(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x,xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)

@ -242,7 +242,7 @@ subroutine psb_sspmm(alpha,a,x,beta,y,desc_a,info,&
blk: do i=1, ik, nb
ib=ib1
ib1 = max(0,min(nb,(ik)-(i-1+ib)))
xp => x(iix:lldx,jjx+i+ib-1:jjx+i+ib+ib1-2)
xp => x(iix:lldx,jjx+i-1+ib:jjx+i-1+ib+ib1-1)
if ((ib1 > 0).and.(doswap_)) &
& call psi_swapdata(psb_swap_send_,ib1,&
& szero,xp,desc_a,iwork,info)
@ -250,8 +250,8 @@ subroutine psb_sspmm(alpha,a,x,beta,y,desc_a,info,&
if(info /= 0) exit blk
! local Matrix-vector product
call a%csmm(alpha,x(:,jjx+i-1:jjx+i+ib-1),&
& beta,y(:,jjy+i-1:jjy+i+ib-1),info,trans=trans_)
call a%csmm(alpha,x(:,jjx+i-1:jjx+i-1+ib-1),&
& beta,y(:,jjy+i-1:jjy+i-1+ib-1),info,trans=trans_)
if(info /= 0) exit blk
@ -305,6 +305,8 @@ subroutine psb_sspmm(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x(:,1:ik),xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)
@ -621,6 +623,8 @@ subroutine psb_sspmv(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x,xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)

@ -242,7 +242,7 @@ subroutine psb_zspmm(alpha,a,x,beta,y,desc_a,info,&
blk: do i=1, ik, nb
ib=ib1
ib1 = max(0,min(nb,(ik)-(i-1+ib)))
xp => x(iix:lldx,jjx+i+ib-1:jjx+i+ib+ib1-2)
xp => x(iix:lldx,jjx+i-1+ib:jjx+i-1+ib+ib1-1)
if ((ib1 > 0).and.(doswap_)) &
& call psi_swapdata(psb_swap_send_,ib1,&
& zzero,xp,desc_a,iwork,info)
@ -250,8 +250,8 @@ subroutine psb_zspmm(alpha,a,x,beta,y,desc_a,info,&
if(info /= 0) exit blk
! local Matrix-vector product
call a%csmm(alpha,x(:,jjx+i-1:jjx+i+ib-1),&
& beta,y(:,jjy+i-1:jjy+i+ib-1),info,trans=trans_)
call a%csmm(alpha,x(:,jjx+i-1:jjx+i-1+ib-1),&
& beta,y(:,jjy+i-1:jjy+i-1+ib-1),info,trans=trans_)
if(info /= 0) exit blk
@ -306,6 +306,8 @@ subroutine psb_zspmm(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x(:,1:ik),xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)
@ -622,6 +624,8 @@ subroutine psb_zspmv(alpha,a,x,beta,y,desc_a,info,&
!
! Non-empty overlap, need a buffer to hold
! the entries updated with average operator.
! Why the average? because in this way they will contribute
! with a proper scale factor (1/np) to the overall product.
!
call psi_ovrl_save(x,xvsave,desc_a,info)
if (info == 0) call psi_ovrl_upd(x,desc_a,psb_avg_,info)

@ -13,7 +13,7 @@ FOBJS = psb_cest.o psb_dcoins.o psb_dcsmm.o psb_dcsmv.o \
psb_zcoins.o psb_zcsprt.o psb_zneigh.o psb_ztransp.o psb_ztransc.o\
psb_zrwextd.o psb_zsymbmm.o psb_znumbmm.o psb_zspscal.o psb_zspclip.o\
psb_getifield.o psb_setifield.o psb_update_mod.o psb_getrow_mod.o\
psb_dgelp.o psb_zgelp.o psb_dcsrp.o psb_zcsrp.o\
psb_dgelp.o psb_zgelp.o\
psb_dspshift.o psb_dspsetbld.o psb_zspshift.o psb_zspsetbld.o\
psb_scsprt.o psb_sspcnv.o psb_scoins.o psb_scsmm.o psb_scsmv.o \
psb_scssm.o psb_scssv.o psb_sneigh.o psb_sspgtblk.o psb_sspgetrow.o \
@ -27,7 +27,7 @@ FOBJS = psb_cest.o psb_dcoins.o psb_dcsmm.o psb_dcsmv.o \
psb_ccssm.o psb_ccssv.o psb_ccsmm.o psb_ccsmv.o psb_ctransp.o psb_ctransc.o\
psb_cspclip.o psb_crwextd.o psb_cspscal.o\
psb_cnumbmm.o psb_csymbmm.o psb_cneigh.o psb_ip_reord_mod.o
#
# psb_dcsrp.o psb_zcsrp.o\
LIBDIR=..
MODDIR=../modules

@ -4,7 +4,7 @@ include ../../../Make.inc
#
FOBJS = isr.o isrx.o iasr.o iasrx.o msort_up.o msort_dw.o\
isaperm.o ibsrch.o issrch.o imsr.o imsrx.o imsru.o\
imsr.o imsrx.o imsru.o\
dsr.o dsrx.o dasr.o dasrx.o dmsr.o dmsrx.o dmsort_up.o dmsort_dw.o \
ssr.o ssrx.o sasr.o sasrx.o smsr.o smsrx.o smsort_up.o smsort_dw.o \
clcmp_mod.o clsr.o clsrx.o \

@ -235,7 +235,7 @@ subroutine psb_ccoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
if(info /= izero) then
info=4010
ch_err='psb_sp_transfer'
@ -404,7 +404,7 @@ subroutine psb_ccoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
call psb_sp_info(psb_nztotreq_,a,nza,info)
call psb_sp_info(psb_nzsizereq_,a,isza,info)
if(info /= izero) then

@ -58,8 +58,8 @@ subroutine psb_ccsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
character(len=*), optional :: head
integer, intent(in), optional :: ivr(:), ivc(:)
character(len=*), parameter :: frmtr='(2(i6,1x),2(es16.8,1x),2(i6,1x))'
integer :: irs,ics,i,j
character(len=80) :: frmtv
integer :: irs,ics,i,j, nmx, ni
if (present(eirs)) then
irs = eirs
@ -79,6 +79,12 @@ subroutine psb_ccsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
write(iout,'(a,a)') '% ',psb_toupper(a%fida)
endif
nmx = max(a%m,a%k,1)
ni = floor(log10(1.0*nmx)) + 1
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es16.8,1x),2(i',ni,',1x))'
select case(psb_toupper(a%fida))
case ('CSR')
@ -88,32 +94,32 @@ subroutine psb_ccsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
endif
@ -126,32 +132,32 @@ subroutine psb_ccsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
write(iout,frmtv) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
endif
@ -161,28 +167,28 @@ subroutine psb_ccsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if(present(iv)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
write(iout,frmtv) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
enddo
else
if (present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
enddo
else if (present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),a%ia2(j),a%aspk(j)
write(iout,frmtv) a%ia1(j),a%ia2(j),a%aspk(j)
enddo
endif
endif

@ -70,14 +70,6 @@ subroutine psb_cgelp(trans,iperm,x,info)
end subroutine cgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_cgelp'
@ -97,7 +89,7 @@ subroutine psb_cgelp(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
@ -205,13 +197,6 @@ subroutine psb_cgelpv(trans,iperm,x,info)
end subroutine cgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_cgelpv'
@ -232,7 +217,7 @@ subroutine psb_cgelpv(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)

@ -89,11 +89,11 @@ subroutine psb_cipcoo2csc(a,info,clshr)
if(debug_level >= psb_debug_serial_) write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nc,size(a%ia2),size(iaux)
call psb_transfer(a%ia2,itemp,info)
if (info == 0) call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia2,itemp,info)
if (info == 0) call psb_move_alloc(iaux,a%ia2,info)
if (info /= 0) then
info=4010
call psb_errpush(info,name,a_err='psb_transfer')
call psb_errpush(info,name,a_err='psb_move_alloc')
goto 9999
end if

@ -89,9 +89,9 @@ subroutine psb_cipcoo2csr(a,info,rwshr)
& write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nr,size(a%ia2),size(iaux)
call psb_transfer(a%ia1,itemp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia1,itemp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(iaux,a%ia2,info)
!
! This routine can be used in two modes:

@ -70,9 +70,9 @@ Subroutine psb_cipcsr2coo(a,info)
goto 9999
end if
!!$ write(0,*) 'ipcsr2coo ',a%m
call psb_transfer(a%ia2,itemp,info)
call psb_transfer(a%ia1,a%ia2,info)
call psb_transfer(iaux,a%ia1,info)
call psb_move_alloc(a%ia2,itemp,info)
call psb_move_alloc(a%ia1,a%ia2,info)
call psb_move_alloc(iaux,a%ia1,info)
do i=1, nr
do j=itemp(i),itemp(i+1)-1

@ -46,7 +46,7 @@ subroutine psb_cneigh(a,idx,neigh,n,info,lev)
integer, intent(in) :: idx ! the index whose neighbours we want to find
integer, intent(out) :: n, info ! the number of neighbours and the info
integer, allocatable :: neigh(:) ! the neighbours
integer, optional :: lev ! level of neighbours to find
integer, optional, intent(in) :: lev ! level of neighbours to find
integer :: lev_, i, nl, ifl,ill,&
& n1, err_act, nn, nidx,ntl

@ -40,7 +40,7 @@ subroutine psb_ctransc(a,b,c,fmt)
use psb_serial_mod, psb_protect_name => psb_ctransc
implicit none
type(psb_cspmat_type), intent(inout) :: a
type(psb_cspmat_type), intent(in) :: a
type(psb_cspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
@ -68,9 +68,9 @@ subroutine psb_ctransc(a,b,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(b%ia1,itmp,info)
call psb_transfer(b%ia2,b%ia1,info)
call psb_transfer(itmp,b%ia2,info)
call psb_move_alloc(b%ia1,itmp,info)
call psb_move_alloc(b%ia2,b%ia1,info)
call psb_move_alloc(itmp,b%ia2,info)
do i=1, b%infoa(psb_nnz_)
b%aspk(i) = conjg(b%aspk(i))

@ -40,7 +40,7 @@ subroutine psb_ctransp(a,b,c,fmt)
use psb_serial_mod, psb_protect_name => psb_ctransp
implicit none
type(psb_cspmat_type), intent(inout) :: a
type(psb_cspmat_type), intent(in) :: a
type(psb_cspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
@ -68,9 +68,9 @@ subroutine psb_ctransp(a,b,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(b%ia1,itmp,info)
call psb_transfer(b%ia2,b%ia1,info)
call psb_transfer(itmp,b%ia2,info)
call psb_move_alloc(b%ia1,itmp,info)
call psb_move_alloc(b%ia2,b%ia1,info)
call psb_move_alloc(itmp,b%ia2,info)
b%m = a%k
b%k = a%m
@ -111,9 +111,9 @@ subroutine psb_ctransp1(a,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(a%ia1,itmp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(itmp,a%ia2,info)
call psb_move_alloc(a%ia1,itmp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(itmp,a%ia2,info)
call psb_spcnv(a,info,afmt=fmt_)

@ -235,7 +235,7 @@ subroutine psb_dcoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
if(info /= izero) then
info=4010
ch_err='psb_sp_transfer'
@ -404,7 +404,7 @@ subroutine psb_dcoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
call psb_sp_info(psb_nztotreq_,a,nza,info)
call psb_sp_info(psb_nzsizereq_,a,isza,info)
if(info /= izero) then

@ -37,7 +37,7 @@ subroutine psb_dcsmm(alpha,a,b,beta,c,info,trans)
use psb_error_mod
implicit none
type(psb_dspmat_type) :: a
class(psb_dspmat_type) :: a
real(psb_dpk_) :: alpha, beta, b(:,:), c(:,:)
integer :: info
character, optional :: trans

@ -58,8 +58,8 @@ subroutine psb_dcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
character(len=*), optional :: head
integer, intent(in), optional :: ivr(:), ivc(:)
character(len=*), parameter :: frmtr='(2(i6,1x),es26.18,2(i6,1x))'
integer :: irs,ics,i,j
character(len=80) :: frmtv
integer :: irs,ics,i,j, nmx, ni
if (present(eirs)) then
irs = eirs
@ -79,6 +79,12 @@ subroutine psb_dcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
write(iout,'(a,a)') '% ',psb_toupper(a%fida)
endif
nmx = max(a%m,a%k,1)
ni = floor(log10(1.0*nmx)) + 1
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
select case(psb_toupper(a%fida))
case ('CSR')
@ -88,32 +94,32 @@ subroutine psb_dcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
endif
@ -126,32 +132,32 @@ subroutine psb_dcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
write(iout,frmtv) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
endif
@ -161,28 +167,28 @@ subroutine psb_dcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if(present(iv)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
write(iout,frmtv) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
enddo
else
if (present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
enddo
else if (present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),a%ia2(j),a%aspk(j)
write(iout,frmtv) a%ia1(j),a%ia2(j),a%aspk(j)
enddo
endif
endif

@ -64,14 +64,6 @@ subroutine psb_dcsrp(trans,iperm,a, info)
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
!...parameters....
type(psb_dspmat_type), intent(inout) :: a
integer, intent(inout) :: iperm(:), info
@ -83,8 +75,8 @@ subroutine psb_dcsrp(trans,iperm,a, info)
integer :: n_row,err_act, int_err(5)
character(len=20) :: name, char_err
n_row = psb_get_sp_nrows(a)
n_col = psb_get_sp_ncols(a)
n_row = psb_sp_get_nrows(a)
n_col = psb_sp_get_ncols(a)
if(psb_get_errstatus() /= 0) return
info=0
@ -99,7 +91,7 @@ subroutine psb_dcsrp(trans,iperm,a, info)
call psb_errpush(info,name,int_err)
goto 9999
else
if (.not.isaperm(ipsize,iperm)) then
if (.not.psb_isaperm(ipsize,iperm)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,int_err)

@ -70,14 +70,6 @@ subroutine psb_dgelp(trans,iperm,x,info)
end subroutine dgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_dgelp'
@ -101,7 +93,7 @@ subroutine psb_dgelp(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
@ -206,14 +198,6 @@ subroutine psb_dgelpv(trans,iperm,x,info)
end subroutine dgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_dgelpv'
@ -235,7 +219,7 @@ subroutine psb_dgelpv(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)

@ -89,11 +89,11 @@ subroutine psb_dipcoo2csc(a,info,clshr)
if(debug_level >= psb_debug_serial_) write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nc,size(a%ia2),size(iaux)
call psb_transfer(a%ia2,itemp,info)
if (info == 0) call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia2,itemp,info)
if (info == 0) call psb_move_alloc(iaux,a%ia2,info)
if (info /= 0) then
info=4010
call psb_errpush(info,name,a_err='psb_transfer')
call psb_errpush(info,name,a_err='psb_move_alloc')
goto 9999
end if

@ -89,9 +89,9 @@ subroutine psb_dipcoo2csr(a,info,rwshr)
& write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nr,size(a%ia2),size(iaux)
call psb_transfer(a%ia1,itemp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia1,itemp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(iaux,a%ia2,info)
!
! This routine can be used in two modes:

@ -70,9 +70,9 @@ Subroutine psb_dipcsr2coo(a,info)
goto 9999
end if
!!$ write(0,*) 'ipcsr2coo ',a%m
call psb_transfer(a%ia2,itemp,info)
call psb_transfer(a%ia1,a%ia2,info)
call psb_transfer(iaux,a%ia1,info)
call psb_move_alloc(a%ia2,itemp,info)
call psb_move_alloc(a%ia1,a%ia2,info)
call psb_move_alloc(iaux,a%ia1,info)
do i=1, nr
do j=itemp(i),itemp(i+1)-1

@ -46,7 +46,7 @@ subroutine psb_dneigh(a,idx,neigh,n,info,lev)
integer, intent(in) :: idx ! the index whose neighbours we want to find
integer, intent(out) :: n, info ! the number of neighbours and the info
integer, allocatable :: neigh(:) ! the neighbours
integer, optional :: lev ! level of neighbours to find
integer, optional, intent(in) :: lev ! level of neighbours to find
integer :: lev_, i, nl, ifl,ill,&
& n1, err_act, nn, nidx,ntl

@ -68,9 +68,9 @@ subroutine psb_dtransp(a,b,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(b%ia1,itmp,info)
call psb_transfer(b%ia2,b%ia1,info)
call psb_transfer(itmp,b%ia2,info)
call psb_move_alloc(b%ia1,itmp,info)
call psb_move_alloc(b%ia2,b%ia1,info)
call psb_move_alloc(itmp,b%ia2,info)
b%m = a%k
b%k = a%m
@ -111,9 +111,9 @@ subroutine psb_dtransp1(a,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(a%ia1,itmp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(itmp,a%ia2,info)
call psb_move_alloc(a%ia1,itmp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(itmp,a%ia2,info)
call psb_spcnv(a,info,afmt=fmt_)

@ -45,6 +45,7 @@ contains
subroutine csr_sspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
implicit none
@ -159,6 +160,7 @@ contains
subroutine coo_sspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
use psb_error_mod
@ -204,7 +206,7 @@ contains
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo '
do
call ibsrch(ip,irw,nza,a%ia1)
ip = psb_ibsrch(irw,nza,a%ia1)
if (ip /= -1) exit
irw = irw + 1
if (irw > lrw) then
@ -229,7 +231,7 @@ contains
end if
do
call ibsrch(jp,lrw,nza,a%ia1)
jp = psb_ibsrch(lrw,nza,a%ia1)
if (jp /= -1) exit
lrw = lrw - 1
if (irw > lrw) then
@ -335,6 +337,7 @@ contains
subroutine jad_sspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
@ -467,6 +470,7 @@ contains
subroutine csr_dspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
implicit none
@ -581,6 +585,7 @@ contains
subroutine coo_dspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
use psb_error_mod
@ -626,7 +631,7 @@ contains
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo '
do
call ibsrch(ip,irw,nza,a%ia1)
ip = psb_ibsrch(irw,nza,a%ia1)
if (ip /= -1) exit
irw = irw + 1
if (irw > lrw) then
@ -651,7 +656,7 @@ contains
end if
do
call ibsrch(jp,lrw,nza,a%ia1)
jp = psb_ibsrch(lrw,nza,a%ia1)
if (jp /= -1) exit
lrw = lrw - 1
if (irw > lrw) then
@ -757,6 +762,7 @@ contains
subroutine jad_dspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
@ -889,6 +895,7 @@ contains
subroutine csr_cspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
use psb_error_mod
@ -1005,6 +1012,7 @@ contains
subroutine coo_cspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
use psb_error_mod
@ -1052,7 +1060,7 @@ contains
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),': srtdcoo '
do
call ibsrch(ip,irw,nza,a%ia1)
ip = psb_ibsrch(irw,nza,a%ia1)
if (ip /= -1) exit
irw = irw + 1
if (irw > lrw) then
@ -1077,7 +1085,7 @@ contains
end if
do
call ibsrch(jp,lrw,nza,a%ia1)
jp = psb_ibsrch(lrw,nza,a%ia1)
if (jp /= -1) exit
lrw = lrw - 1
if (irw > lrw) then
@ -1183,6 +1191,7 @@ contains
subroutine jad_cspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
implicit none
@ -1314,6 +1323,7 @@ contains
subroutine csr_zspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
use psb_error_mod
@ -1430,6 +1440,7 @@ contains
subroutine coo_zspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
use psb_error_mod
@ -1477,7 +1488,7 @@ contains
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),': srtdcoo '
do
call ibsrch(ip,irw,nza,a%ia1)
ip = psb_ibsrch(irw,nza,a%ia1)
if (ip /= -1) exit
irw = irw + 1
if (irw > lrw) then
@ -1502,7 +1513,7 @@ contains
end if
do
call ibsrch(jp,lrw,nza,a%ia1)
jp = psb_ibsrch(lrw,nza,a%ia1)
if (jp /= -1) exit
lrw = lrw - 1
if (irw > lrw) then
@ -1608,6 +1619,7 @@ contains
subroutine jad_zspgtrow(irw,a,nz,ia,ja,val,nzin,append,lrw,info,iren)
use psb_sort_mod
use psb_spmat_type
use psb_const_mod
implicit none

@ -235,7 +235,7 @@ subroutine psb_scoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
if(info /= izero) then
info=4010
ch_err='psb_sp_transfer'
@ -404,7 +404,7 @@ subroutine psb_scoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
call psb_sp_info(psb_nztotreq_,a,nza,info)
call psb_sp_info(psb_nzsizereq_,a,isza,info)
if(info /= izero) then

@ -47,7 +47,7 @@ function psb_scsnmi(a,info,trans)
function scsnmi(trans,m,n,fida,descra,a,ia1,ia2,&
& infoa,ierror)
use psb_const_mod
real(psb_spk_) :: dcsnmi
real(psb_spk_) :: scsnmi
integer :: m,n, ierror
character :: trans
integer :: ia1(*),ia2(*),infoa(*)

@ -58,8 +58,8 @@ subroutine psb_scsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
character(len=*), optional :: head
integer, intent(in), optional :: ivr(:), ivc(:)
character(len=*), parameter :: frmtr='(2(i6,1x),es16.8,2(i6,1x))'
integer :: irs,ics,i,j
character(len=80) :: frmtv
integer :: irs,ics,i,j, nmx, ni
if (present(eirs)) then
irs = eirs
@ -79,6 +79,12 @@ subroutine psb_scsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
write(iout,'(a,a)') '% ',psb_toupper(a%fida)
endif
nmx = max(a%m,a%k,1)
ni = floor(log10(1.0*nmx)) + 1
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es16.8,1x,2(i',ni,',1x))'
select case(psb_toupper(a%fida))
case ('CSR')
@ -88,32 +94,32 @@ subroutine psb_scsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
endif
@ -126,32 +132,32 @@ subroutine psb_scsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
write(iout,frmtv) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
endif
@ -161,28 +167,28 @@ subroutine psb_scsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if(present(iv)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
write(iout,frmtv) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
enddo
else
if (present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
enddo
else if (present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),a%ia2(j),a%aspk(j)
write(iout,frmtv) a%ia1(j),a%ia2(j),a%aspk(j)
enddo
endif
endif

@ -70,14 +70,6 @@ subroutine psb_sgelp(trans,iperm,x,info)
end subroutine sgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_sgelp'
@ -101,7 +93,7 @@ subroutine psb_sgelp(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
@ -206,14 +198,6 @@ subroutine psb_sgelpv(trans,iperm,x,info)
end subroutine sgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_sgelpv'
@ -235,7 +219,7 @@ subroutine psb_sgelpv(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)

@ -89,11 +89,11 @@ subroutine psb_sipcoo2csc(a,info,clshr)
if(debug_level >= psb_debug_serial_) write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nc,size(a%ia2),size(iaux)
call psb_transfer(a%ia2,itemp,info)
if (info == 0) call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia2,itemp,info)
if (info == 0) call psb_move_alloc(iaux,a%ia2,info)
if (info /= 0) then
info=4010
call psb_errpush(info,name,a_err='psb_transfer')
call psb_errpush(info,name,a_err='psb_move_alloc')
goto 9999
end if

@ -89,9 +89,9 @@ subroutine psb_sipcoo2csr(a,info,rwshr)
& write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nr,size(a%ia2),size(iaux)
call psb_transfer(a%ia1,itemp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia1,itemp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(iaux,a%ia2,info)
!
! This routine can be used in two modes:

@ -69,10 +69,10 @@ Subroutine psb_sipcsr2coo(a,info)
call psb_errpush(info,name,a_err='integer',i_err=(/max(nza,1),0,0,0,0/))
goto 9999
end if
!!$ write(0,*) 'ipcsr2coo ',a%m
call psb_transfer(a%ia2,itemp,info)
call psb_transfer(a%ia1,a%ia2,info)
call psb_transfer(iaux,a%ia1,info)
call psb_move_alloc(a%ia2,itemp,info)
call psb_move_alloc(a%ia1,a%ia2,info)
call psb_move_alloc(iaux,a%ia1,info)
do i=1, nr
do j=itemp(i),itemp(i+1)-1

@ -46,7 +46,7 @@ subroutine psb_sneigh(a,idx,neigh,n,info,lev)
integer, intent(in) :: idx ! the index whose neighbours we want to find
integer, intent(out) :: n, info ! the number of neighbours and the info
integer, allocatable :: neigh(:) ! the neighbours
integer, optional :: lev ! level of neighbours to find
integer, optional, intent(in) :: lev ! level of neighbours to find
integer :: lev_, i, nl, ifl,ill,&
& n1, err_act, nn, nidx,ntl

@ -40,7 +40,7 @@ subroutine psb_stransp(a,b,c,fmt)
use psb_serial_mod, psb_protect_name => psb_stransp
implicit none
type(psb_sspmat_type), intent(inout) :: a
type(psb_sspmat_type), intent(in) :: a
type(psb_sspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
@ -68,9 +68,9 @@ subroutine psb_stransp(a,b,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(b%ia1,itmp,info)
call psb_transfer(b%ia2,b%ia1,info)
call psb_transfer(itmp,b%ia2,info)
call psb_move_alloc(b%ia1,itmp,info)
call psb_move_alloc(b%ia2,b%ia1,info)
call psb_move_alloc(itmp,b%ia2,info)
b%m = a%k
b%k = a%m
@ -111,9 +111,9 @@ subroutine psb_stransp1(a,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(a%ia1,itmp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(itmp,a%ia2,info)
call psb_move_alloc(a%ia1,itmp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(itmp,a%ia2,info)
call psb_spcnv(a,info,afmt=fmt_)

@ -318,7 +318,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -353,7 +353,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -398,7 +398,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -429,7 +429,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -508,7 +508,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -526,7 +526,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -551,7 +551,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -569,7 +569,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -603,7 +603,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -621,7 +621,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -639,7 +639,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -657,7 +657,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -780,7 +780,7 @@ contains
ir = gtl(ir)
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -869,7 +869,7 @@ contains
ir = ia(ii)
ic = ja(ii)
if ((ir >=1).and.(ir<=a%m).and.(ic>=1).and.(ic<=a%k)) then
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -969,7 +969,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1004,7 +1004,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1050,7 +1050,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1081,7 +1081,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1160,7 +1160,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1178,7 +1178,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1203,7 +1203,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1221,7 +1221,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1255,7 +1255,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1273,7 +1273,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1291,7 +1291,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1309,7 +1309,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1432,7 +1432,7 @@ contains
ir = gtl(ir)
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -1521,7 +1521,7 @@ contains
ir = ia(ii)
ic = ja(ii)
if ((ir >=1).and.(ir<=a%m).and.(ic>=1).and.(ic<=a%k)) then
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -1622,7 +1622,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1656,7 +1656,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call issrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_issrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1701,7 +1701,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1732,7 +1732,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1812,7 +1812,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1830,7 +1830,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1855,7 +1855,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1873,7 +1873,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -1907,7 +1907,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1925,7 +1925,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -1943,7 +1943,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -1961,7 +1961,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -2086,7 +2086,7 @@ contains
ir = gtl(ir)
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -2175,7 +2175,7 @@ contains
ir = ia(ii)
ic = ja(ii)
if ((ir >=1).and.(ir<=a%m).and.(ic>=1).and.(ic<=a%k)) then
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -2275,7 +2275,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -2309,7 +2309,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call issrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_issrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -2355,7 +2355,7 @@ contains
i2 = a%ia2(ir+1)
nc=i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -2386,7 +2386,7 @@ contains
i1 = a%ia2(ir)
i2 = a%ia2(ir+1)
nc = i2-i1
call ibsrch(ip,ic,nc,a%ia1(i1:i2-1))
ip = psb_ibsrch(ic,nc,a%ia1(i1:i2-1))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -2466,7 +2466,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -2484,7 +2484,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -2509,7 +2509,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -2527,7 +2527,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -2561,7 +2561,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -2579,7 +2579,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = val(i)
else
@ -2597,7 +2597,7 @@ contains
if ((ir > 0).and.(ir <= a%m)) then
if (ir /= ilr) then
call ibsrch(i1,ir,nnz,a%ia1)
i1 = psb_ibsrch(ir,nnz,a%ia1)
i2 = i1
do
if (i2+1 > nnz) exit
@ -2615,7 +2615,7 @@ contains
i2 = 1
end if
nc = i2-i1+1
call issrch(ip,ic,nc,a%ia2(i1:i2))
ip = psb_issrch(ic,nc,a%ia2(i1:i2))
if (ip>0) then
a%aspk(i1+ip-1) = a%aspk(i1+ip-1) + val(i)
else
@ -2740,7 +2740,7 @@ contains
ir = gtl(ir)
if ((ir > 0).and.(ir <= a%m)) then
ic = gtl(ic)
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)
@ -2829,7 +2829,7 @@ contains
ir = ia(ii)
ic = ja(ii)
if ((ir >=1).and.(ir<=a%m).and.(ic>=1).and.(ic<=a%k)) then
call ibsrch(i,ir,nr,rows)
i = psb_ibsrch(ir,nr,rows)
! find which block the row belongs to
blk = blks(i)

@ -235,7 +235,7 @@ subroutine psb_zcoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
if(info /= izero) then
info=4010
ch_err='psb_sp_transfer'
@ -404,7 +404,7 @@ subroutine psb_zcoins(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl,rebuild)
if (debug_level >= psb_debug_serial_) &
& write(debug_unit,*) trim(name),&
& ': Rebuild size',tmp%infoa(psb_nnz_) ,irst
call psb_sp_transfer(tmp,a,info)
call psb_move_alloc(tmp,a,info)
call psb_sp_info(psb_nztotreq_,a,nza,info)
call psb_sp_info(psb_nzsizereq_,a,isza,info)
if(info /= izero) then

@ -58,8 +58,8 @@ subroutine psb_zcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
character(len=*), optional :: head
integer, intent(in), optional :: ivr(:), ivc(:)
character(len=*), parameter :: frmtr='(2(i6,1x),2(es26.18,1x),2(i6,1x))'
integer :: irs,ics,i,j
character(len=80) :: frmtv
integer :: irs,ics,i,j, nmx, ni
if (present(eirs)) then
irs = eirs
@ -79,6 +79,12 @@ subroutine psb_zcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
write(iout,'(a,a)') '% ',psb_toupper(a%fida)
endif
nmx = max(a%m,a%k,1)
ni = floor(log10(1.0*nmx)) + 1
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
select case(psb_toupper(a%fida))
case ('CSR')
@ -88,32 +94,32 @@ subroutine psb_zcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) iv(irs+i),iv(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) ivr(irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),ivc(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+i),(ics+a%ia1(j)),a%aspk(j)
write(iout,frmtv) (irs+i),(ics+a%ia1(j)),a%aspk(j)
enddo
enddo
endif
@ -126,32 +132,32 @@ subroutine psb_zcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if (present(iv)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
write(iout,frmtv) iv(irs+a%ia1(j)),iv(ics+i),a%aspk(j)
enddo
enddo
else
if (present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
else if (present(ivr).and.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) ivr(irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and.present(ivc)) then
do i=1, a%m
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),ivc(ics+i),a%aspk(j)
enddo
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
do i=1, a%k
do j=a%ia2(i),a%ia2(i+1)-1
write(iout,frmtr) (irs+a%ia1(j)),(ics+i),a%aspk(j)
write(iout,frmtv) (irs+a%ia1(j)),(ics+i),a%aspk(j)
enddo
enddo
endif
@ -161,28 +167,28 @@ subroutine psb_zcsprt(iout,a,iv,eirs,eics,head,ivr,ivc)
if(present(iv)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
write(iout,frmtv) iv(a%ia1(j)),iv(a%ia2(j)),a%aspk(j)
enddo
else
if (present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),a%ia2(j),a%aspk(j)
enddo
else if (present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) ivr(a%ia1(j)),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
write(iout,frmtv) a%ia1(j),ivc(a%ia2(j)),a%aspk(j)
enddo
else if (.not.present(ivr).and..not.present(ivc)) then
write(iout,*) a%m,a%k,a%infoa(psb_nnz_)
do j=1,a%infoa(psb_nnz_)
write(iout,frmtr) a%ia1(j),a%ia2(j),a%aspk(j)
write(iout,frmtv) a%ia1(j),a%ia2(j),a%aspk(j)
enddo
endif
endif

@ -62,15 +62,6 @@ subroutine psb_zcsrp(trans,iperm,a, info)
end subroutine zcsrp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
!...parameters....
type(psb_zspmat_type), intent(inout) :: a
integer, intent(inout) :: iperm(:), info
@ -83,8 +74,9 @@ subroutine psb_zcsrp(trans,iperm,a, info)
character(len=20) :: name, char_err
n_row = psb_get_sp_nrows(a)
n_col = psb_get_sp_ncols(a)
n_row = psb_sp_get_nrows(a)
n_col = psb_sp_get_ncols(a)
if(psb_get_errstatus() /= 0) return
info=0
@ -99,7 +91,7 @@ subroutine psb_zcsrp(trans,iperm,a, info)
call psb_errpush(info,name,int_err)
goto 9999
else
if (.not.isaperm(ipsize,iperm)) then
if (.not.psb_isaperm(ipsize,iperm)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,int_err)

@ -70,14 +70,6 @@ subroutine psb_zgelp(trans,iperm,x,info)
end subroutine zgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_zgelp'
@ -97,7 +89,7 @@ subroutine psb_zgelp(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
@ -205,14 +197,6 @@ subroutine psb_zgelpv(trans,iperm,x,info)
end subroutine zgelp
end interface
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
character(len=20) :: name, ch_err
name = 'psb_zgelpv'
@ -232,7 +216,7 @@ subroutine psb_zgelpv(trans,iperm,x,info)
end if
itemp(:) = iperm(:)
if (.not.isaperm(i1sz,itemp)) then
if (.not.psb_isaperm(i1sz,itemp)) then
info = 70
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)

@ -89,11 +89,11 @@ subroutine psb_zipcoo2csc(a,info,clshr)
if(debug_level >= psb_debug_serial_) write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nc,size(a%ia2),size(iaux)
call psb_transfer(a%ia2,itemp,info)
if (info == 0) call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia2,itemp,info)
if (info == 0) call psb_move_alloc(iaux,a%ia2,info)
if (info /= 0) then
info=4010
call psb_errpush(info,name,a_err='psb_transfer')
call psb_errpush(info,name,a_err='psb_move_alloc')
goto 9999
end if

@ -89,9 +89,9 @@ subroutine psb_zipcoo2csr(a,info,rwshr)
& write(debug_unit,*) trim(name),&
& ': out of fixcoo',nza,nr,size(a%ia2),size(iaux)
call psb_transfer(a%ia1,itemp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(iaux,a%ia2,info)
call psb_move_alloc(a%ia1,itemp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(iaux,a%ia2,info)
!
! This routine can be used in two modes:

@ -69,10 +69,10 @@ Subroutine psb_zipcsr2coo(a,info)
call psb_errpush(info,name,a_err='integer',i_err=(/max(nza,1),0,0,0,0/))
goto 9999
end if
!!$ write(0,*) 'ipcsr2coo ',a%m
call psb_transfer(a%ia2,itemp,info)
call psb_transfer(a%ia1,a%ia2,info)
call psb_transfer(iaux,a%ia1,info)
call psb_move_alloc(a%ia2,itemp,info)
call psb_move_alloc(a%ia1,a%ia2,info)
call psb_move_alloc(iaux,a%ia1,info)
do i=1, nr
do j=itemp(i),itemp(i+1)-1

@ -46,7 +46,7 @@ subroutine psb_zneigh(a,idx,neigh,n,info,lev)
integer, intent(in) :: idx ! the index whose neighbours we want to find
integer, intent(out) :: n, info ! the number of neighbours and the info
integer, allocatable :: neigh(:) ! the neighbours
integer, optional :: lev ! level of neighbours to find
integer, optional, intent(in) :: lev ! level of neighbours to find
integer :: lev_, i, nl, ifl,ill,&
& n1, err_act, nn, nidx,ntl

@ -40,7 +40,7 @@ subroutine psb_ztransc(a,b,c,fmt)
use psb_serial_mod, psb_protect_name => psb_ztransc
implicit none
type(psb_zspmat_type), intent(inout) :: a
type(psb_zspmat_type), intent(in) :: a
type(psb_zspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
@ -68,9 +68,9 @@ subroutine psb_ztransc(a,b,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(b%ia1,itmp,info)
call psb_transfer(b%ia2,b%ia1,info)
call psb_transfer(itmp,b%ia2,info)
call psb_move_alloc(b%ia1,itmp,info)
call psb_move_alloc(b%ia2,b%ia1,info)
call psb_move_alloc(itmp,b%ia2,info)
do i=1, b%infoa(psb_nnz_)
b%aspk(i) = conjg(b%aspk(i))

@ -40,7 +40,7 @@ subroutine psb_ztransp(a,b,c,fmt)
use psb_serial_mod, psb_protect_name => psb_ztransp
implicit none
type(psb_zspmat_type), intent(inout) :: a
type(psb_zspmat_type), intent(in) :: a
type(psb_zspmat_type), intent(out) :: b
integer, optional :: c
character(len=*), optional :: fmt
@ -68,9 +68,9 @@ subroutine psb_ztransp(a,b,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(b%ia1,itmp,info)
call psb_transfer(b%ia2,b%ia1,info)
call psb_transfer(itmp,b%ia2,info)
call psb_move_alloc(b%ia1,itmp,info)
call psb_move_alloc(b%ia2,b%ia1,info)
call psb_move_alloc(itmp,b%ia2,info)
b%m = a%k
b%k = a%m
@ -111,9 +111,9 @@ subroutine psb_ztransp1(a,c,fmt)
write(0,*) 'transp: info from CSDP ',info
return
end if
call psb_transfer(a%ia1,itmp,info)
call psb_transfer(a%ia2,a%ia1,info)
call psb_transfer(itmp,a%ia2,info)
call psb_move_alloc(a%ia1,itmp,info)
call psb_move_alloc(a%ia2,a%ia1,info)
call psb_move_alloc(itmp,a%ia2,info)
call psb_spcnv(a,info,afmt=fmt_)

@ -18,7 +18,7 @@ FOBJS = psb_sallc.o psb_sasb.o \
psb_zspins.o psb_zsprn.o \
psb_cspalloc.o psb_cspasb.o psb_cspfree.o\
psb_callc.o psb_casb.o psb_cfree.o psb_cins.o \
psb_cspins.o psb_csprn.o psb_map.o psb_inter_desc.o psb_cd_set_bld.o
psb_cspins.o psb_csprn.o psb_map.o psb_cd_set_bld.o psb_linmap.o
MPFOBJS = psb_ssphalo.o psb_csphalo.o psb_dsphalo.o psb_zsphalo.o psb_icdasb.o \
psb_dcdbldext.o psb_zcdbldext.o psb_scdbldext.o psb_ccdbldext.o

@ -61,7 +61,6 @@
!
Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
use psb_tools_mod, psb_protect_name => psb_ccdbldext
use psb_serial_mod
use psb_descriptor_type
@ -85,15 +84,6 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
integer, intent(out) :: info
integer, intent(in),optional :: extype
interface
subroutine psb_icdasb(desc_a,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc_a
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
integer icomm, err_act
! .. Local Scalars ..
Integer :: i, j, np, me,m,nnzero,&
@ -103,6 +93,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
integer :: icomm, err_act
type(psb_cspmat_type) :: blk
Integer, allocatable :: tmp_halo(:),tmp_ovr_idx(:), orig_ovr(:)
@ -400,12 +391,6 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
!
Do j=0,n_elem_send-1
!!$ idx = halo(counter+psb_elem_send_+j)
!!$ gidx = desc_ov%loc_to_glob(idx)
!!$ if (idx > psb_cd_get_local_rows(Desc_a)) &
!!$ & write(debug_unit,*) me,' ',trim(name),':Out of local rows ',i_ovr,&
!!$ & idx,psb_cd_get_local_rows(Desc_a)
idx = halo(counter+psb_elem_send_+j)
call psb_map_l2g(idx,gidx,desc_ov%idxmap,info)
If (gidx < 0) then
@ -669,7 +654,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Done Crea_Index'
call psb_barrier(ictxt)
end if
call psb_transfer(t_halo_out,halo,info)
call psb_move_alloc(t_halo_out,halo,info)
!
! At this point we have built the halo necessary for I_OVR+1.
!
@ -688,7 +673,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
! 5. n_col(ov) current.
!
desc_ov%matrix_data(psb_n_row_) = desc_a%matrix_data(psb_n_row_)
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
call psb_ensure_size((counter_h+counter_t+1),tmp_halo,info,pad=-1)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psb_ensure_size')
@ -697,7 +682,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_halo(counter_h:counter_h+counter_t-1) = t_halo_in(1:counter_t)
counter_h = counter_h+counter_t-1
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%halo_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
@ -723,16 +708,15 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
orig_ovr(cntov_o:cntov_o+counter_o-1) = tmp_ovr_idx(1:counter_o)
cntov_o = cntov_o+counter_o-1
orig_ovr(cntov_o:) = -1
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
goto 9999
end if
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%ext_index,info)
call psb_transfer(t_halo_in,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%ext_index,info)
call psb_move_alloc(t_halo_in,desc_ov%halo_index,info)
case default
call psb_errpush(30,name,i_err=(/5,extype_,0,0,0/))
goto 9999

@ -44,16 +44,6 @@ Subroutine psb_cd_lstext(desc_a,in_list,desc_ov,info, mask,extype)
logical, intent(in), optional, target :: mask(:)
integer, intent(in),optional :: extype
interface
subroutine psb_icdasb(desc_a,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc_a
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
integer icomm, err_act
! .. Local Scalars ..
Integer :: i, j, np, me,m,nnzero,&
& ictxt, lovr, lworks,lworkr, n_row,n_col, int_err(5),&
@ -62,6 +52,7 @@ Subroutine psb_cd_lstext(desc_a,in_list,desc_ov,info, mask,extype)
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, nl, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
integer :: icomm, err_act
Integer, allocatable :: tmp_halo(:),tmp_ovr_idx(:), orig_ovr(:)
Integer,allocatable :: halo(:),works(:),workr(:),t_halo_in(:),&

@ -65,9 +65,9 @@ Subroutine psb_cd_reinit(desc,info)
call psb_cd_get_recv_idx(tmp_halo,desc,psb_comm_halo_,info,toglob=.false.)
call psb_cd_get_recv_idx(tmp_ext,desc,psb_comm_ext_,info,toglob=.false.)
call psb_transfer(tmp_ovr,desc%ovrlap_index,info)
call psb_transfer(tmp_halo,desc%halo_index,info)
call psb_transfer(tmp_ext,desc%ext_index,info)
call psb_move_alloc(tmp_ovr,desc%ovrlap_index,info)
call psb_move_alloc(tmp_halo,desc%halo_index,info)
call psb_move_alloc(tmp_ext,desc%ext_index,info)
call psb_cd_set_bld(desc,info)
if (debug_level >= psb_debug_outer_) &

@ -168,9 +168,9 @@ subroutine psb_cdals(m, n, parts, ictxt, desc, info)
!
! Yes, we do have a large index space. Therefore we are
! keeping on the local process a map of only the global
! indices ending up here; this map is stored in an AVL
! tree during the build stage, so as to guarantee log-time
! serch and insertion of new items. At assembly time it
! indices ending up here; this map is stored partly in
! a hash of sorted lists, part in a hash table.
! At assembly time
! is transferred to a series of ordered linear lists,
! hashed by the low order bits of the entries.
!

@ -48,16 +48,12 @@ subroutine psb_cdren(trans,iperm,desc_a,info)
use psb_descriptor_type
use psb_const_mod
use psb_error_mod
use psb_serial_mod
use psb_penv_mod
use psi_mod
use psb_string_mod
implicit none
interface isaperm
logical function isaperm(n,ip)
integer, intent(in) :: n
integer, intent(inout) :: ip(*)
end function isaperm
end interface
!...parameters....
type(psb_desc_type), intent(inout) :: desc_a
@ -74,7 +70,7 @@ subroutine psb_cdren(trans,iperm,desc_a,info)
if(psb_get_errstatus() /= 0) return
info=0
call psb_erractionsave(err_act)
name = 'psb_dcren'
name = 'psb_cdren'
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
@ -99,7 +95,7 @@ subroutine psb_cdren(trans,iperm,desc_a,info)
endif
if (iperm(1) /= 0) then
if (.not.isaperm(n_row,iperm)) then
if (.not.psb_isaperm(n_row,iperm)) then
info = 610
int_err(1) = iperm(1)
call psb_errpush(info,name,int_err)
@ -132,62 +128,24 @@ subroutine psb_cdren(trans,iperm,desc_a,info)
endif
! crossed fingers.....
! fix glob_to_loc/loc_to_glob mappings, then indices lists
! hmm, maybe we should just moe all of this onto a different level,
! hmm, maybe we should just move all of this onto a different level,
! have a specialized subroutine, and do it in the solver context????
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': renumbering glob_to_loc'
do i=1, n_col
desc_a%idxmap%glob_to_loc(desc_a%idxmap%loc_to_glob(desc_a%lprm(i))) = i
enddo
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': renumbering loc_to_glob'
do i=1,psb_cd_get_global_rows(desc_a)
j = desc_a%idxmap%glob_to_loc(i)
if (j>0) then
desc_a%idxmap%loc_to_glob(j) = i
endif
enddo
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': renumbering halo_index'
i=1
kh=desc_a%halo_index(i)
do while (kh /= -1)
i = i+1
nh = desc_a%halo_index(i)
do j = i+1, i+nh
desc_a%halo_index(j) = &
&desc_a%lprm(desc_a%halo_index(j))
enddo
i = i + nh + 1
nh = desc_a%halo_index(i)
do j= i+1, i+nh
desc_a%halo_index(j) = &
&desc_a%lprm(desc_a%halo_index(j))
enddo
i = i + nh + 1
kh=desc_a%halo_index(i)
enddo
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': renumbering ovrlap_index'
i=1
kh=desc_a%ovrlap_index(i)
do while (kh /= -1)
i = i + 1
nh = desc_a%ovrlap_index(i)
do j= i+1, i+nh
desc_a%ovrlap_index(j) = &
&desc_a%lprm(desc_a%ovrlap_index(j))
enddo
i = i + nh + 1
kh=desc_a%ovrlap_index(i)
enddo
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',&
& trim(name),': renumbering ovrlap_elem'
call psi_renum_idxmap(n_col,desc_a%lprm,desc_a%idxmap,info)
if (allocated(desc_a%halo_index)) &
& call psi_renum_index(desc_a%lprm,desc_a%halo_index,info)
if (allocated(desc_a%ovrlap_index)) &
& call psi_renum_index(desc_a%lprm,desc_a%ovrlap_index,info)
if (allocated(desc_a%ovr_mst_idx)) &
& call psi_renum_index(desc_a%lprm,desc_a%ovr_mst_idx,info)
if (allocated(desc_a%ext_index)) &
& call psi_renum_index(desc_a%lprm,desc_a%ext_index,info)
do i=1, size(desc_a%ovrlap_elem,1)
desc_a%ovrlap_elem(i,1) = desc_a%lprm(desc_a%ovrlap_elem(i,1))
end do
do i=1, size(desc_a%bnd_elem)
desc_a%bnd_elem(i) = desc_a%lprm(desc_a%bnd_elem(i))
end do
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': done renumbering'

@ -84,16 +84,6 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
integer, intent(out) :: info
integer, intent(in),optional :: extype
interface
subroutine psb_icdasb(desc_a,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc_a
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
integer icomm, err_act
! .. Local Scalars ..
Integer :: i, j, np, me,m,nnzero,&
& ictxt, lovr, lworks,lworkr, n_row,n_col, int_err(5),&
@ -102,6 +92,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
integer :: icomm, err_act
type(psb_dspmat_type) :: blk
Integer, allocatable :: tmp_halo(:),tmp_ovr_idx(:), orig_ovr(:)
@ -399,12 +390,6 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
!
Do j=0,n_elem_send-1
!!$ idx = halo(counter+psb_elem_send_+j)
!!$ gidx = desc_ov%loc_to_glob(idx)
!!$ if (idx > psb_cd_get_local_rows(Desc_a)) &
!!$ & write(debug_unit,*) me,' ',trim(name),':Out of local rows ',i_ovr,&
!!$ & idx,psb_cd_get_local_rows(Desc_a)
idx = halo(counter+psb_elem_send_+j)
call psb_map_l2g(idx,gidx,desc_ov%idxmap,info)
If (gidx < 0) then
@ -668,7 +653,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Done Crea_Index'
call psb_barrier(ictxt)
end if
call psb_transfer(t_halo_out,halo,info)
call psb_move_alloc(t_halo_out,halo,info)
!
! At this point we have built the halo necessary for I_OVR+1.
!
@ -687,7 +672,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
! 5. n_col(ov) current.
!
desc_ov%matrix_data(psb_n_row_) = desc_a%matrix_data(psb_n_row_)
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
call psb_ensure_size((counter_h+counter_t+1),tmp_halo,info,pad=-1)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psb_ensure_size')
@ -696,7 +681,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_halo(counter_h:counter_h+counter_t-1) = t_halo_in(1:counter_t)
counter_h = counter_h+counter_t-1
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%halo_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
@ -722,16 +707,15 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
orig_ovr(cntov_o:cntov_o+counter_o-1) = tmp_ovr_idx(1:counter_o)
cntov_o = cntov_o+counter_o-1
orig_ovr(cntov_o:) = -1
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
goto 9999
end if
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%ext_index,info)
call psb_transfer(t_halo_in,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%ext_index,info)
call psb_move_alloc(t_halo_in,desc_ov%halo_index,info)
case default
call psb_errpush(30,name,i_err=(/5,extype_,0,0,0/))
goto 9999

@ -135,7 +135,8 @@ subroutine psb_icdasb(desc_a,info,ext_hv)
! the list of halo indices as if it was in small index space
if (psb_is_large_desc(desc_a)) then
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': Large descriptor, calling ldsc_pre_halo'
& write(debug_unit,*) me,' ',trim(name),&
& ': Large descriptor, calling ldsc_pre_halo'
call psi_ldsc_pre_halo(desc_a,ext_hv_,info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='ldsc_pre_halo')
@ -144,9 +145,9 @@ subroutine psb_icdasb(desc_a,info,ext_hv)
end if
! Take out the lists for ovrlap, halo and ext...
call psb_transfer(desc_a%ovrlap_index,ovrlap_index,info)
call psb_transfer(desc_a%halo_index,halo_index,info)
call psb_transfer(desc_a%ext_index,ext_index,info)
call psb_move_alloc(desc_a%ovrlap_index,ovrlap_index,info)
call psb_move_alloc(desc_a%halo_index,halo_index,info)
call psb_move_alloc(desc_a%ext_index,ext_index,info)
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': Final conversion'

@ -1,408 +0,0 @@
!!$
!!$ Parallel Sparse BLAS version 2.2
!!$ (C) Copyright 2006/2007/2008
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
function psb_c_inter_desc(map_kind,desc1, desc2, map_fw, map_bk, idx_fw, idx_bk)
use psb_base_mod, psb_protect_name => psb_c_inter_desc
implicit none
type(psb_inter_desc_type) :: psb_c_inter_desc
type(psb_desc_type), target :: desc1, desc2
type(psb_cspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind,idx_fw(:), idx_bk(:)
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%cmap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%cmap%map_bk,info)
if (info == 0) call psb_safe_cpy(idx_fw,this%exch_fw_idx,info)
if (info == 0) call psb_safe_cpy(idx_bk,this%exch_bk_idx,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_complex_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_c_inter_desc = this
end function psb_c_inter_desc
function psb_c_inter_desc_noidx(map_kind,desc1, desc2, map_fw, map_bk)
use psb_base_mod, psb_protect_name => psb_c_inter_desc_noidx
implicit none
type(psb_inter_desc_type) :: psb_c_inter_desc_noidx
type(psb_desc_type), target :: desc1, desc2
type(psb_cspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
case default
write(0,*) 'Bad map kind into psb_inter_desc ',map_kind
info = 1
end select
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%cmap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%cmap%map_bk,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_complex_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_c_inter_desc_noidx = this
end function psb_c_inter_desc_noidx
function psb_d_inter_desc(map_kind,desc1,desc2,map_fw,map_bk,idx_fw,idx_bk)
use psb_base_mod, psb_protect_name => psb_d_inter_desc
implicit none
type(psb_inter_desc_type) :: psb_d_inter_desc
type(psb_desc_type), target :: desc1, desc2
type(psb_dspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind,idx_fw(:), idx_bk(:)
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%dmap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%dmap%map_bk,info)
if (info == 0) call psb_safe_cpy(idx_fw,this%exch_fw_idx,info)
if (info == 0) call psb_safe_cpy(idx_bk,this%exch_bk_idx,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_double_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_d_inter_desc = this
end function psb_d_inter_desc
function psb_d_inter_desc_noidx(map_kind,desc1, desc2, map_fw, map_bk)
use psb_base_mod, psb_protect_name => psb_d_inter_desc_noidx
implicit none
type(psb_inter_desc_type) :: psb_d_inter_desc_noidx
type(psb_desc_type), target :: desc1, desc2
type(psb_dspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
case default
write(0,*) 'Bad map kind into psb_inter_desc ',map_kind
info = 1
end select
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%dmap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%dmap%map_bk,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_double_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_d_inter_desc_noidx = this
end function psb_d_inter_desc_noidx
function psb_s_inter_desc(map_kind,desc1,desc2,map_fw,map_bk,idx_fw,idx_bk)
use psb_base_mod, psb_protect_name => psb_s_inter_desc
implicit none
type(psb_inter_desc_type) :: psb_s_inter_desc
type(psb_desc_type), target :: desc1, desc2
type(psb_sspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind,idx_fw(:), idx_bk(:)
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%smap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%smap%map_bk,info)
if (info == 0) call psb_safe_cpy(idx_fw,this%exch_fw_idx,info)
if (info == 0) call psb_safe_cpy(idx_bk,this%exch_bk_idx,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_single_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_s_inter_desc = this
end function psb_s_inter_desc
function psb_s_inter_desc_noidx(map_kind,desc1, desc2, map_fw, map_bk)
use psb_base_mod, psb_protect_name => psb_s_inter_desc_noidx
implicit none
type(psb_inter_desc_type) :: psb_s_inter_desc_noidx
type(psb_desc_type), target :: desc1, desc2
type(psb_sspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
case default
write(0,*) 'Bad map kind into psb_inter_desc ',map_kind
info = 1
end select
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%smap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%smap%map_bk,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_single_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_s_inter_desc_noidx = this
end function psb_s_inter_desc_noidx
function psb_z_inter_desc(map_kind,desc1, desc2, map_fw, map_bk, idx_fw, idx_bk)
use psb_base_mod, psb_protect_name => psb_z_inter_desc
implicit none
type(psb_inter_desc_type) :: psb_z_inter_desc
type(psb_desc_type), target :: desc1, desc2
type(psb_zspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind,idx_fw(:), idx_bk(:)
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%zmap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%zmap%map_bk,info)
if (info == 0) call psb_safe_cpy(idx_fw,this%exch_fw_idx,info)
if (info == 0) call psb_safe_cpy(idx_bk,this%exch_bk_idx,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_double_complex_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_z_inter_desc = this
end function psb_z_inter_desc
function psb_z_inter_desc_noidx(map_kind,desc1, desc2, map_fw, map_bk)
use psb_base_mod, psb_protect_name => psb_z_inter_desc_noidx
implicit none
type(psb_inter_desc_type) :: psb_z_inter_desc_noidx
type(psb_desc_type), target :: desc1, desc2
type(psb_zspmat_type), intent(in) :: map_fw, map_bk
integer, intent(in) :: map_kind
!
type(psb_inter_desc_type) :: this
integer :: info
character(len=20), parameter :: name='psb_inter_desc'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
case default
write(0,*) 'Bad map kind into psb_inter_desc ',map_kind
info = 1
end select
if (psb_is_ok_desc(desc1)) then
this%desc_1=>desc1
else
info = 2
endif
if (psb_is_ok_desc(desc2)) then
this%desc_2=>desc2
else
info = 3
endif
if (info == 0) call psb_sp_clone(map_fw,this%zmap%map_fw,info)
if (info == 0) call psb_sp_clone(map_bk,this%zmap%map_bk,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_cd_set_map_kind(map_kind, this)
call psb_cd_set_map_data(psb_map_double_complex_, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
psb_z_inter_desc_noidx = this
end function psb_z_inter_desc_noidx

@ -0,0 +1,345 @@
!!$
!!$ Parallel Sparse BLAS version 2.2
!!$ (C) Copyright 2006/2007/2008
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
function psb_c_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr) result(this)
use psb_base_mod, psb_protect_name => psb_c_linmap
implicit none
type(psb_clinmap_type) :: this
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_cspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
!
integer :: info
character(len=20), parameter :: name='psb_linmap'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_X)) then
this%p_desc_X=>desc_X
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
this%p_desc_Y=>desc_Y
else
info = 3
endif
if (present(iaggr)) then
if (.not.present(naggr)) then
info = 7
else
allocate(this%iaggr(size(iaggr)),&
& this%naggr(size(naggr)), stat=info)
if (info == 0) then
this%iaggr = iaggr
this%naggr = naggr
end if
end if
else
allocate(this%iaggr(0), this%naggr(0), stat=info)
end if
case(psb_map_gen_linear_)
if (psb_is_ok_desc(desc_X)) then
call psb_cdcpy(desc_X, this%desc_X,info)
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
call psb_cdcpy(desc_Y, this%desc_Y,info)
else
info = 3
endif
! For a general linear map ignore iaggr,naggr
allocate(this%iaggr(0), this%naggr(0), stat=info)
case default
write(0,*) 'Bad map kind into psb_linmap ',map_kind
info = 1
end select
if (info == 0) call psb_sp_clone(map_X2Y,this%map_X2Y,info)
if (info == 0) call psb_sp_clone(map_Y2X,this%map_Y2X,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_set_map_kind(map_kind, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
end function psb_c_linmap
function psb_d_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr) result(this)
use psb_base_mod, psb_protect_name => psb_d_linmap
implicit none
type(psb_dlinmap_type) :: this
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_dspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
!
integer :: info
character(len=20), parameter :: name='psb_linmap'
logical, parameter :: debug=.false.
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_X)) then
this%p_desc_X=>desc_X
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
this%p_desc_Y=>desc_Y
else
info = 3
endif
if (present(iaggr)) then
if (.not.present(naggr)) then
info = 7
else
allocate(this%iaggr(size(iaggr)),&
& this%naggr(size(naggr)), stat=info)
if (info == 0) then
this%iaggr = iaggr
this%naggr = naggr
end if
end if
else
allocate(this%iaggr(0), this%naggr(0), stat=info)
end if
case(psb_map_gen_linear_)
if (psb_is_ok_desc(desc_X)) then
call psb_cdcpy(desc_X, this%desc_X,info)
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
call psb_cdcpy(desc_Y, this%desc_Y,info)
else
info = 3
endif
! For a general linear map ignore iaggr,naggr
allocate(this%iaggr(0), this%naggr(0), stat=info)
case default
write(0,*) 'Bad map kind into psb_linmap ',map_kind
info = 1
end select
if (info == 0) call psb_sp_clone(map_X2Y,this%map_X2Y,info)
if (info == 0) call psb_sp_clone(map_Y2X,this%map_Y2X,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_set_map_kind(map_kind, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
if (debug) then
write(0,*) trim(name),' forward map:',allocated(this%map_X2Y%aspk)
write(0,*) trim(name),' backward map:',allocated(this%map_Y2X%aspk)
end if
end function psb_d_linmap
function psb_s_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr) result(this)
use psb_base_mod, psb_protect_name => psb_s_linmap
implicit none
type(psb_slinmap_type) :: this
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_sspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
!
integer :: info
character(len=20), parameter :: name='psb_linmap'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_X)) then
this%p_desc_X=>desc_X
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
this%p_desc_Y=>desc_Y
else
info = 3
endif
if (present(iaggr)) then
if (.not.present(naggr)) then
info = 7
else
allocate(this%iaggr(size(iaggr)),&
& this%naggr(size(naggr)), stat=info)
if (info == 0) then
this%iaggr = iaggr
this%naggr = naggr
end if
end if
else
allocate(this%iaggr(0), this%naggr(0), stat=info)
end if
case(psb_map_gen_linear_)
if (psb_is_ok_desc(desc_X)) then
call psb_cdcpy(desc_X, this%desc_X,info)
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
call psb_cdcpy(desc_Y, this%desc_Y,info)
else
info = 3
endif
! For a general linear map ignore iaggr,naggr
allocate(this%iaggr(0), this%naggr(0), stat=info)
case default
write(0,*) 'Bad map kind into psb_linmap ',map_kind
info = 1
end select
if (info == 0) call psb_sp_clone(map_X2Y,this%map_X2Y,info)
if (info == 0) call psb_sp_clone(map_Y2X,this%map_Y2X,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_set_map_kind(map_kind, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
end function psb_s_linmap
function psb_z_linmap(map_kind,desc_X, desc_Y, map_X2Y, map_Y2X,iaggr,naggr) result(this)
use psb_base_mod, psb_protect_name => psb_z_linmap
implicit none
type(psb_zlinmap_type) :: this
type(psb_desc_type), target :: desc_X, desc_Y
type(psb_zspmat_type), intent(in) :: map_X2Y, map_Y2X
integer, intent(in) :: map_kind
integer, intent(in), optional :: iaggr(:), naggr(:)
!
integer :: info
character(len=20), parameter :: name='psb_linmap'
info = 0
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_X)) then
this%p_desc_X=>desc_X
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
this%p_desc_Y=>desc_Y
else
info = 3
endif
if (present(iaggr)) then
if (.not.present(naggr)) then
info = 7
else
allocate(this%iaggr(size(iaggr)),&
& this%naggr(size(naggr)), stat=info)
if (info == 0) then
this%iaggr = iaggr
this%naggr = naggr
end if
end if
else
allocate(this%iaggr(0), this%naggr(0), stat=info)
end if
case(psb_map_gen_linear_)
if (psb_is_ok_desc(desc_X)) then
call psb_cdcpy(desc_X, this%desc_X,info)
else
info = 2
endif
if (psb_is_ok_desc(desc_Y)) then
call psb_cdcpy(desc_Y, this%desc_Y,info)
else
info = 3
endif
! For a general linear map ignore iaggr,naggr
allocate(this%iaggr(0), this%naggr(0), stat=info)
case default
write(0,*) 'Bad map kind into psb_linmap ',map_kind
info = 1
end select
if (info == 0) call psb_sp_clone(map_X2Y,this%map_X2Y,info)
if (info == 0) call psb_sp_clone(map_Y2X,this%map_Y2X,info)
if (info == 0) call psb_realloc(psb_itd_data_size_,this%itd_data,info)
if (info == 0) then
call psb_set_map_kind(map_kind, this)
end if
if (info /= 0) then
write(0,*) trim(name),' Invalid descriptor input'
return
end if
end function psb_z_linmap

@ -31,14 +31,11 @@
!!$
!!$
!
! Takes a vector X from space desc%desc_1 and maps it onto
! desc%desc_2 under desc%map_fw possibly with communication
! due to exch_fw_idx
!
subroutine psb_s_forward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_s_forward_map
subroutine psb_s_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_s_map_X2Y
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_slinmap_type), intent(in) :: map
real(psb_spk_), intent(in) :: alpha,beta
real(psb_spk_), intent(inout) :: x(:)
real(psb_spk_), intent(out) :: y(:)
@ -46,39 +43,33 @@ subroutine psb_s_forward_map(alpha,x,beta,y,desc,info,work)
real(psb_spk_), optional :: work(:)
!
real(psb_spk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
real(psb_spk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_forward_map'
character(len=20), parameter :: name='psb_map_X2Y'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_fw_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_single_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data', &
& map_data,psb_map_single_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update on the base desc
! and a matrix-vector product.
call psb_halo(x,desc%desc_1,info,work=work)
if (info == 0) call psb_csmm(alpha,desc%smap%map_fw,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_2)) then
ictxt = psb_cd_get_context(desc%desc_2)
nr = psb_cd_get_global_rows(desc%desc_2)
call psb_sum(ictxt,y(1:nr))
ictxt = psb_cd_get_context(map%p_desc_Y)
nr2 = psb_cd_get_global_rows(map%p_desc_Y)
nc2 = psb_cd_get_local_cols(map%p_desc_Y)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_X,info,work=work)
if (info == 0) call psb_csmm(sone,map%map_X2Y,x,szero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
@ -86,9 +77,19 @@ subroutine psb_s_forward_map(alpha,x,beta,y,desc,info,work)
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%smap%map_fw,&
& desc%desc_fw,desc%desc_1,desc%desc_2)
ictxt = psb_cd_get_context(map%desc_Y)
nr1 = psb_cd_get_local_rows(map%desc_X)
nc1 = psb_cd_get_local_cols(map%desc_X)
nr2 = psb_cd_get_global_rows(map%desc_Y)
nc2 = psb_cd_get_local_cols(map%desc_Y)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_X,info,work=work)
if (info == 0) call psb_csmm(sone,map%map_X2Y,xt,szero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
@ -96,24 +97,24 @@ subroutine psb_s_forward_map(alpha,x,beta,y,desc,info,work)
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_s_forward_map
end subroutine psb_s_map_X2Y
!
! Takes a vector X from space desc%desc_2 and maps it onto
! desc%desc_1 under desc%map_bk possibly with communication
! Takes a vector x from space map%p_desc_Y and maps it onto
! map%p_desc_X under map%map_Y2X possibly with communication
! due to exch_bk_idx
!
subroutine psb_s_backward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_s_backward_map
subroutine psb_s_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_s_map_Y2X
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_slinmap_type), intent(in) :: map
real(psb_spk_), intent(in) :: alpha,beta
real(psb_spk_), intent(inout) :: x(:)
real(psb_spk_), intent(out) :: y(:)
@ -121,70 +122,77 @@ subroutine psb_s_backward_map(alpha,x,beta,y,desc,info,work)
real(psb_spk_), optional :: work(:)
!
real(psb_spk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
real(psb_spk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_backward_map'
character(len=20), parameter :: name='psb_map_Y2X'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_bk_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_single_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data',&
& map_data,psb_map_single_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update and a matrix-vector product.
call psb_halo(x,desc%desc_2,info,work=work)
if (info == 0) call psb_csmm(alpha,desc%smap%map_bk,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_1)) then
ictxt = psb_cd_get_context(desc%desc_1)
nr = psb_cd_get_global_rows(desc%desc_1)
call psb_sum(ictxt,y(1:nr))
ictxt = psb_cd_get_context(map%p_desc_X)
nr2 = psb_cd_get_global_rows(map%p_desc_X)
nc2 = psb_cd_get_local_cols(map%p_desc_X)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_Y,info,work=work)
if (info == 0) call psb_csmm(sone,map%map_Y2X,x,szero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%smap%map_bk,&
& desc%desc_bk,desc%desc_2,desc%desc_1)
ictxt = psb_cd_get_context(map%desc_X)
nr1 = psb_cd_get_local_rows(map%desc_Y)
nc1 = psb_cd_get_local_cols(map%desc_Y)
nr2 = psb_cd_get_global_rows(map%desc_X)
nc2 = psb_cd_get_local_cols(map%desc_X)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_Y,info,work=work)
if (info == 0) call psb_csmm(sone,map%map_Y2X,xt,szero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_s_backward_map
end subroutine psb_s_map_Y2X
!
! Takes a vector X from space desc%desc_1 and maps it onto
! desc%desc_2 under desc%map_fw possibly with communication
! Takes a vector x from space map%p_desc_X and maps it onto
! map%p_desc_Y under map%map_X2Y possibly with communication
! due to exch_fw_idx
!
subroutine psb_d_forward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_d_forward_map
subroutine psb_d_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_d_map_X2Y
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_dlinmap_type), intent(in) :: map
real(psb_dpk_), intent(in) :: alpha,beta
real(psb_dpk_), intent(inout) :: x(:)
real(psb_dpk_), intent(out) :: y(:)
@ -192,41 +200,33 @@ subroutine psb_d_forward_map(alpha,x,beta,y,desc,info,work)
real(psb_dpk_), optional :: work(:)
!
real(psb_dpk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
real(psb_dpk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2 ,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_forward_map'
character(len=20), parameter :: name='psb_map_X2Y'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input: unassembled'
info = 1
return
end if
itsz = psb_cd_get_fw_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_double_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data', &
& map_data,psb_map_double_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update on the base desc
! and a matrix-vector product.
call psb_halo(x,desc%desc_1,info,work=work)
if (info == 0) call desc%dmap%map_fw%spmm(alpha,x,beta,y,info)
!!$ if (info == 0) call psb_csmm(alpha,desc%dmap%map_fw,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_2)) then
ictxt = psb_cd_get_context(desc%desc_2)
nr = psb_cd_get_global_rows(desc%desc_2)
call psb_sum(ictxt,y(1:nr))
end if
ictxt = psb_cd_get_context(map%p_desc_Y)
nr2 = psb_cd_get_global_rows(map%p_desc_Y)
nc2 = psb_cd_get_local_cols(map%p_desc_Y)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_X,info,work=work)
if (info == 0) call psb_csmm(done,map%map_X2Y,x,dzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
@ -234,9 +234,19 @@ subroutine psb_d_forward_map(alpha,x,beta,y,desc,info,work)
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%dmap%map_fw,&
& desc%desc_fw,desc%desc_1,desc%desc_2)
ictxt = psb_cd_get_context(map%desc_Y)
nr1 = psb_cd_get_local_rows(map%desc_X)
nc1 = psb_cd_get_local_cols(map%desc_X)
nr2 = psb_cd_get_global_rows(map%desc_Y)
nc2 = psb_cd_get_local_cols(map%desc_Y)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_X,info,work=work)
if (info == 0) call psb_csmm(done,map%map_X2Y,xt,dzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
@ -244,24 +254,25 @@ subroutine psb_d_forward_map(alpha,x,beta,y,desc,info,work)
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input', &
& map_kind, psb_map_aggr_, psb_map_gen_linear_
info = 1
return
end select
end subroutine psb_d_forward_map
end subroutine psb_d_map_X2Y
!
! Takes a vector X from space desc%desc_2 and maps it onto
! desc%desc_1 under desc%map_bk possibly with communication
! Takes a vector x from space map%p_desc_Y and maps it onto
! map%p_desc_X under map%map_Y2X possibly with communication
! due to exch_bk_idx
!
subroutine psb_d_backward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_d_backward_map
subroutine psb_d_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_d_map_Y2X
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_dlinmap_type), intent(in) :: map
real(psb_dpk_), intent(in) :: alpha,beta
real(psb_dpk_), intent(inout) :: x(:)
real(psb_dpk_), intent(out) :: y(:)
@ -269,73 +280,78 @@ subroutine psb_d_backward_map(alpha,x,beta,y,desc,info,work)
real(psb_dpk_), optional :: work(:)
!
real(psb_dpk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
real(psb_dpk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_backward_map'
character(len=20), parameter :: name='psb_map_Y2X'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_bk_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_double_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data',&
& map_data,psb_map_double_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update and a matrix-vector product.
call psb_halo(x,desc%desc_2,info,work=work)
!!$ if (info == 0) call psb_csmm(alpha,desc%dmap%map_bk,x,beta,y,info)
if (info == 0) call desc%dmap%map_bk%spmm(alpha,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_1)) then
ictxt = psb_cd_get_context(desc%desc_1)
nr = psb_cd_get_global_rows(desc%desc_1)
call psb_sum(ictxt,y(1:nr))
end if
ictxt = psb_cd_get_context(map%p_desc_X)
nr2 = psb_cd_get_global_rows(map%p_desc_X)
nc2 = psb_cd_get_local_cols(map%p_desc_X)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_Y,info,work=work)
if (info == 0) call psb_csmm(done,map%map_Y2X,x,dzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%dmap%map_bk,&
& desc%desc_bk,desc%desc_2,desc%desc_1)
ictxt = psb_cd_get_context(map%desc_X)
nr1 = psb_cd_get_local_rows(map%desc_Y)
nc1 = psb_cd_get_local_cols(map%desc_Y)
nr2 = psb_cd_get_global_rows(map%desc_X)
nc2 = psb_cd_get_local_cols(map%desc_X)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_Y,info,work=work)
if (info == 0) call psb_csmm(done,map%map_Y2X,xt,dzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_d_backward_map
end subroutine psb_d_map_Y2X
!
! Takes a vector X from space desc%desc_1 and maps it onto
! desc%desc_2 under desc%map_fw possibly with communication
! Takes a vector x from space map%p_desc_X and maps it onto
! map%p_desc_Y under map%map_X2Y possibly with communication
! due to exch_fw_idx
!
subroutine psb_c_forward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_c_forward_map
subroutine psb_c_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_c_map_X2Y
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_clinmap_type), intent(in) :: map
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(inout) :: x(:)
complex(psb_spk_), intent(out) :: y(:)
@ -343,72 +359,78 @@ subroutine psb_c_forward_map(alpha,x,beta,y,desc,info,work)
complex(psb_spk_), optional :: work(:)
!
complex(psb_spk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
complex(psb_spk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_forward_map'
character(len=20), parameter :: name='psb_map_X2Y'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_fw_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_complex_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data',&
& map_data,psb_map_complex_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update and a matrix-vector product.
call psb_halo(x,desc%desc_1,info,work=work)
if (info == 0) call psb_csmm(alpha,desc%cmap%map_fw,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_2)) then
ictxt = psb_cd_get_context(desc%desc_2)
nr = psb_cd_get_global_rows(desc%desc_2)
call psb_sum(ictxt,y(1:nr))
end if
ictxt = psb_cd_get_context(map%p_desc_Y)
nr2 = psb_cd_get_global_rows(map%p_desc_Y)
nc2 = psb_cd_get_local_cols(map%p_desc_Y)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_X,info,work=work)
if (info == 0) call psb_csmm(cone,map%map_X2Y,x,czero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%cmap%map_fw,&
& desc%desc_fw,desc%desc_1,desc%desc_2)
ictxt = psb_cd_get_context(map%desc_Y)
nr1 = psb_cd_get_local_rows(map%desc_X)
nc1 = psb_cd_get_local_cols(map%desc_X)
nr2 = psb_cd_get_global_rows(map%desc_Y)
nc2 = psb_cd_get_local_cols(map%desc_Y)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_X,info,work=work)
if (info == 0) call psb_csmm(cone,map%map_X2Y,xt,czero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_c_forward_map
end subroutine psb_c_map_X2Y
!
! Takes a vector X from space desc%desc_2 and maps it onto
! desc%desc_1 under desc%map_bk possibly with communication
! Takes a vector x from space map%p_desc_Y and maps it onto
! map%p_desc_X under map%map_Y2X possibly with communication
! due to exch_bk_idx
!
subroutine psb_c_backward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_c_backward_map
subroutine psb_c_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_c_map_Y2X
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_clinmap_type), intent(in) :: map
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(inout) :: x(:)
complex(psb_spk_), intent(out) :: y(:)
@ -416,73 +438,78 @@ subroutine psb_c_backward_map(alpha,x,beta,y,desc,info,work)
complex(psb_spk_), optional :: work(:)
!
complex(psb_spk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
complex(psb_spk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_backward_map'
character(len=20), parameter :: name='psb_map_Y2X'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_bk_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_complex_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data',&
& map_data,psb_map_complex_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update and a matrix-vector product.
call psb_halo(x,desc%desc_2,info,work=work)
if (info == 0) call psb_csmm(alpha,desc%cmap%map_bk,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_1)) then
ictxt = psb_cd_get_context(desc%desc_1)
nr = psb_cd_get_global_rows(desc%desc_1)
call psb_sum(ictxt,y(1:nr))
end if
ictxt = psb_cd_get_context(map%p_desc_X)
nr2 = psb_cd_get_global_rows(map%p_desc_X)
nc2 = psb_cd_get_local_cols(map%p_desc_X)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_Y,info,work=work)
if (info == 0) call psb_csmm(cone,map%map_Y2X,x,czero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%cmap%map_bk,&
& desc%desc_bk,desc%desc_2,desc%desc_1)
ictxt = psb_cd_get_context(map%desc_X)
nr1 = psb_cd_get_local_rows(map%desc_Y)
nc1 = psb_cd_get_local_cols(map%desc_Y)
nr2 = psb_cd_get_global_rows(map%desc_X)
nc2 = psb_cd_get_local_cols(map%desc_X)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_Y,info,work=work)
if (info == 0) call psb_csmm(cone,map%map_Y2X,xt,czero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_c_backward_map
end subroutine psb_c_map_Y2X
!
! Takes a vector X from space desc%desc_1 and maps it onto
! desc%desc_2 under desc%map_fw possibly with communication
! Takes a vector x from space map%p_desc_X and maps it onto
! map%p_desc_Y under map%map_X2Y possibly with communication
! due to exch_fw_idx
!
subroutine psb_z_forward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_z_forward_map
subroutine psb_z_map_X2Y(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_z_map_X2Y
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_zlinmap_type), intent(in) :: map
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(inout) :: x(:)
complex(psb_dpk_), intent(out) :: y(:)
@ -490,71 +517,78 @@ subroutine psb_z_forward_map(alpha,x,beta,y,desc,info,work)
complex(psb_dpk_), optional :: work(:)
!
complex(psb_dpk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
complex(psb_dpk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_forward_map'
character(len=20), parameter :: name='psb_map_X2Y'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_fw_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_double_complex_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data',&
& map_data,psb_map_double_complex_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update and a matrix-vector product.
call psb_halo(x,desc%desc_1,info,work=work)
if (info == 0) call psb_csmm(alpha,desc%zmap%map_fw,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_2)) then
ictxt = psb_cd_get_context(desc%desc_2)
nr = psb_cd_get_global_rows(desc%desc_2)
call psb_sum(ictxt,y(1:nr))
ictxt = psb_cd_get_context(map%p_desc_Y)
nr2 = psb_cd_get_global_rows(map%p_desc_Y)
nc2 = psb_cd_get_local_cols(map%p_desc_Y)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_X,info,work=work)
if (info == 0) call psb_csmm(zone,map%map_X2Y,x,zzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%zmap%map_fw,&
& desc%desc_fw,desc%desc_1,desc%desc_2)
ictxt = psb_cd_get_context(map%desc_Y)
nr1 = psb_cd_get_local_rows(map%desc_X)
nc1 = psb_cd_get_local_cols(map%desc_X)
nr2 = psb_cd_get_global_rows(map%desc_Y)
nc2 = psb_cd_get_local_cols(map%desc_Y)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_X,info,work=work)
if (info == 0) call psb_csmm(zone,map%map_X2Y,xt,zzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_Y)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_Y,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_z_forward_map
end subroutine psb_z_map_X2Y
!
! Takes a vector X from space desc%desc_2 and maps it onto
! desc%desc_1 under desc%map_bk possibly with communication
! Takes a vector x from space map%p_desc_Y and maps it onto
! map%p_desc_X under map%map_Y2X possibly with communication
! due to exch_bk_idx
!
subroutine psb_z_backward_map(alpha,x,beta,y,desc,info,work)
use psb_base_mod, psb_protect_name => psb_z_backward_map
subroutine psb_z_map_Y2X(alpha,x,beta,y,map,info,work)
use psb_base_mod, psb_protect_name => psb_z_map_Y2X
implicit none
type(psb_inter_desc_type), intent(in) :: desc
type(psb_zlinmap_type), intent(in) :: map
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(inout) :: x(:)
complex(psb_dpk_), intent(out) :: y(:)
@ -562,160 +596,65 @@ subroutine psb_z_backward_map(alpha,x,beta,y,desc,info,work)
complex(psb_dpk_), optional :: work(:)
!
complex(psb_dpk_), allocatable :: xt(:)
integer :: itsz, i, j,totxch,totsnd,totrcv,&
complex(psb_dpk_), allocatable :: xt(:), yt(:)
integer :: i, j, nr1, nc1,nr2, nc2,&
& map_kind, map_data, nr, ictxt
character(len=20), parameter :: name='psb_backward_map'
character(len=20), parameter :: name='psb_map_Y2X'
info = 0
if (.not.psb_is_asb_desc(desc)) then
write(0,*) trim(name),' Invalid descriptor inupt'
if (.not.psb_is_asb_map(map)) then
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end if
itsz = psb_cd_get_bk_tmp_sz(desc)
map_kind = psb_cd_get_map_kind(desc)
map_data = psb_cd_get_map_data(desc)
if (map_data /= psb_map_double_complex_) then
write(0,*) trim(name),' Invalid descriptor inupt: map_data',&
& map_data,psb_map_double_complex_
info = 1
return
endif
map_kind = psb_get_map_kind(map)
select case(map_kind)
case(psb_map_aggr_)
! Ok, we just need to call a halo update and a matrix-vector product.
call psb_halo(x,desc%desc_2,info,work=work)
if (info == 0) call psb_csmm(alpha,desc%zmap%map_bk,x,beta,y,info)
if ((info == 0) .and. psb_is_repl_desc(desc%desc_1)) then
ictxt = psb_cd_get_context(desc%desc_1)
nr = psb_cd_get_global_rows(desc%desc_1)
call psb_sum(ictxt,y(1:nr))
end if
ictxt = psb_cd_get_context(map%p_desc_X)
nr2 = psb_cd_get_global_rows(map%p_desc_X)
nc2 = psb_cd_get_local_cols(map%p_desc_X)
allocate(yt(nc2),stat=info)
if (info == 0) call psb_halo(x,map%p_desc_Y,info,work=work)
if (info == 0) call psb_csmm(zone,map%map_Y2X,x,zzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%p_desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case(psb_map_gen_linear_)
call psb_linmap(alpha,x,beta,y,desc%zmap%map_bk,&
& desc%desc_bk,desc%desc_2,desc%desc_1)
ictxt = psb_cd_get_context(map%desc_X)
nr1 = psb_cd_get_local_rows(map%desc_Y)
nc1 = psb_cd_get_local_cols(map%desc_Y)
nr2 = psb_cd_get_global_rows(map%desc_X)
nc2 = psb_cd_get_local_cols(map%desc_X)
allocate(xt(nc1),yt(nc2),stat=info)
xt(1:nr1) = x(1:nr1)
if (info == 0) call psb_halo(xt,map%desc_Y,info,work=work)
if (info == 0) call psb_csmm(zone,map%map_Y2X,xt,zzero,yt,info)
if ((info == 0) .and. psb_is_repl_desc(map%desc_X)) then
call psb_sum(ictxt,yt(1:nr2))
end if
if (info == 0) call psb_geaxpby(alpha,yt,beta,y,map%desc_X,info)
if (info /= 0) then
write(0,*) trim(name),' Error from inner routines',info
info = -1
end if
case default
write(0,*) trim(name),' Invalid descriptor inupt'
write(0,*) trim(name),' Invalid descriptor input'
info = 1
return
end select
end subroutine psb_z_backward_map
subroutine psb_s_apply_linmap(alpha,x,beta,y,a_map,cd_xt,descin,descout)
use psb_base_mod, psb_protect_name => psb_s_apply_linmap
implicit none
real(psb_spk_), intent(in) :: alpha,beta
real(psb_spk_), intent(inout) :: x(:),y(:)
type(psb_sspmat_type), intent(in) :: a_map
type(psb_desc_type), intent(in) :: cd_xt,descin, descout
integer :: nrt, nct, info
real(psb_spk_), allocatable :: tmp(:)
nrt = psb_cd_get_local_rows(cd_xt)
nct = psb_cd_get_local_cols(cd_xt)
allocate(tmp(nct),stat=info)
if (info == 0) tmp(1:nrt) = x(1:nrt)
if (info == 0) call psb_halo(tmp,cd_xt,info)
if (info == 0) call psb_csmm(alpha,a_map,tmp,beta,y,info)
if (info /= 0) then
write(0,*) 'Error in apply_map'
endif
end subroutine psb_s_apply_linmap
subroutine psb_d_apply_linmap(alpha,x,beta,y,a_map,cd_xt,descin,descout)
use psb_base_mod, psb_protect_name => psb_d_apply_linmap
end subroutine psb_z_map_Y2X
implicit none
real(psb_dpk_), intent(in) :: alpha,beta
real(psb_dpk_), intent(inout) :: x(:),y(:)
type(psb_dspmat_type), intent(in) :: a_map
type(psb_desc_type), intent(in) :: cd_xt,descin, descout
integer :: nrt, nct, info
real(psb_dpk_), allocatable :: tmp(:)
nrt = psb_cd_get_local_rows(cd_xt)
nct = psb_cd_get_local_cols(cd_xt)
allocate(tmp(nct),stat=info)
if (info == 0) tmp(1:nrt) = x(1:nrt)
if (info == 0) call psb_halo(tmp,cd_xt,info)
if (info == 0) call a_map%spmm(alpha,tmp,beta,y,info)
!!$ if (info == 0) call psb_csmm(alpha,a_map,tmp,beta,y,info)
if (info /= 0) then
write(0,*) 'Error in apply_map'
endif
end subroutine psb_d_apply_linmap
subroutine psb_c_apply_linmap(alpha,x,beta,y,a_map,cd_xt,descin,descout)
use psb_base_mod, psb_protect_name => psb_c_apply_linmap
implicit none
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(inout) :: x(:),y(:)
type(psb_cspmat_type), intent(in) :: a_map
type(psb_desc_type), intent(in) :: cd_xt,descin, descout
integer :: nrt, nct, info
complex(psb_spk_), allocatable :: tmp(:)
nrt = psb_cd_get_local_rows(cd_xt)
nct = psb_cd_get_local_cols(cd_xt)
allocate(tmp(nct),stat=info)
if (info == 0) tmp(1:nrt) = x(1:nrt)
if (info == 0) call psb_halo(tmp,cd_xt,info)
if (info == 0) call psb_csmm(alpha,a_map,tmp,beta,y,info)
if (info /= 0) then
write(0,*) 'Error in apply_map'
endif
end subroutine psb_c_apply_linmap
subroutine psb_z_apply_linmap(alpha,x,beta,y,a_map,cd_xt,descin,descout)
use psb_base_mod, psb_protect_name => psb_z_apply_linmap
implicit none
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(inout) :: x(:),y(:)
type(psb_zspmat_type), intent(in) :: a_map
type(psb_desc_type), intent(in) :: cd_xt,descin, descout
integer :: nrt, nct, info
complex(psb_dpk_), allocatable :: tmp(:)
nrt = psb_cd_get_local_rows(cd_xt)
nct = psb_cd_get_local_cols(cd_xt)
allocate(tmp(nct),stat=info)
if (info == 0) tmp(1:nrt) = x(1:nrt)
if (info == 0) call psb_halo(tmp,cd_xt,info)
if (info == 0) call psb_csmm(alpha,a_map,tmp,beta,y,info)
if (info /= 0) then
write(0,*) 'Error in apply_map'
endif
end subroutine psb_z_apply_linmap

@ -84,16 +84,6 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
integer, intent(out) :: info
integer, intent(in),optional :: extype
interface
subroutine psb_icdasb(desc_a,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc_a
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
integer icomm, err_act
! .. Local Scalars ..
Integer :: i, j, np, me,m,nnzero,&
& ictxt, lovr, lworks,lworkr, n_row,n_col, int_err(5),&
@ -102,6 +92,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
integer :: icomm, err_act
type(psb_sspmat_type) :: blk
Integer, allocatable :: tmp_halo(:),tmp_ovr_idx(:), orig_ovr(:)
@ -399,12 +390,6 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
!
Do j=0,n_elem_send-1
!!$ idx = halo(counter+psb_elem_send_+j)
!!$ gidx = desc_ov%loc_to_glob(idx)
!!$ if (idx > psb_cd_get_local_rows(Desc_a)) &
!!$ & write(debug_unit,*) me,' ',trim(name),':Out of local rows ',i_ovr,&
!!$ & idx,psb_cd_get_local_rows(Desc_a)
idx = halo(counter+psb_elem_send_+j)
call psb_map_l2g(idx,gidx,desc_ov%idxmap,info)
If (gidx < 0) then
@ -668,7 +653,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Done Crea_Index'
call psb_barrier(ictxt)
end if
call psb_transfer(t_halo_out,halo,info)
call psb_move_alloc(t_halo_out,halo,info)
!
! At this point we have built the halo necessary for I_OVR+1.
!
@ -687,7 +672,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
! 5. n_col(ov) current.
!
desc_ov%matrix_data(psb_n_row_) = desc_a%matrix_data(psb_n_row_)
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
call psb_ensure_size((counter_h+counter_t+1),tmp_halo,info,pad=-1)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psb_ensure_size')
@ -696,7 +681,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_halo(counter_h:counter_h+counter_t-1) = t_halo_in(1:counter_t)
counter_h = counter_h+counter_t-1
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%halo_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
@ -722,16 +707,15 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
orig_ovr(cntov_o:cntov_o+counter_o-1) = tmp_ovr_idx(1:counter_o)
cntov_o = cntov_o+counter_o-1
orig_ovr(cntov_o:) = -1
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
goto 9999
end if
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%ext_index,info)
call psb_transfer(t_halo_in,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%ext_index,info)
call psb_move_alloc(t_halo_in,desc_ov%halo_index,info)
case default
call psb_errpush(30,name,i_err=(/5,extype_,0,0,0/))
goto 9999

@ -84,16 +84,6 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
integer, intent(out) :: info
integer, intent(in),optional :: extype
interface
subroutine psb_icdasb(desc_a,info,ext_hv)
use psb_descriptor_type
Type(psb_desc_type), intent(inout) :: desc_a
integer, intent(out) :: info
logical, intent(in),optional :: ext_hv
end subroutine psb_icdasb
end interface
integer icomm, err_act
! .. Local Scalars ..
Integer :: i, j, np, me,m,nnzero,&
& ictxt, lovr, lworks,lworkr, n_row,n_col, int_err(5),&
@ -102,6 +92,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
integer icomm, err_act
type(psb_zspmat_type) :: blk
Integer, allocatable :: tmp_halo(:),tmp_ovr_idx(:), orig_ovr(:)
@ -399,12 +390,6 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
!
Do j=0,n_elem_send-1
!!$ idx = halo(counter+psb_elem_send_+j)
!!$ gidx = desc_ov%loc_to_glob(idx)
!!$ if (idx > psb_cd_get_local_rows(Desc_a)) &
!!$ & write(debug_unit,*) me,' ',trim(name),':Out of local rows ',i_ovr,&
!!$ & idx,psb_cd_get_local_rows(Desc_a)
idx = halo(counter+psb_elem_send_+j)
call psb_map_l2g(idx,gidx,desc_ov%idxmap,info)
If (gidx < 0) then
@ -668,7 +653,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Done Crea_Index'
call psb_barrier(ictxt)
end if
call psb_transfer(t_halo_out,halo,info)
call psb_move_alloc(t_halo_out,halo,info)
!
! At this point we have built the halo necessary for I_OVR+1.
!
@ -687,7 +672,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
! 5. n_col(ov) current.
!
desc_ov%matrix_data(psb_n_row_) = desc_a%matrix_data(psb_n_row_)
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
call psb_ensure_size((counter_h+counter_t+1),tmp_halo,info,pad=-1)
if (info /= 0) then
call psb_errpush(4010,name,a_err='psb_ensure_size')
@ -696,7 +681,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_halo(counter_h:counter_h+counter_t-1) = t_halo_in(1:counter_t)
counter_h = counter_h+counter_t-1
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%halo_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
@ -722,16 +707,15 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
orig_ovr(cntov_o:cntov_o+counter_o-1) = tmp_ovr_idx(1:counter_o)
cntov_o = cntov_o+counter_o-1
orig_ovr(cntov_o:) = -1
call psb_transfer(orig_ovr,desc_ov%ovrlap_index,info)
call psb_move_alloc(orig_ovr,desc_ov%ovrlap_index,info)
deallocate(tmp_ovr_idx,stat=info)
if (info /= 0) then
call psb_errpush(4010,name,a_err='deallocate')
goto 9999
end if
tmp_halo(counter_h:) = -1
call psb_transfer(tmp_halo,desc_ov%ext_index,info)
call psb_transfer(t_halo_in,desc_ov%halo_index,info)
call psb_move_alloc(tmp_halo,desc_ov%ext_index,info)
call psb_move_alloc(t_halo_in,desc_ov%halo_index,info)
case default
call psb_errpush(30,name,i_err=(/5,extype_,0,0,0/))
goto 9999

@ -136,7 +136,7 @@ rm -f conftest*])
dnl @synopsis PAC_HAVE_MODERN_GCC( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl @synopsis PAC_HAVE_MODERN_GFORTRAN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Will check if the GNU fortran version is suitable for PSBLAS.
dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
@ -145,16 +145,16 @@ dnl Note : Will use MPIFC; if unset, will use '$FC'.
dnl
dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl
AC_DEFUN(PAC_HAVE_MODERN_GCC,
AC_DEFUN(PAC_HAVE_MODERN_GFORTRAN,
ac_exeext=''
ac_ext='F'
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
dnl Warning : square brackets are EVIL!
[
[AC_MSG_CHECKING([GNU Fortran version at least 4.3])
cat > conftest.$ac_ext <<EOF
program main
#if ( __GNUC__ >= 4 && __GNUC_MINOR__ >= 2 ) || ( __GNUC__ > 4 )
print *, "ciao"
#if ( __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 ) || ( __GNUC__ > 4 )
print *, "ok"
#else
this program will fail
#endif
@ -162,9 +162,11 @@ cat > conftest.$ac_ext <<EOF
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
AC_MSG_RESULT([ yes.])
ifelse([$1], , :, [rm -rf conftest*
$1])
else
AC_MSG_RESULT([ no.])
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
ifelse([$2], , , [ rm -rf conftest*

16838
configure vendored

File diff suppressed because it is too large Load Diff

@ -22,8 +22,6 @@ dnl SEE : --module-path --include-path
dnl NOTE : There is no cross compilation support.
dnl NOTE : missing ifort and kl* library handling..
dnl NOTE : odd configurations like ifc + gcc still await in the mist of the unknown
###############################################################################
@ -38,11 +36,11 @@ dnl NOTE : odd configurations like ifc + gcc still await in the mist of the unkn
###############################################################################
# NOTE: the literal for version (the second argument to AC_INIT should be a literal!)
AC_INIT([PSBLAS],2.2, salvatore.filippone@uniroma2.it)
AC_INIT([PSBLAS],3.0, salvatore.filippone@uniroma2.it)
# VERSION is the file containing the PSBLAS version code
# FIXME
psblas_cv_version="`cat VERSION`"
psblas_cv_version="3.0"
# A sample source file
AC_CONFIG_SRCDIR([base/modules/psb_base_mod.f90])
@ -58,11 +56,8 @@ AC_MSG_NOTICE([
documentation, you can make your own by hand for your needs.
Be sure to specify the library paths of your interest. Examples:
./configure CFLAGS=-L/some/directory/LIB <- will force CFLAGS
CFLAGS=-L/some/directory/LIB ./configure <- will force CFLAGS
./configure --with-cflags=-L/some/directory/LIB <- will append to CFLAGS
./configure --with-libs=-L/some/directory/LIB <- will append to LIBS
FC=mpif90 F77=$FC CC=mpicc ./configure <- will force FC,CC,F77
FLINK=gcc FLINK=gcc ./configure <- will force FLINK,F90LINK
See ./configure --help=short fore more info.
--------------------------------------------------------------------------------
@ -97,9 +92,9 @@ AC_MSG_RESULT([$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR
# Note that the following line won't save from troubles.
# AC_PROG_FC([mpxlf95 mpxlf90 mpxlf pgf95 pgf90 mpif95 mpif90 gfortran f95 f90 ifc])
AC_PROG_FC([xlf95 xlf90 xlf pgf95 pgf90 ifort ifc gfortran])
AC_PROG_FC([xlf95 xlf90 xlf pgf95 pgf90 ifort ifc nagfor gfortran])
#AC_PROG_FC
AC_PROG_F77([xlf pgf77 ifort ifc gfortran])
AC_PROG_F77([xlf pgf77 ifort ifc nagfor gfortran])
AC_PROG_CC([xlc pgcc icc gcc ])
dnl AC_PROG_CXX
@ -125,14 +120,14 @@ fi
AC_LANG([C])
if test "X$MPICC" = "X" ; then
# This is our MPICC compiler preference: it will override ACX_MPI's first try.
AC_CHECK_PROGS([MPICC],[mpxlc mpcc pgcc mpicc])
AC_CHECK_PROGS([MPICC],[mpxlc mpcc mpicc])
fi
ACX_MPI([], [AC_MSG_ERROR([[Cannot find any suitable MPI implementation for C]])])
AC_LANG(Fortran 77)
if test "X$MPIF77" = "X" ; then
# This is our MPIFC compiler preference: it will override ACX_MPI's first try.
AC_CHECK_PROGS([MPIF77],[mpxlf mpif77 pgf77 mpf77 ifc])
AC_CHECK_PROGS([MPIF77],[mpxlf mpf77 mpif77])
fi
ACX_MPI([], [AC_MSG_ERROR([[Cannot find any suitable MPI implementation for Fortran 77]])])
@ -140,7 +135,7 @@ AC_LANG([Fortran])
if test "X$MPIFC" = "X" ; then
# This is our MPIFC compiler preference: it will override ACX_MPI's first try.
AC_CHECK_PROGS([MPIFC],[mpxlf95 mpxlf90 mpif95 mpif90 pgf95 pg90 mpf95 mpf90 ifc ])
AC_CHECK_PROGS([MPIFC],[mpxlf95 mpxlf90 mpf95 mpf90 mpif95 mpif90 ])
fi
ACX_MPI([], [AC_MSG_ERROR([[Cannot find any suitable MPI implementation for Fortran]])])
@ -168,9 +163,9 @@ fi
###############################################################################
dnl NOTE : no spaces before the comma, and no brackets before the second argument!
PAC_ARG_WITH_FLAGS(ccflags,CCFLAGS)
PAC_ARG_WITH_FLAGS(cflags,CFLAGS)
PAC_ARG_WITH_FLAGS(fflags,FFLAGS)
PAC_ARG_WITH_FLAGS(ccopt,CCOPT)
PAC_ARG_WITH_FLAGS(fcopt,FCOPT)
PAC_ARG_WITH_FLAGS(f90copt,F90COPT)
#PAC_ARG_WITH_FLAGS(ldflags,LDFLAGS)
PAC_ARG_WITH_LIBS
PAC_ARG_WITH_FLAGS(clibs,CLIBS)
@ -213,10 +208,9 @@ PAC_CHECK_HAVE_GFORTRAN(
# Test for TR 15581, aka allocatables extensions.
#
PAC_FORTRAN_TEST_TR15581(
[AC_MSG_RESULT([yes.])],
[AC_MSG_ERROR([no.
Sorry, cannot build PSBLAS without support for TR15581.
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.2.])]
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for TR15581.
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.3.])]
)
if test x"$psblas_cv_fc" == "x" ; then
@ -225,30 +219,41 @@ if test x"$psblas_cv_fc" == "x" ; then
# Some configurations of the XLF want "-WF," prepended to -D.. flags.
# TODO : discover the exact conditions when the usage of -WF is needed.
psblas_cv_define_prepend="-WF,"
# Note : there coule be problems with old xlf compiler versions ( <10.1 )
if eval "$MPIFC -qversion 2>&1 | grep -e\"Version: 10\.\" 2>/dev/null"; then
FDEFINES="$psblas_cv_define_prepend-DXLF_10 $FDEFINES"
fi
# Note : there could be problems with old xlf compiler versions ( <10.1 )
# since (as far as it is known to us) -WF, is not used in earlier versions.
# More problems could be undocumented yet.
else
elif eval "$MPIFC -V 2>&1 | grep Sun 2>/dev/null" ; then
# Sun compiler detection
if eval "$MPIFC -V 2>&1 | grep Sun 2>/dev/null" ; then
psblas_cv_fc="sun"
else
elif eval "$MPIFC -V 2>&1 | grep Portland 2>/dev/null" ; then
# Portland group compiler detection
if eval "$MPIFC -V 2>&1 | grep Portland 2>/dev/null" ; then
psblas_cv_fc="pg"
else
elif eval "$MPIFC -V 2>&1 | grep Intel.*Fortran.*Compiler 2>/dev/null" ; then
# Intel compiler identification
if eval "$MPIFC -V 2>&1 | grep Intel.*Fortran.*Compiler 2>/dev/null" ; then
psblas_cv_fc="ifc"
elif eval "$MPIFC -v 2>&1 | grep NAG 2>/dev/null" ; then
psblas_cv_fc="nag"
FC="$MPIFC"
F77="$MPIFC"
else
psblas_cv_fc=""
# unsupported MPI Fortran compiler
AC_MSG_ERROR([[Unknown compiler ! Make sure your Fortran compiler is specified as compatible in the documentation!]])
fi
fi
fi
AC_MSG_NOTICE([[Unknown Fortran compiler, proceeding with fingers crossed !]])
fi
fi
if test "X$psblas_cv_fc" == "Xgcc" ; then
PAC_HAVE_MODERN_GFORTRAN(
[],
[AC_MSG_ERROR([Sorry, we require GNU Fortran 4.3 or later.])]
)
fi
# TODO : SEE _AC_PROG_FC_V
# TODO : AC_MSG_ERROR(see "$ac_cv_prog_FC_fc")
# AC_MSG_NOTICE( "ac_cv_prog_FC_fc : $ac_cv_prog_FC_fc")
@ -266,7 +271,14 @@ if test X"$ac_cv_sizeof_void_p" == X"8" ; then
CDEFINES="-DPtr64Bits $CDEFINES"
fi
AC_LANG([Fortran])
if test "X$psblas_cv_fc" == X"pg" ; then
save_FC=$FC
FC=$F77
fi
__AC_FC_NAME_MANGLING
if test "X$psblas_cv_fc" == X"pg" ; then
FC=$save_FC
fi
AC_LANG([C])
dnl AC_MSG_NOTICE([Fortran name mangling: $ac_cv_fc_mangling])
[pac_fc_case=${ac_cv_fc_mangling%%,*}]
@ -321,19 +333,13 @@ AC_MSG_RESULT([ $pac_f_c_names ])
# Make.inc generation logic
###############################################################################
# Note : This script is sensitive to FFLAGS, FCFLAGS, CFLAGS variables.
# Note : We cannot be sure whether ./configure test programs will use these *FLAGS.
dnl Note: CFLAGS == '' is a rare condition, but we provide mechanism, not policy.
dnl So we prefer:
if test "X$CFLAGS" == "X" ; then
dnl over
dnl if true ; then
if test "X$CCOPT" == "X" ; then
if test "X$psblas_cv_fc" == "Xgcc" ; then
# note that no space should be placed around the equality symbol in assignations
# note that no space should be placed around the equality symbol in assignements
# Note : 'native' is valid _only_ on GCC/x86 (32/64 bits)
CCOPT="-O3 $CCOPT"
elif test "X$psblas_cv_fc" == X"xlf" ; then
# XL compiler : consider using -qarch=auto
CCOPT="-O3 -qarch=auto $CCOPT"
@ -348,15 +354,16 @@ dnl if true ; then
# other compilers ..
CCOPT="-fast $CCOPT"
# NOTE : PG & Sun use -fast instead -O3
elif test "X$psblas_cv_fc" == X"nag" ; then
# using GCC in conjunction with NAG.
CCOPT="-O2"
else
CCOPT="-O2 $CCOPT"
fi
else
CCOPT="${CFLAGS}"
fi
CFLAGS="${CCOPT}"
if test "X$FFLAGS" == "X" ; then
if test "X$FCOPT" == "X" ; then
if test "X$psblas_cv_fc" == "Xgcc" ; then
# note that no space should be placed around the equality symbol in assignations
# Note : 'native' is valid _only_ on GCC/x86 (32/64 bits)
@ -374,16 +381,21 @@ if test "X$FFLAGS" == "X" ; then
elif test "X$psblas_cv_fc" == X"sun" ; then
# other compilers ..
FCOPT="-fast $FCOPT"
elif test "X$psblas_cv_fc" == X"nag" ; then
# NAG compiler ..
FCOPT="-O2 "
# NOTE : PG & Sun use -fast instead -O3
else
FCOPT="-O2 $FCOPT"
fi
else
FCOPT="${FFLAGS}"
fi
if test "X$psblas_cv_fc" == X"nag" ; then
# Add needed options
FCOPT="$FCOPT -mismatch -dcfuns"
fi
FFLAGS="${FCOPT}"
if test "X$FCFLAGS" == "X" ; then
if test "X$F90COPT" == "X" ; then
if test "X$psblas_cv_fc" == "Xgcc" ; then
# note that no space should be placed around the equality symbol in assignations
# Note : 'native' is valid _only_ on GCC/x86 (32/64 bits)
@ -398,14 +410,22 @@ if test "X$FCFLAGS" == "X" ; then
# other compilers ..
F90COPT="-fast $F90COPT"
elif test "X$psblas_cv_fc" == X"sun" ; then
# other compilers ..
F90COPT="-fast $F90COPT"
# NOTE : PG & Sun use -fast instead -O3
elif test "X$psblas_cv_fc" == X"nag" ; then
# NAG compiler
F90COPT="-O2"
else
# other compilers ..
F90COPT="-O2 $F90COPT"
fi
else
F90COPT="${FCFLAGS}"
echo "Found FCFLAGS $F90COPT"
#F90COPT="${FCFLAGS}"
fi
if test "X$psblas_cv_fc" == X"nag" ; then
# Add needed options
F90COPT="$F90COPT -mismatch -dcfuns"
EXTRA_OPT="-mismatch_all"
fi
FCFLAGS="${F90COPT}"
@ -414,8 +434,7 @@ FCFLAGS="${F90COPT}"
##############################################################################
# Compilers variables selection
##############################################################################
if true ; then
if test "X$psblas_cv_fc" == X"xlf" ; then
if test "X$psblas_cv_fc" == X"xlf" ; then
# WARNING : this is EVIL : specifying a pathname prefixed compiler will be ignored!
# But this is necessary since :
# - if called from some script, xlf could behave strangely
@ -439,7 +458,7 @@ if true ; then
#MPFCC="mpxlc"
# Note : -qfixed should be not specified in the environment FFLAGS or things will break.
# This fact should be documented somewhere.
else
else
# We really think about the GCC here but this is our idea for other compilers, too.
# If the user wishes to, she should specify MPICC, MPIF77 after ./configure.
# Note: this behavious should be documented.
@ -449,9 +468,9 @@ if true ; then
MPF77=${MPIFC}
CC=${CC}
MPCC=${MPICC}
fi
fi
##############################################################################
# Choice of our compilers, needed by Make.inc
##############################################################################
@ -630,6 +649,7 @@ AC_SUBST(MPF77)
AC_SUBST(MPCC)
AC_SUBST(FCOPT)
AC_SUBST(CCOPT)
AC_SUBST(EXTRA_OPT)
AC_SUBST(FIFLAG)
AC_SUBST(FMFLAG)
AC_SUBST(MODEXT)
@ -667,7 +687,7 @@ $(.mod).o:
%.o: %.c
$(CC) $(F90COPT) $(CINCLUDES) $(CDEFINES) -c $<
$(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $<
%.o: %.f
$(FC) $(FCOPT) $(FINCLUDES) -c $<
%$(.mod): %.f
@ -676,10 +696,6 @@ $(.mod).o:
$(F90) $(F90COPT) $(FINCLUDES) -c $<
%$(.mod): %.f90
$(F90) $(F90COPT) $(FINCLUDES) -c $<
%.o: %.f03
$(F90) $(F90COPT) $(FINCLUDES) -c $<
%$(.mod): %.f03
$(F90) $(F90COPT) $(FINCLUDES) -c $<
%.o: %.F
$(FC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $<
%$(.mod): %.F
@ -688,10 +704,15 @@ $(.mod).o:
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
%$(.mod): %.F90
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
%.o: %.f03
$(F90) $(F90COPT) $(FINCLUDES) -c $<
%$(.mod): %.f03
$(F90) $(F90COPT) $(FINCLUDES) -c $<
%.o: %.F03
$(F03) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
%$(.mod): %.F03
$(F03) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<'
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<'
else
@ -714,10 +735,6 @@ $(.mod).o:
$(F90) $(F90COPT) $(FINCLUDES) -c $<
.f90.o:
$(F90) $(F90COPT) $(FINCLUDES) -c $<
.f03$(.mod):
$(F03) $(F90COPT) $(FINCLUDES) -c $<
.f03.o:
$(F03) $(F90COPT) $(FINCLUDES) -c $<
.F.o:
$(FC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $<
.F$(.mod):
@ -726,10 +743,14 @@ $(.mod).o:
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
.F90$(.mod):
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
.f03$(.mod):
$(F90) $(F90COPT) $(FINCLUDES) -c $<
.f03.o:
$(F90) $(F90COPT) $(FINCLUDES) -c $<
.F03.o:
$(F03) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
.F03$(.mod):
$(F03) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<'
$(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<'
fi
AC_SUBST(PSBLASRULES)
@ -753,20 +774,20 @@ AC_MSG_NOTICE([
MPF90 : ${MPF90}
MPF77 : ${MPF77}
MPICC : ${MPICC}
MPCC : ${MPICC}
dnl F90LINK : ${F90LINK}
FLINK : ${FLINK}
FDEFINES : ${FDEFINES}
CDEFINES : ${CDEFINES}
CFLAGS : ${CFLAGS}
FFLAGS : ${FFLAGS}
FCFLAGS : ${FCFLAGS}
dnl CFLAGS : ${CFLAGS}
dnl FFLAGS : ${FFLAGS}
dnl FCFLAGS : ${FCFLAGS}
MODEXT : ${MODEXT}
FMFLAG : ${FMFLAG}
dnl F90COPT : ${F90COPT}
dnl FCOPT : ${FCOPT}
dnl CCOPT : ${CCOPT}
F90COPT : ${F90COPT}
FCOPT : ${FCOPT}
CCOPT : ${CCOPT}
dnl ESSL/PESSL : ${psblas_cv_have_essl} / ${psblas_cv_have_pessl}

@ -270,7 +270,7 @@ Subroutine psb_scgstab(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
& ' Iteration: ',itx
rho_old = rho
rho = psb_gexdot(q,r,desc_a,info)
rho = psb_gedot(q,r,desc_a,info)
if (rho==dzero) then
if (debug_level >= psb_debug_ext_) &
@ -301,7 +301,7 @@ Subroutine psb_scgstab(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
imerr = MPE_Log_event( imme, 0, "ed SPMM" )
#endif
sigma = psb_gexdot(q,v,desc_a,info)
sigma = psb_gedot(q,v,desc_a,info)
if (sigma==dzero) then
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),&
@ -338,7 +338,7 @@ Subroutine psb_scgstab(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
goto 9999
end if
sigma = psb_gexdot(t,t,desc_a,info)
sigma = psb_gedot(t,t,desc_a,info)
if (sigma==dzero) then
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),&
@ -346,7 +346,7 @@ Subroutine psb_scgstab(a,prec,b,x,eps,desc_a,info,itmax,iter,err,itrace,istop)
exit iteration
endif
tau = psb_gexdot(t,s,desc_a,info)
tau = psb_gedot(t,s,desc_a,info)
omega = tau/sigma
if (omega==szero) then

@ -35,7 +35,7 @@ subroutine psb_cdiagsc_bld(a,desc_a,p,upd,info)
use psb_prec_mod, psb_protect_name => psb_cdiagsc_bld
Implicit None
type(psb_cspmat_type), target :: a
type(psb_cspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in) :: desc_a
type(psb_cprec_type),intent(inout) :: p
character, intent(in) :: upd

@ -42,7 +42,7 @@ subroutine psb_cprc_aply(prec,x,y,desc_data,info,trans, work)
complex(psb_spk_),intent(inout) :: y(:)
integer, intent(out) :: info
character(len=1), optional :: trans
complex(psb_spk_), optional, target :: work(:)
complex(psb_spk_), intent(inout), optional, target :: work(:)
! Local variables
character :: trans_

@ -35,7 +35,7 @@ subroutine psb_cprecbld(a,desc_a,p,info,upd)
use psb_prec_mod, psb_protect_name => psb_cprecbld
Implicit None
type(psb_cspmat_type), target :: a
type(psb_cspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in), target :: desc_a
type(psb_cprec_type),intent(inout) :: p
integer, intent(out) :: info

@ -35,7 +35,7 @@ subroutine psb_ddiagsc_bld(a,desc_a,p,upd,info)
use psb_prec_mod, psb_protect_name => psb_ddiagsc_bld
Implicit None
type(psb_dspmat_type), target :: a
type(psb_dspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in) :: desc_a
type(psb_dprec_type),intent(inout) :: p
character, intent(in) :: upd

@ -41,7 +41,7 @@ subroutine psb_dprc_aply(prec,x,y,desc_data,info,trans, work)
real(psb_dpk_),intent(inout) :: y(:)
integer, intent(out) :: info
character(len=1), optional :: trans
real(psb_dpk_), optional, target :: work(:)
real(psb_dpk_), intent(inout), optional, target :: work(:)
! Local variables
character :: trans_

@ -35,7 +35,7 @@ subroutine psb_dprecbld(a,desc_a,p,info,upd)
use psb_prec_mod, psb_protect_name => psb_dprecbld
Implicit None
type(psb_dspmat_type), target :: a
type(psb_dspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in), target :: desc_a
type(psb_dprec_type),intent(inout) :: p
integer, intent(out) :: info

@ -35,7 +35,7 @@ subroutine psb_sdiagsc_bld(a,desc_a,p,upd,info)
use psb_prec_mod, psb_protect_name => psb_sdiagsc_bld
Implicit None
type(psb_sspmat_type), target :: a
type(psb_sspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in) :: desc_a
type(psb_sprec_type),intent(inout) :: p
character, intent(in) :: upd

@ -41,7 +41,7 @@ subroutine psb_sprc_aply(prec,x,y,desc_data,info,trans, work)
real(psb_spk_),intent(inout) :: y(:)
integer, intent(out) :: info
character(len=1), optional :: trans
real(psb_spk_), optional, target :: work(:)
real(psb_spk_), intent(inout), optional, target :: work(:)
! Local variables
character :: trans_

@ -35,7 +35,7 @@ subroutine psb_sprecbld(a,desc_a,p,info,upd)
use psb_prec_mod, psb_protect_name => psb_sprecbld
Implicit None
type(psb_sspmat_type), target :: a
type(psb_sspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in), target :: desc_a
type(psb_sprec_type),intent(inout) :: p
integer, intent(out) :: info

@ -35,7 +35,7 @@ subroutine psb_zdiagsc_bld(a,desc_a,p,upd,info)
use psb_prec_mod, psb_protect_name => psb_zdiagsc_bld
Implicit None
type(psb_zspmat_type), target :: a
type(psb_zspmat_type), intent(in), target :: a
type(psb_desc_type), intent(in) :: desc_a
type(psb_zprec_type),intent(inout) :: p
character, intent(in) :: upd

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save