Fixes for MUMPS used as local solver. Better interface for choosing

same.
stopcriterion
Salvatore Filippone 6 years ago
parent acfe6c0295
commit ab387a1343

@ -82,25 +82,37 @@ subroutine c_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
n_row = desc_data%get_local_rows() n_row = desc_data%get_local_rows()
n_col = desc_data%get_local_cols() n_col = desc_data%get_local_cols()
if (n_col <= size(work)) then ! Running in local mode?
ww = work(1:n_col) if (sv%ipar(1) == mld_local_solver_ ) then
else gx = x
allocate(ww(n_col),stat=info) else if (sv%ipar(1) == mld_global_solver_ ) then
if (n_col <= size(work)) then
ww = work(1:n_col)
else
allocate(ww(n_col),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
& a_err='complex(psb_spk_)')
goto 9999
end if
end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_request_ info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),& call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='complex(psb_spk_)') & a_err='complex(psb_spk_)')
goto 9999 goto 9999
end if end if
call psb_gather(gx, x, desc_data, info, root=0)
else
info=psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Invalid local/global solver in MUMPS')
goto 9999
end if end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='complex(psb_spk_)')
goto 9999
end if
call psb_gather(gx, x, desc_data, info, root=0)
select case(trans_) select case(trans_)
case('N') case('N')
sv%id%icntl(9) = 1 sv%id%icntl(9) = 1
@ -120,10 +132,13 @@ subroutine c_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
sv%id%icntl(4)=-1 sv%id%icntl(4)=-1
sv%id%job = 3 sv%id%job = 3
call cmumps(sv%id) call cmumps(sv%id)
call psb_scatter(gx, ww, desc_data, info, root=0) if (sv%ipar(1) == mld_local_solver_ ) then
call psb_geaxpby(alpha,gx,beta,y,desc_data,info)
if (info == psb_success_) then else
call psb_geaxpby(alpha,ww,beta,y,desc_data,info) call psb_scatter(gx, ww, desc_data, info, root=0)
if (info == psb_success_) then
call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
end if
end if end if
if (info /= psb_success_) then if (info /= psb_success_) then
@ -132,9 +147,7 @@ subroutine c_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
goto 9999 goto 9999
endif endif
if (nglob > size(work)) then if (allocated(ww)) deallocate(ww)
deallocate(ww)
endif
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

