psblas3-mcbind:

cbind/base/psb_base_tools_cbind_mod.F90
 cbind/base/psb_cpenv_mod.f90
 cbind/base/psb_d_psblas_cbind_mod.f90
 cbind/base/psb_d_serial_cbind_mod.F90
 cbind/base/psb_d_tools_cbind_mod.F90
 cbind/base/psb_objhandle_mod.F90
 cbind/base/psb_objhandle_mod.f90

Added kind parameter for short/long integers.
psblas3-mcbind
Salvatore Filippone 8 years ago
parent 69b42b7816
commit a60a547be6

@ -8,14 +8,14 @@ contains
function psb_c_error() bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
res = 0
call psb_error()
end function psb_c_error
function psb_c_clean_errstack() bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
res = 0
call psb_clean_errstack()
end function psb_c_clean_errstack
@ -23,9 +23,9 @@ contains
function psb_c_cdall_vg(ng,vg,ictxt,cdh) bind(c,name='psb_c_cdall_vg') result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: ng, ictxt
integer(c_int) :: vg(*)
integer(psb_c_int) :: res
integer(psb_c_int), value :: ng, ictxt
integer(psb_c_int) :: vg(*)
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
integer :: info
@ -56,9 +56,9 @@ contains
function psb_c_cdall_vl(nl,vl,ictxt,cdh) bind(c,name='psb_c_cdall_vl') result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: nl, ictxt
integer(c_int) :: vl(*)
integer(psb_c_int) :: res
integer(psb_c_int), value :: nl, ictxt
integer(psb_c_int) :: vl(*)
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
integer :: info
@ -88,8 +88,8 @@ contains
function psb_c_cdall_nl(nl,ictxt,cdh) bind(c,name='psb_c_cdall_nl') result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: nl, ictxt
integer(psb_c_int) :: res
integer(psb_c_int), value :: nl, ictxt
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
integer :: info
@ -119,8 +119,8 @@ contains
function psb_c_cdall_repl(n,ictxt,cdh) bind(c,name='psb_c_cdall_repl') result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: n, ictxt
integer(psb_c_int) :: res
integer(psb_c_int), value :: n, ictxt
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
integer :: info
@ -150,7 +150,7 @@ contains
function psb_c_cdasb(cdh) bind(c,name='psb_c_cdasb') result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
integer :: info
@ -169,7 +169,7 @@ contains
function psb_c_cdfree(cdh) bind(c,name='psb_c_cdfree') result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
integer :: info
@ -190,10 +190,10 @@ contains
function psb_c_cdins(nz,ia,ja,cdh) bind(c,name='psb_c_cdins') result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: nz
integer(psb_c_int) :: res
integer(psb_c_int), value :: nz
type(psb_c_object_type) :: cdh
integer(c_int) :: ia(*),ja(*)
integer(psb_c_int) :: ia(*),ja(*)
type(psb_desc_type), pointer :: descp
integer :: info
@ -213,7 +213,7 @@ contains
function psb_c_cd_get_local_rows(cdh) bind(c,name='psb_c_cd_get_local_rows') result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
@ -234,7 +234,7 @@ contains
function psb_c_cd_get_local_cols(cdh) bind(c,name='psb_c_cd_get_local_cols') result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
@ -253,7 +253,7 @@ contains
function psb_c_cd_get_global_rows(cdh) bind(c,name='psb_c_cd_get_global_rows') result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp
@ -274,7 +274,7 @@ contains
function psb_c_cd_get_global_cols(cdh) bind(c,name='psb_c_cd_get_global_cols') result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: cdh
type(psb_desc_type), pointer :: descp

