|
|
|
@ -100,6 +100,47 @@ contains
|
|
|
|
|
|
|
|
|
|
end function psb_c_cdall_vl
|
|
|
|
|
|
|
|
|
|
function psb_c_cdall_vl_opt(nl,vl,cctxt,cdh) bind(c,name='psb_c_cdall_vl_opt') result(res)
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: res
|
|
|
|
|
type(psb_c_object_type), value :: cctxt
|
|
|
|
|
integer(psb_c_ipk_), value :: nl
|
|
|
|
|
integer(psb_c_lpk_) :: vl(*)
|
|
|
|
|
type(psb_c_object_type) :: cdh
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
integer(psb_c_ipk_) :: info, ixb
|
|
|
|
|
type(psb_ctxt_type) :: ctxt
|
|
|
|
|
ctxt = psb_c2f_ctxt(cctxt)
|
|
|
|
|
|
|
|
|
|
res = -1
|
|
|
|
|
if (nl <=0) then
|
|
|
|
|
write(0,*) 'Invalid size'
|
|
|
|
|
return
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
call descp%free(info)
|
|
|
|
|
if (info == 0) deallocate(descp,stat=info)
|
|
|
|
|
if (info /= 0) return
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
allocate(descp,stat=info)
|
|
|
|
|
if (info < 0) return
|
|
|
|
|
|
|
|
|
|
ixb = psb_c_get_index_base()
|
|
|
|
|
|
|
|
|
|
if (ixb == 1) then
|
|
|
|
|
call psb_cdall(ctxt,descp,info,vl=vl(1:nl),globalcheck=.true.)
|
|
|
|
|
else
|
|
|
|
|
call psb_cdall(ctxt,descp,info,vl=(vl(1:nl)+(1-ixb)),globalcheck=.true.)
|
|
|
|
|
end if
|
|
|
|
|
cdh%item = c_loc(descp)
|
|
|
|
|
res = info
|
|
|
|
|
|
|
|
|
|
end function psb_c_cdall_vl_opt
|
|
|
|
|
|
|
|
|
|
function psb_c_cdall_nl(nl,cctxt,cdh) bind(c,name='psb_c_cdall_nl') result(res)
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|