@ -58,135 +58,145 @@
! Local variables ! Local variables
type(psb_cspmat_type) :: atmp type(psb_cspmat_type) :: atmp
type(psb_c_coo_sparse_mat), target :: acoo type(psb_c_coo_sparse_mat), target :: acoo
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc
integer(psb_ipk_) :: ifrst, ibcheck integer(psb_ipk_) :: ifrst, ibcheck
integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, me, i, err_act, debug_unit, debug_level integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, iam, me, i, err_act, debug_unit, debug_level
character(len=20) :: name='c_mumps_solver_bld', ch_err character(len=20) :: name='c_mumps_solver_bld', ch_err
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
info=psb_success_ info=psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
ictxt = desc_a%get_context() ictxt = desc_a%get_context()
if (sv%ipar(1) < 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/me/)) call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/iam/))
call psb_get_mpicomm(ictxt1, icomm) call psb_get_mpicomm(ictxt1, icomm)
allocate(sv%local_ictxt,stat=info) allocate(sv%local_ictxt,stat=info)
sv%local_ictxt = ictxt1 sv%local_ictxt = ictxt1
write(*,*)'mumps_bld: +++++>',icomm,ictxt1 write(*,*)'mumps_bld: +++++>',icomm,sv%local_ictxt
call psb_info(ictxt1, me, np) call psb_info(ictxt1, me, np)
npr = np npr = np
else else if (sv%ipar(1) == mld_global_solver_ ) then
call psb_get_mpicomm(ictxt,icomm) call psb_get_mpicomm(ictxt,icomm)
write(*,*)'mumps_bld: +++++>',icomm,ictxt write(*,*)'mumps_bld: +++++>',icomm,ictxt
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
npr = np me = iam
end if npr = np
npc = 1 else
if (debug_level >= psb_debug_outer_) & info = psb_err_internal_error_
& write(debug_unit,*) me,' ',trim(name),' start' call psb_errpush(info,name,&
! if (allocated(sv%id)) then & a_err='Invalid local/global solver in MUMPS')
! call sv%free(info) goto 9999
end if
npc = 1
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' start'
! if (allocated(sv%id)) then
! call sv%free(info)
! deallocate(sv%id) ! deallocate(sv%id)
! end if ! end if
if(.not.allocated(sv%id)) then if(.not.allocated(sv%id)) then
allocate(sv%id,stat=info) allocate(sv%id,stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_dealloc_ info=psb_err_alloc_dealloc_
call psb_errpush(info,name,a_err='mld_cmumps_default') call psb_errpush(info,name,a_err='mld_dmumps_default')
goto 9999 goto 9999
end if
end if end if
end if
sv%id%comm = icomm sv%id%comm = icomm
sv%id%job = -1 sv%id%job = -1
sv%id%par = 1 sv%id%par = 1
call cmumps(sv%id) call cmumps(sv%id)
!WARNING: CALLING cMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX !WARNING: CALLING dMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX
if (allocated(sv%icntl)) then if (allocated(sv%icntl)) then
do i=1,mld_mumps_icntl_size do i=1,mld_mumps_icntl_size
if (allocated(sv%icntl(i)%item)) sv%id%icntl(i) = sv%icntl(i)%item if (allocated(sv%icntl(i)%item)) then
end do !write(0,*) 'MUMPS_BLD: setting entry ',i,' to ', sv%icntl(i)%item
end if sv%id%icntl(i) = sv%icntl(i)%item
if (allocated(sv%rcntl)) then
do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
nglob = desc_a%get_global_rows()
if (sv%ipar(1) < 0) then
nglobrec=desc_a%get_local_rows()
call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. A zero-overlap is used instead'
end if end if
else end do
call a%cp_to(acoo) end if
end if if (allocated(sv%rcntl)) then
nztota = acoo%get_nzeros() do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
! switch to global numbering nglob = desc_a%get_global_rows()
if (sv%ipar(1) >= 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I') nglobrec=desc_a%get_local_rows()
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I') call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. '
write(*,*)'A zero-overlap is used instead'
end if end if
sv%id%irn_loc => acoo%ia else
sv%id%jcn_loc => acoo%ja call a%cp_to(acoo)
sv%id%a_loc => acoo%val end if
sv%id%icntl(18) = 3 nztota = acoo%get_nzeros()
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)'calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call cmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_cmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
call acoo%free() ! switch to global numbering
sv%built=.true. if (sv%ipar(1) == mld_global_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I')
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I')
end if
sv%id%irn_loc => acoo%ia
sv%id%jcn_loc => acoo%ja
sv%id%a_loc => acoo%val
sv%id%icntl(18) = 3
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)iam, ' calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call dmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_dmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
if (debug_level >= psb_debug_outer_) & call acoo%free()
& write(debug_unit,*) me,' ',trim(name),' end' sv%built=.true.
call psb_erractionrestore(err_act) if (debug_level >= psb_debug_outer_) &
return & write(debug_unit,*) iam,' ',trim(name),' end'
call psb_erractionrestore(err_act)
return
9999 continue 9999 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then if (err_act == psb_act_abort_) then
call psb_error() call psb_error()
return
end if
return return
end if
return
#else #else
write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile " write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile "
#endif #endif
end subroutine c_mumps_solver_bld end subroutine c_mumps_solver_bld

@ -82,25 +82,37 @@ subroutine d_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
n_row = desc_data%get_local_rows() n_row = desc_data%get_local_rows()
n_col = desc_data%get_local_cols() n_col = desc_data%get_local_cols()
if (n_col <= size(work)) then ! Running in local mode?
ww = work(1:n_col) if (sv%ipar(1) == mld_local_solver_ ) then
else gx = x
allocate(ww(n_col),stat=info) else if (sv%ipar(1) == mld_global_solver_ ) then
if (n_col <= size(work)) then
ww = work(1:n_col)
else
allocate(ww(n_col),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
& a_err='real(psb_dpk_)')
goto 9999
end if
end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_request_ info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),& call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='real(psb_dpk_)') & a_err='real(psb_dpk_)')
goto 9999 goto 9999
end if end if
call psb_gather(gx, x, desc_data, info, root=0)
else
info=psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Invalid local/global solver in MUMPS')
goto 9999
end if end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='real(psb_dpk_)')
goto 9999
end if
call psb_gather(gx, x, desc_data, info, root=0)
select case(trans_) select case(trans_)
case('N') case('N')
sv%id%icntl(9) = 1 sv%id%icntl(9) = 1
@ -120,10 +132,13 @@ subroutine d_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
sv%id%icntl(4)=-1 sv%id%icntl(4)=-1
sv%id%job = 3 sv%id%job = 3
call dmumps(sv%id) call dmumps(sv%id)
call psb_scatter(gx, ww, desc_data, info, root=0) if (sv%ipar(1) == mld_local_solver_ ) then
call psb_geaxpby(alpha,gx,beta,y,desc_data,info)
if (info == psb_success_) then else
call psb_geaxpby(alpha,ww,beta,y,desc_data,info) call psb_scatter(gx, ww, desc_data, info, root=0)
if (info == psb_success_) then
call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
end if
end if end if
if (info /= psb_success_) then if (info /= psb_success_) then
@ -132,9 +147,7 @@ subroutine d_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
goto 9999 goto 9999
endif endif
if (nglob > size(work)) then if (allocated(ww)) deallocate(ww)
deallocate(ww)
endif
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