@ -8,7 +8,7 @@ contains
use psb_base_mod, only : psb_get_errstatus
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
res = psb_get_errstatus()
end function psb_c_get_errstatus
@ -17,7 +17,7 @@ contains
use psb_base_mod, only : psb_init
implicit none
integer(c_int) :: psb_c_init
integer(psb_c_int) :: psb_c_init
integer :: ictxt
@ -27,7 +27,7 @@ contains
subroutine psb_c_exit_ctxt(ictxt) bind(c)
use psb_base_mod, only : psb_exit
integer(c_int), value :: ictxt
integer(psb_c_int), value :: ictxt
call psb_exit(ictxt,close=.false.)
return
@ -35,7 +35,7 @@ contains
subroutine psb_c_exit(ictxt) bind(c)
use psb_base_mod, only : psb_exit
integer(c_int), value :: ictxt
integer(psb_c_int), value :: ictxt
call psb_exit(ictxt)
return
@ -43,7 +43,7 @@ contains
subroutine psb_c_abort(ictxt) bind(c)
use psb_base_mod, only : psb_abort
integer(c_int), value :: ictxt
integer(psb_c_int), value :: ictxt
call psb_abort(ictxt)
return
@ -52,8 +52,8 @@ contains
subroutine psb_c_info(ictxt,iam,np) bind(c)
use psb_base_mod, only : psb_info
integer(c_int), value :: ictxt
integer(c_int) :: iam,np
integer(psb_c_int), value :: ictxt
integer(psb_c_int) :: iam,np
call psb_info(ictxt,iam,np)
return
@ -61,7 +61,7 @@ contains
subroutine psb_c_barrier(ictxt) bind(c)
use psb_base_mod, only : psb_barrier
integer(c_int), value :: ictxt
integer(psb_c_int), value :: ictxt
call psb_barrier(ictxt)
end subroutine psb_c_barrier
@ -75,8 +75,8 @@ contains
subroutine psb_c_ibcast(ictxt,n,v,root) bind(c)
use psb_base_mod, only : psb_bcast
implicit none
integer(c_int), value :: ictxt,n, root
integer(c_int) :: v(*)
integer(psb_c_int), value :: ictxt,n, root
integer(psb_c_int) :: v(*)
if (n < 0) then
write(0,*) 'Wrong size in BCAST'
@ -90,7 +90,7 @@ contains
subroutine psb_c_dbcast(ictxt,n,v,root) bind(c)
use psb_base_mod, only : psb_bcast
implicit none
integer(c_int), value :: ictxt,n, root
integer(psb_c_int), value :: ictxt,n, root
real(c_double) :: v(*)
if (n < 0) then
@ -105,7 +105,7 @@ contains
subroutine psb_c_hbcast(ictxt,v,root) bind(c)
use psb_base_mod, only : psb_bcast, psb_info
implicit none
integer(c_int), value :: ictxt, root
integer(psb_c_int), value :: ictxt, root
character(c_char) :: v(*)
integer :: n, iam, np
@ -127,8 +127,8 @@ contains
use psb_base_string_cbind_mod
implicit none
character(c_char), intent(inout) :: cmesg(*)
integer(c_int), intent(in), value :: len
integer(c_int) :: res
integer(psb_c_int), intent(in), value :: len
integer(psb_c_int) :: res
character(len=psb_max_errmsg_len_), allocatable :: fmesg(:)
character(len=psb_max_errmsg_len_) :: tmp
integer :: i, j, ll, il

@ -8,7 +8,7 @@ contains
use psb_objhandle_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: xh,yh, cdh
real(c_double), value :: alpha,beta
@ -195,7 +195,7 @@ contains
use psb_objhandle_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: ah,xh,yh, cdh
real(c_double), value :: alpha, beta
@ -238,7 +238,7 @@ contains
use psb_objhandle_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: ah,xh,yh, cdh
real(c_double), value :: alpha, beta

@ -11,7 +11,7 @@ contains
function psb_c_dvect_get_nrows(xh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dvector) :: xh
type(psb_d_vect_type), pointer :: vp
@ -29,7 +29,7 @@ contains
function psb_c_dvect_f_get_cpy(v,xh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
real(c_double) :: v(*)
type(psb_c_dvector) :: xh
@ -52,7 +52,7 @@ contains
function psb_c_dvect_zero(xh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dvector) :: xh
type(psb_d_vect_type), pointer :: vp
@ -73,7 +73,7 @@ contains
use psb_objhandle_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dspmat) :: mh
type(psb_dspmat_type), pointer :: ap
@ -96,7 +96,7 @@ contains
use psb_objhandle_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dspmat) :: mh
type(psb_dspmat_type), pointer :: ap

@ -10,7 +10,7 @@ contains
function psb_c_dgeall(xh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: xh
type(psb_c_object_type) :: cdh
@ -39,7 +39,7 @@ contains
function psb_c_dgeasb(xh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: xh
type(psb_c_object_type) :: cdh
@ -69,7 +69,7 @@ contains
function psb_c_dgefree(xh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: xh
type(psb_c_object_type) :: cdh
@ -101,9 +101,9 @@ contains
function psb_c_dgeins(nz,irw,val,xh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: nz
integer(c_int) :: irw(*)
integer(psb_c_int) :: res
integer(psb_c_int), value :: nz
integer(psb_c_int) :: irw(*)
real(c_double) :: val(*)
type(psb_c_object_type) :: xh
type(psb_c_object_type) :: cdh
@ -135,9 +135,9 @@ contains
function psb_c_dgeins_add(nz,irw,val,xh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: nz
integer(c_int) :: irw(*)
integer(psb_c_int) :: res
integer(psb_c_int), value :: nz
integer(psb_c_int) :: irw(*)
real(c_double) :: val(*)
type(psb_c_object_type) :: xh
type(psb_c_object_type) :: cdh
@ -169,7 +169,7 @@ contains
function psb_c_dspall(mh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: mh
type(psb_c_object_type) :: cdh
@ -199,7 +199,7 @@ contains
function psb_c_dspasb(mh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: mh
type(psb_c_object_type) :: cdh
@ -228,7 +228,7 @@ contains
function psb_c_dspfree(mh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_object_type) :: mh
type(psb_c_object_type) :: cdh
@ -263,8 +263,8 @@ contains
use psb_d_rsb_mat_mod
#endif
implicit none
integer(c_int) :: res
integer(c_int), value :: cdh, mh,upd,dupl
integer(psb_c_int) :: res
integer(psb_c_int), value :: cdh, mh,upd,dupl
character(c_char) :: afmt(*)
integer :: info,n, fdupl
character(len=5) :: fafmt
@ -299,9 +299,9 @@ contains
function psb_c_dspins(nz,irw,icl,val,mh,cdh) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(c_int), value :: nz
integer(c_int) :: irw(*), icl(*)
integer(psb_c_int) :: res
integer(psb_c_int), value :: nz
integer(psb_c_int) :: irw(*), icl(*)
real(c_double) :: val(*)
type(psb_c_object_type) :: mh
type(psb_c_object_type) :: cdh
@ -332,7 +332,7 @@ contains
function psb_c_dsprn(mh,cdh,clear) bind(c) result(res)
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
logical(c_bool), value :: clear
type(psb_c_object_type) :: mh
type(psb_c_object_type) :: cdh
@ -364,8 +364,8 @@ contains
!!$ function psb_c_dspprint(mh) bind(c) result(res)
!!$
!!$ implicit none
!!$ integer(c_int) :: res
!!$ integer(c_int), value :: mh
!!$ integer(psb_c_int) :: res
!!$ integer(psb_c_int), value :: mh
!!$ integer :: info
!!$
!!$

@ -1,5 +1,11 @@
module psb_objhandle_mod
use iso_c_binding
#if defined(LONG_INTEGERS)
integer, parameter :: psb_c_int = c_int64_t
#else
integer, parameter :: psb_c_int = c_int32_t
#endif
type, bind(c) :: psb_c_object_type
type(c_ptr) :: item = c_null_ptr
Loading…
Cancel
Save