@ -58,135 +58,145 @@
! Local variables ! Local variables
type(psb_dspmat_type) :: atmp type(psb_dspmat_type) :: atmp
type(psb_d_coo_sparse_mat), target :: acoo type(psb_d_coo_sparse_mat), target :: acoo
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc
integer(psb_ipk_) :: ifrst, ibcheck integer(psb_ipk_) :: ifrst, ibcheck
integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, me, i, err_act, debug_unit, debug_level integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, iam, me, i, err_act, debug_unit, debug_level
character(len=20) :: name='d_mumps_solver_bld', ch_err character(len=20) :: name='d_mumps_solver_bld', ch_err
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
info=psb_success_ info=psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
ictxt = desc_a%get_context() ictxt = desc_a%get_context()
if (sv%ipar(1) < 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/me/)) call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/iam/))
call psb_get_mpicomm(ictxt1, icomm) call psb_get_mpicomm(ictxt1, icomm)
allocate(sv%local_ictxt,stat=info) allocate(sv%local_ictxt,stat=info)
sv%local_ictxt = ictxt1 sv%local_ictxt = ictxt1
write(*,*)'mumps_bld: +++++>',icomm,ictxt1 write(*,*)'mumps_bld: +++++>',icomm,sv%local_ictxt
call psb_info(ictxt1, me, np) call psb_info(ictxt1, me, np)
npr = np npr = np
else else if (sv%ipar(1) == mld_global_solver_ ) then
call psb_get_mpicomm(ictxt,icomm) call psb_get_mpicomm(ictxt,icomm)
write(*,*)'mumps_bld: +++++>',icomm,ictxt write(*,*)'mumps_bld: +++++>',icomm,ictxt
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
npr = np me = iam
end if npr = np
npc = 1 else
if (debug_level >= psb_debug_outer_) & info = psb_err_internal_error_
& write(debug_unit,*) me,' ',trim(name),' start' call psb_errpush(info,name,&
! if (allocated(sv%id)) then & a_err='Invalid local/global solver in MUMPS')
! call sv%free(info) goto 9999
end if
npc = 1
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' start'
! if (allocated(sv%id)) then
! call sv%free(info)
! deallocate(sv%id) ! deallocate(sv%id)
! end if ! end if
if(.not.allocated(sv%id)) then if(.not.allocated(sv%id)) then
allocate(sv%id,stat=info) allocate(sv%id,stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_dealloc_ info=psb_err_alloc_dealloc_
call psb_errpush(info,name,a_err='mld_dmumps_default') call psb_errpush(info,name,a_err='mld_dmumps_default')
goto 9999 goto 9999
end if
end if end if
end if
sv%id%comm = icomm sv%id%comm = icomm
sv%id%job = -1 sv%id%job = -1
sv%id%par = 1 sv%id%par = 1
call dmumps(sv%id) call dmumps(sv%id)
!WARNING: CALLING dMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX !WARNING: CALLING dMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX
if (allocated(sv%icntl)) then if (allocated(sv%icntl)) then
do i=1,mld_mumps_icntl_size do i=1,mld_mumps_icntl_size
if (allocated(sv%icntl(i)%item)) sv%id%icntl(i) = sv%icntl(i)%item if (allocated(sv%icntl(i)%item)) then
end do !write(0,*) 'MUMPS_BLD: setting entry ',i,' to ', sv%icntl(i)%item
end if sv%id%icntl(i) = sv%icntl(i)%item
if (allocated(sv%rcntl)) then
do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
nglob = desc_a%get_global_rows()
if (sv%ipar(1) < 0) then
nglobrec=desc_a%get_local_rows()
call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. A zero-overlap is used instead'
end if end if
else end do
call a%cp_to(acoo) end if
end if if (allocated(sv%rcntl)) then
nztota = acoo%get_nzeros() do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
! switch to global numbering nglob = desc_a%get_global_rows()
if (sv%ipar(1) >= 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I') nglobrec=desc_a%get_local_rows()
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I') call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. '
write(*,*)'A zero-overlap is used instead'
end if end if
sv%id%irn_loc => acoo%ia else
sv%id%jcn_loc => acoo%ja call a%cp_to(acoo)
sv%id%a_loc => acoo%val end if
sv%id%icntl(18) = 3 nztota = acoo%get_nzeros()
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)'calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call dmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_dmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
call acoo%free() ! switch to global numbering
sv%built=.true. if (sv%ipar(1) == mld_global_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I')
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I')
end if
sv%id%irn_loc => acoo%ia
sv%id%jcn_loc => acoo%ja
sv%id%a_loc => acoo%val
sv%id%icntl(18) = 3
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)iam, ' calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call dmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_dmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
if (debug_level >= psb_debug_outer_) & call acoo%free()
& write(debug_unit,*) me,' ',trim(name),' end' sv%built=.true.
call psb_erractionrestore(err_act) if (debug_level >= psb_debug_outer_) &
return & write(debug_unit,*) iam,' ',trim(name),' end'
call psb_erractionrestore(err_act)
return
9999 continue 9999 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then if (err_act == psb_act_abort_) then
call psb_error() call psb_error()
return
end if
return return
end if
return
#else #else
write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile " write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile "
#endif #endif
end subroutine d_mumps_solver_bld end subroutine d_mumps_solver_bld

@ -82,25 +82,37 @@ subroutine s_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
n_row = desc_data%get_local_rows() n_row = desc_data%get_local_rows()
n_col = desc_data%get_local_cols() n_col = desc_data%get_local_cols()
if (n_col <= size(work)) then ! Running in local mode?
ww = work(1:n_col) if (sv%ipar(1) == mld_local_solver_ ) then
else gx = x
allocate(ww(n_col),stat=info) else if (sv%ipar(1) == mld_global_solver_ ) then
if (n_col <= size(work)) then
ww = work(1:n_col)
else
allocate(ww(n_col),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
& a_err='real(psb_spk_)')
goto 9999
end if
end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_request_ info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),& call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='real(psb_spk_)') & a_err='real(psb_spk_)')
goto 9999 goto 9999
end if end if
call psb_gather(gx, x, desc_data, info, root=0)
else
info=psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Invalid local/global solver in MUMPS')
goto 9999
end if end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='real(psb_spk_)')
goto 9999
end if
call psb_gather(gx, x, desc_data, info, root=0)
select case(trans_) select case(trans_)
case('N') case('N')
sv%id%icntl(9) = 1 sv%id%icntl(9) = 1
@ -120,10 +132,13 @@ subroutine s_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
sv%id%icntl(4)=-1 sv%id%icntl(4)=-1
sv%id%job = 3 sv%id%job = 3
call smumps(sv%id) call smumps(sv%id)
call psb_scatter(gx, ww, desc_data, info, root=0) if (sv%ipar(1) == mld_local_solver_ ) then
call psb_geaxpby(alpha,gx,beta,y,desc_data,info)
if (info == psb_success_) then else
call psb_geaxpby(alpha,ww,beta,y,desc_data,info) call psb_scatter(gx, ww, desc_data, info, root=0)
if (info == psb_success_) then
call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
end if
end if end if
if (info /= psb_success_) then if (info /= psb_success_) then
@ -132,9 +147,7 @@ subroutine s_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
goto 9999 goto 9999
endif endif
if (nglob > size(work)) then if (allocated(ww)) deallocate(ww)
deallocate(ww)
endif
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

@ -58,135 +58,145 @@
! Local variables ! Local variables
type(psb_sspmat_type) :: atmp type(psb_sspmat_type) :: atmp
type(psb_s_coo_sparse_mat), target :: acoo type(psb_s_coo_sparse_mat), target :: acoo
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc
integer(psb_ipk_) :: ifrst, ibcheck integer(psb_ipk_) :: ifrst, ibcheck
integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, me, i, err_act, debug_unit, debug_level integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, iam, me, i, err_act, debug_unit, debug_level
character(len=20) :: name='s_mumps_solver_bld', ch_err character(len=20) :: name='s_mumps_solver_bld', ch_err
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
info=psb_success_ info=psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
ictxt = desc_a%get_context() ictxt = desc_a%get_context()
if (sv%ipar(1) < 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/me/)) call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/iam/))
call psb_get_mpicomm(ictxt1, icomm) call psb_get_mpicomm(ictxt1, icomm)
allocate(sv%local_ictxt,stat=info) allocate(sv%local_ictxt,stat=info)
sv%local_ictxt = ictxt1 sv%local_ictxt = ictxt1
write(*,*)'mumps_bld: +++++>',icomm,ictxt1 write(*,*)'mumps_bld: +++++>',icomm,sv%local_ictxt
call psb_info(ictxt1, me, np) call psb_info(ictxt1, me, np)
npr = np npr = np
else else if (sv%ipar(1) == mld_global_solver_ ) then
call psb_get_mpicomm(ictxt,icomm) call psb_get_mpicomm(ictxt,icomm)
write(*,*)'mumps_bld: +++++>',icomm,ictxt write(*,*)'mumps_bld: +++++>',icomm,ictxt
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
npr = np me = iam
end if npr = np
npc = 1 else
if (debug_level >= psb_debug_outer_) & info = psb_err_internal_error_
& write(debug_unit,*) me,' ',trim(name),' start' call psb_errpush(info,name,&
! if (allocated(sv%id)) then & a_err='Invalid local/global solver in MUMPS')
! call sv%free(info) goto 9999
end if
npc = 1
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' start'
! if (allocated(sv%id)) then
! call sv%free(info)
! deallocate(sv%id) ! deallocate(sv%id)
! end if ! end if
if(.not.allocated(sv%id)) then if(.not.allocated(sv%id)) then
allocate(sv%id,stat=info) allocate(sv%id,stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_dealloc_ info=psb_err_alloc_dealloc_
call psb_errpush(info,name,a_err='mld_smumps_default') call psb_errpush(info,name,a_err='mld_dmumps_default')
goto 9999 goto 9999
end if
end if end if
end if
sv%id%comm = icomm sv%id%comm = icomm
sv%id%job = -1 sv%id%job = -1
sv%id%par = 1 sv%id%par = 1
call smumps(sv%id) call smumps(sv%id)
!WARNING: CALLING sMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX !WARNING: CALLING dMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX
if (allocated(sv%icntl)) then if (allocated(sv%icntl)) then
do i=1,mld_mumps_icntl_size do i=1,mld_mumps_icntl_size
if (allocated(sv%icntl(i)%item)) sv%id%icntl(i) = sv%icntl(i)%item if (allocated(sv%icntl(i)%item)) then
end do !write(0,*) 'MUMPS_BLD: setting entry ',i,' to ', sv%icntl(i)%item
end if sv%id%icntl(i) = sv%icntl(i)%item
if (allocated(sv%rcntl)) then
do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
nglob = desc_a%get_global_rows()
if (sv%ipar(1) < 0) then
nglobrec=desc_a%get_local_rows()
call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. A zero-overlap is used instead'
end if end if
else end do
call a%cp_to(acoo) end if
end if if (allocated(sv%rcntl)) then
nztota = acoo%get_nzeros() do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
! switch to global numbering nglob = desc_a%get_global_rows()
if (sv%ipar(1) >= 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I') nglobrec=desc_a%get_local_rows()
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I') call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. '
write(*,*)'A zero-overlap is used instead'
end if end if
sv%id%irn_loc => acoo%ia else
sv%id%jcn_loc => acoo%ja call a%cp_to(acoo)
sv%id%a_loc => acoo%val end if
sv%id%icntl(18) = 3 nztota = acoo%get_nzeros()
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)'calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call smumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_smumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
call acoo%free() ! switch to global numbering
sv%built=.true. if (sv%ipar(1) == mld_global_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I')
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I')
end if
sv%id%irn_loc => acoo%ia
sv%id%jcn_loc => acoo%ja
sv%id%a_loc => acoo%val
sv%id%icntl(18) = 3
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)iam, ' calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call dmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_dmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
if (debug_level >= psb_debug_outer_) & call acoo%free()
& write(debug_unit,*) me,' ',trim(name),' end' sv%built=.true.
call psb_erractionrestore(err_act) if (debug_level >= psb_debug_outer_) &
return & write(debug_unit,*) iam,' ',trim(name),' end'
call psb_erractionrestore(err_act)
return
9999 continue 9999 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then if (err_act == psb_act_abort_) then
call psb_error() call psb_error()
return
end if
return return
end if
return
#else #else
write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile " write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile "
#endif #endif
end subroutine s_mumps_solver_bld end subroutine s_mumps_solver_bld

@ -82,25 +82,37 @@ subroutine z_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
n_row = desc_data%get_local_rows() n_row = desc_data%get_local_rows()
n_col = desc_data%get_local_cols() n_col = desc_data%get_local_cols()
if (n_col <= size(work)) then ! Running in local mode?
ww = work(1:n_col) if (sv%ipar(1) == mld_local_solver_ ) then
else gx = x
allocate(ww(n_col),stat=info) else if (sv%ipar(1) == mld_global_solver_ ) then
if (n_col <= size(work)) then
ww = work(1:n_col)
else
allocate(ww(n_col),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
& a_err='complex(psb_dpk_)')
goto 9999
end if
end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_request_ info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),& call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='complex(psb_dpk_)') & a_err='complex(psb_dpk_)')
goto 9999 goto 9999
end if end if
call psb_gather(gx, x, desc_data, info, root=0)
else
info=psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Invalid local/global solver in MUMPS')
goto 9999
end if end if
allocate(gx(nglob),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/nglob,0,0,0,0/),&
& a_err='complex(psb_dpk_)')
goto 9999
end if
call psb_gather(gx, x, desc_data, info, root=0)
select case(trans_) select case(trans_)
case('N') case('N')
sv%id%icntl(9) = 1 sv%id%icntl(9) = 1
@ -120,10 +132,13 @@ subroutine z_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
sv%id%icntl(4)=-1 sv%id%icntl(4)=-1
sv%id%job = 3 sv%id%job = 3
call zmumps(sv%id) call zmumps(sv%id)
call psb_scatter(gx, ww, desc_data, info, root=0) if (sv%ipar(1) == mld_local_solver_ ) then
call psb_geaxpby(alpha,gx,beta,y,desc_data,info)
if (info == psb_success_) then else
call psb_geaxpby(alpha,ww,beta,y,desc_data,info) call psb_scatter(gx, ww, desc_data, info, root=0)
if (info == psb_success_) then
call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
end if
end if end if
if (info /= psb_success_) then if (info /= psb_success_) then
@ -132,9 +147,7 @@ subroutine z_mumps_solver_apply(alpha,sv,x,beta,y,desc_data,&
goto 9999 goto 9999
endif endif
if (nglob > size(work)) then if (allocated(ww)) deallocate(ww)
deallocate(ww)
endif
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

@ -58,135 +58,145 @@
! Local variables ! Local variables
type(psb_zspmat_type) :: atmp type(psb_zspmat_type) :: atmp
type(psb_z_coo_sparse_mat), target :: acoo type(psb_z_coo_sparse_mat), target :: acoo
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nglobrec, nzt, npr, npc
integer(psb_ipk_) :: ifrst, ibcheck integer(psb_ipk_) :: ifrst, ibcheck
integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, me, i, err_act, debug_unit, debug_level integer(psb_ipk_) :: ictxt, ictxt1, icomm, np, iam, me, i, err_act, debug_unit, debug_level
character(len=20) :: name='z_mumps_solver_bld', ch_err character(len=20) :: name='z_mumps_solver_bld', ch_err
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
info=psb_success_ info=psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
ictxt = desc_a%get_context() ictxt = desc_a%get_context()
if (sv%ipar(1) < 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/me/)) call psb_init(ictxt1,np=1,basectxt=ictxt,ids=(/iam/))
call psb_get_mpicomm(ictxt1, icomm) call psb_get_mpicomm(ictxt1, icomm)
allocate(sv%local_ictxt,stat=info) allocate(sv%local_ictxt,stat=info)
sv%local_ictxt = ictxt1 sv%local_ictxt = ictxt1
write(*,*)'mumps_bld: +++++>',icomm,ictxt1 write(*,*)'mumps_bld: +++++>',icomm,sv%local_ictxt
call psb_info(ictxt1, me, np) call psb_info(ictxt1, me, np)
npr = np npr = np
else else if (sv%ipar(1) == mld_global_solver_ ) then
call psb_get_mpicomm(ictxt,icomm) call psb_get_mpicomm(ictxt,icomm)
write(*,*)'mumps_bld: +++++>',icomm,ictxt write(*,*)'mumps_bld: +++++>',icomm,ictxt
call psb_info(ictxt, me, np) call psb_info(ictxt, iam, np)
npr = np me = iam
end if npr = np
npc = 1 else
if (debug_level >= psb_debug_outer_) & info = psb_err_internal_error_
& write(debug_unit,*) me,' ',trim(name),' start' call psb_errpush(info,name,&
! if (allocated(sv%id)) then & a_err='Invalid local/global solver in MUMPS')
! call sv%free(info) goto 9999
end if
npc = 1
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),' start'
! if (allocated(sv%id)) then
! call sv%free(info)
! deallocate(sv%id) ! deallocate(sv%id)
! end if ! end if
if(.not.allocated(sv%id)) then if(.not.allocated(sv%id)) then
allocate(sv%id,stat=info) allocate(sv%id,stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info=psb_err_alloc_dealloc_ info=psb_err_alloc_dealloc_
call psb_errpush(info,name,a_err='mld_zmumps_default') call psb_errpush(info,name,a_err='mld_dmumps_default')
goto 9999 goto 9999
end if
end if end if
end if
sv%id%comm = icomm sv%id%comm = icomm
sv%id%job = -1 sv%id%job = -1
sv%id%par = 1 sv%id%par = 1
call zmumps(sv%id) call zmumps(sv%id)
!WARNING: CALLING zMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX !WARNING: CALLING dMUMPS WITH JOB=-1 DESTROY THE SETTING OF DEFAULT:TO FIX
if (allocated(sv%icntl)) then if (allocated(sv%icntl)) then
do i=1,mld_mumps_icntl_size do i=1,mld_mumps_icntl_size
if (allocated(sv%icntl(i)%item)) sv%id%icntl(i) = sv%icntl(i)%item if (allocated(sv%icntl(i)%item)) then
end do !write(0,*) 'MUMPS_BLD: setting entry ',i,' to ', sv%icntl(i)%item
end if sv%id%icntl(i) = sv%icntl(i)%item
if (allocated(sv%rcntl)) then
do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
nglob = desc_a%get_global_rows()
if (sv%ipar(1) < 0) then
nglobrec=desc_a%get_local_rows()
call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. A zero-overlap is used instead'
end if end if
else end do
call a%cp_to(acoo) end if
end if if (allocated(sv%rcntl)) then
nztota = acoo%get_nzeros() do i=1,mld_mumps_rcntl_size
if (allocated(sv%rcntl(i)%item)) sv%id%cntl(i) = sv%rcntl(i)%item
end do
end if
sv%id%icntl(3)=sv%ipar(2)
! switch to global numbering nglob = desc_a%get_global_rows()
if (sv%ipar(1) >= 0 ) then if (sv%ipar(1) == mld_local_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I') nglobrec=desc_a%get_local_rows()
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I') call a%csclip(c,info,jmax=a%get_nrows())
call c%cp_to(acoo)
nglob = c%get_nrows()
if (nglobrec /= nglob) then
write(*,*)'WARNING: MUMPS solver does not allow overlap in AS yet. '
write(*,*)'A zero-overlap is used instead'
end if end if
sv%id%irn_loc => acoo%ia else
sv%id%jcn_loc => acoo%ja call a%cp_to(acoo)
sv%id%a_loc => acoo%val end if
sv%id%icntl(18) = 3 nztota = acoo%get_nzeros()
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)'calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call zmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_zmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
call acoo%free() ! switch to global numbering
sv%built=.true. if (sv%ipar(1) == mld_global_solver_ ) then
call psb_loc_to_glob(acoo%ja(1:nztota), desc_a, info, iact='I')
call psb_loc_to_glob(acoo%ia(1:nztota), desc_a, info, iact='I')
end if
sv%id%irn_loc => acoo%ia
sv%id%jcn_loc => acoo%ja
sv%id%a_loc => acoo%val
sv%id%icntl(18) = 3
if(acoo%is_upper() .or. acoo%is_lower()) then
sv%id%sym = 2
else
sv%id%sym = 0
end if
sv%id%n = nglob
! there should be a better way for this
sv%id%nz_loc = acoo%get_nzeros()
sv%id%nz = acoo%get_nzeros()
sv%id%job = 4
!call psb_barrier(ictxt)
write(*,*)iam, ' calling mumps N,nz,nz_loc',sv%id%n,sv%id%nz,sv%id%nz_loc
call dmumps(sv%id)
!call psb_barrier(ictxt)
info = sv%id%infog(1)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='mld_dmumps_fact '
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
nullify(sv%id%irn)
nullify(sv%id%jcn)
nullify(sv%id%a)
if (debug_level >= psb_debug_outer_) & call acoo%free()
& write(debug_unit,*) me,' ',trim(name),' end' sv%built=.true.
call psb_erractionrestore(err_act) if (debug_level >= psb_debug_outer_) &
return & write(debug_unit,*) iam,' ',trim(name),' end'
call psb_erractionrestore(err_act)
return
9999 continue 9999 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then if (err_act == psb_act_abort_) then
call psb_error() call psb_error()
return
end if
return return
end if
return
#else #else
write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile " write(psb_err_unit,*) "MUMPS Not Configured, fix make.inc and recompile "
#endif #endif
end subroutine z_mumps_solver_bld end subroutine z_mumps_solver_bld

@ -286,15 +286,15 @@ module mld_base_prec_type
integer(psb_ipk_), parameter :: mld_coarse_iluthrs_ = 4 integer(psb_ipk_), parameter :: mld_coarse_iluthrs_ = 4
integer(psb_ipk_), parameter :: mld_solver_eps_ = 6 integer(psb_ipk_), parameter :: mld_solver_eps_ = 6
integer(psb_ipk_), parameter :: mld_rfpsz_ = 8 integer(psb_ipk_), parameter :: mld_rfpsz_ = 8
!
! Is the current solver local or global
!
integer(psb_ipk_), parameter :: mld_local_solver_ = 0
integer(psb_ipk_), parameter :: mld_global_solver_ = 1
! !
! Entries for mumps ! Entries for mumps
! !
!parameter controling the sequential/parallel building of MUMPS
integer(psb_ipk_), parameter :: mld_as_sequential_ = 40
!parameter regulating the error printing of MUMPS
integer(psb_ipk_), parameter :: mld_mumps_print_err_ = 41
! Size of the control vectors ! Size of the control vectors
integer, parameter :: mld_mumps_icntl_size=40 integer, parameter :: mld_mumps_icntl_size=40
integer, parameter :: mld_mumps_rcntl_size=15 integer, parameter :: mld_mumps_rcntl_size=15
@ -483,6 +483,10 @@ contains
val = mld_no_filter_mat_ val = mld_no_filter_mat_
case('OUTER_SWEEPS') case('OUTER_SWEEPS')
val = mld_outer_sweeps_ val = mld_outer_sweeps_
case('LOCAL_SOLVER')
val = mld_local_solver_
case('GLOBAL_SOLVER')
val = mld_global_solver_
case default case default
val = -1 val = -1
end select end select

@ -291,7 +291,7 @@ contains
select case(psb_toupper(what)) select case(psb_toupper(what))
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
case('MUMPS_AS_SEQUENTIAL') case('MUMPS_SOLVER_LOC_GLOB')
sv%ipar(1)=val sv%ipar(1)=val
case('MUMPS_PRINT_ERR') case('MUMPS_PRINT_ERR')
sv%ipar(2)=val sv%ipar(2)=val
@ -401,7 +401,8 @@ contains
! sv%id%job = -1 ! sv%id%job = -1
! sv%id%par=1 ! sv%id%par=1
! call dmumps(sv%id) ! call dmumps(sv%id)
sv%ipar(1)=2 sv%ipar = 0
sv%ipar(1) = mld_global_solver_
!sv%ipar(10)=6 !sv%ipar(10)=6
!sv%ipar(11)=0 !sv%ipar(11)=0
!sv%ipar(12)=6 !sv%ipar(12)=6

@ -291,7 +291,7 @@ contains
select case(psb_toupper(what)) select case(psb_toupper(what))
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
case('MUMPS_AS_SEQUENTIAL') case('MUMPS_SOLVER_LOC_GLOB')
sv%ipar(1)=val sv%ipar(1)=val
case('MUMPS_PRINT_ERR') case('MUMPS_PRINT_ERR')
sv%ipar(2)=val sv%ipar(2)=val
@ -401,7 +401,8 @@ contains
! sv%id%job = -1 ! sv%id%job = -1
! sv%id%par=1 ! sv%id%par=1
! call dmumps(sv%id) ! call dmumps(sv%id)
sv%ipar(1)=2 sv%ipar = 0
sv%ipar(1) = mld_global_solver_
!sv%ipar(10)=6 !sv%ipar(10)=6
!sv%ipar(11)=0 !sv%ipar(11)=0
!sv%ipar(12)=6 !sv%ipar(12)=6

@ -291,7 +291,7 @@ contains
select case(psb_toupper(what)) select case(psb_toupper(what))
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
case('MUMPS_AS_SEQUENTIAL') case('MUMPS_SOLVER_LOC_GLOB')
sv%ipar(1)=val sv%ipar(1)=val
case('MUMPS_PRINT_ERR') case('MUMPS_PRINT_ERR')
sv%ipar(2)=val sv%ipar(2)=val
@ -401,7 +401,8 @@ contains
! sv%id%job = -1 ! sv%id%job = -1
! sv%id%par=1 ! sv%id%par=1
! call dmumps(sv%id) ! call dmumps(sv%id)
sv%ipar(1)=2 sv%ipar = 0
sv%ipar(1) = mld_global_solver_
!sv%ipar(10)=6 !sv%ipar(10)=6
!sv%ipar(11)=0 !sv%ipar(11)=0
!sv%ipar(12)=6 !sv%ipar(12)=6

@ -291,7 +291,7 @@ contains
select case(psb_toupper(what)) select case(psb_toupper(what))
#if defined(HAVE_MUMPS_) #if defined(HAVE_MUMPS_)
case('MUMPS_AS_SEQUENTIAL') case('MUMPS_SOLVER_LOC_GLOB')
sv%ipar(1)=val sv%ipar(1)=val
case('MUMPS_PRINT_ERR') case('MUMPS_PRINT_ERR')
sv%ipar(2)=val sv%ipar(2)=val
@ -401,7 +401,8 @@ contains
! sv%id%job = -1 ! sv%id%job = -1
! sv%id%par=1 ! sv%id%par=1
! call dmumps(sv%id) ! call dmumps(sv%id)
sv%ipar(1)=2 sv%ipar = 0
sv%ipar(1) = mld_global_solver_
!sv%ipar(10)=6 !sv%ipar(10)=6
!sv%ipar(11)=0 !sv%ipar(11)=0
!sv%ipar(12)=6 !sv%ipar(12)=6

Loading…
Cancel
Save