solution_solver Subroutine

private subroutine solution_solver(mat)

Subroutine to solve the system (sparse A)

Arguments

Type IntentOptional Attributes Name
type(MAT_SOLV), intent(inout), target :: mat

high level system type


Calls

proc~~solution_solver~~CallsGraph proc~solution_solver solution_solver dmumps dmumps proc~solution_solver->dmumps infog infog proc~solution_solver->infog ma48_solve ma48_solve proc~solution_solver->ma48_solve mpi_finalize mpi_finalize proc~solution_solver->mpi_finalize proc~s_umfpack_di_solve s_umfpack_di_solve proc~solution_solver->proc~s_umfpack_di_solve proc~solv_superlu solv_superlu proc~solution_solver->proc~solv_superlu proc~solve_syst solve_syst proc~solution_solver->proc~solve_syst rhs rhs proc~solution_solver->rhs proc~umfpack_di_solve umfpack_di_solve proc~s_umfpack_di_solve->proc~umfpack_di_solve interface~destroy_compcol_matrix Destroy_CompCol_Matrix proc~solv_superlu->interface~destroy_compcol_matrix interface~destroy_supernode_matrix Destroy_SuperNode_Matrix proc~solv_superlu->interface~destroy_supernode_matrix interface~dgssvx dgssvx proc~solv_superlu->interface~dgssvx interface~statfree StatFree proc~solv_superlu->interface~statfree interface~statinit StatInit proc~solv_superlu->interface~statinit interface~statprint StatPrint proc~solv_superlu->interface~statprint proc~prep_superlu prep_superlu proc~solv_superlu->proc~prep_superlu proc~solve_syst->proc~solution_solver proc~analyse_solver analyse_solver proc~solve_syst->proc~analyse_solver proc~close_solver close_solver proc~solve_syst->proc~close_solver proc~factorize_solver factorize_solver proc~solve_syst->proc~factorize_solver proc~freefact_solver freefact_solver proc~solve_syst->proc~freefact_solver proc~init_solver init_solver proc~solve_syst->proc~init_solver proc~analyse_solver->dmumps proc~analyse_solver->proc~prep_superlu ma48_analyse ma48_analyse proc~analyse_solver->ma48_analyse proc~s_umfpack_di_symbolic s_umfpack_di_symbolic proc~analyse_solver->proc~s_umfpack_di_symbolic proc~close_solver->dmumps proc~close_solver->infog proc~close_solver->mpi_finalize ma48_finalize ma48_finalize proc~close_solver->ma48_finalize proc~close_superlu close_superlu proc~close_solver->proc~close_superlu proc~umfpack_di_free_numeric umfpack_di_free_numeric proc~close_solver->proc~umfpack_di_free_numeric proc~umfpack_di_free_symbolic umfpack_di_free_symbolic proc~close_solver->proc~umfpack_di_free_symbolic proc~umfpack_di_report_info umfpack_di_report_info proc~close_solver->proc~umfpack_di_report_info proc~factorize_solver->dmumps ma48_factorize ma48_factorize proc~factorize_solver->ma48_factorize proc~fact_superlu fact_superlu proc~factorize_solver->proc~fact_superlu proc~s_umfpack_di_numeric s_umfpack_di_numeric proc~factorize_solver->proc~s_umfpack_di_numeric proc~factorize_solver->proc~umfpack_di_free_numeric proc~free_superlu free_superlu proc~freefact_solver->proc~free_superlu proc~freefact_solver->proc~umfpack_di_free_numeric proc~init_solver->dmumps proc~init_solver->infog proc~init_solver->mpi_finalize icntl icntl proc~init_solver->icntl ma48_initialize ma48_initialize proc~init_solver->ma48_initialize mpi_init mpi_init proc~init_solver->mpi_init proc~init_superlu init_superlu proc~init_solver->proc~init_superlu proc~umfpack_di_defaults umfpack_di_defaults proc~init_solver->proc~umfpack_di_defaults proc~umfpack_di_report_control umfpack_di_report_control proc~init_solver->proc~umfpack_di_report_control interface~dcreate_compcol_matrix dCreate_CompCol_Matrix proc~prep_superlu->interface~dcreate_compcol_matrix interface~dcreate_dense_matrix dCreate_Dense_Matrix proc~prep_superlu->interface~dcreate_dense_matrix interface~c_umfpack_di_solve c_umfpack_di_solve proc~umfpack_di_solve->interface~c_umfpack_di_solve proc~close_superlu->interface~destroy_compcol_matrix interface~destroy_dense_matrix Destroy_Dense_Matrix proc~close_superlu->interface~destroy_dense_matrix proc~fact_superlu->interface~dgssvx proc~fact_superlu->interface~statfree proc~fact_superlu->interface~statinit proc~fact_superlu->interface~statprint interface~set_default_options set_default_options proc~init_superlu->interface~set_default_options proc~umfpack_di_numeric umfpack_di_numeric proc~s_umfpack_di_numeric->proc~umfpack_di_numeric proc~umfpack_di_symbolic umfpack_di_symbolic proc~s_umfpack_di_symbolic->proc~umfpack_di_symbolic interface~c_umfpack_di_defaults c_umfpack_di_defaults proc~umfpack_di_defaults->interface~c_umfpack_di_defaults interface~c_umfpack_di_free_numeric c_umfpack_di_free_numeric proc~umfpack_di_free_numeric->interface~c_umfpack_di_free_numeric interface~c_umfpack_di_free_symbolic c_umfpack_di_free_symbolic proc~umfpack_di_free_symbolic->interface~c_umfpack_di_free_symbolic interface~c_umfpack_di_report_control c_umfpack_di_report_control proc~umfpack_di_report_control->interface~c_umfpack_di_report_control interface~c_umfpack_di_report_info c_umfpack_di_report_info proc~umfpack_di_report_info->interface~c_umfpack_di_report_info interface~c_umfpack_di_numeric c_umfpack_di_numeric proc~umfpack_di_numeric->interface~c_umfpack_di_numeric interface~c_umfpack_di_symbolic c_umfpack_di_symbolic proc~umfpack_di_symbolic->interface~c_umfpack_di_symbolic

Called by

proc~~solution_solver~~CalledByGraph proc~solution_solver solution_solver proc~solve_syst solve_syst proc~solution_solver->proc~solve_syst proc~solve_syst->proc~solution_solver program~test_solvers test_solvers program~test_solvers->proc~solve_syst

Source Code

   subroutine solution_solver(mat)
   !! Subroutine to solve the system \([A]\{x\} = \{b\}\) (sparse A)
   implicit none
   type(MAT_SOLV), target, intent(inout) :: mat   !! *high level system type*

      integer(kind=I4) :: ierr

      select case(mat%slv_t)

         case(MA48)
#if WITH_MA48
            call ma48_solve(matrix = mat%matma48%zmat,   &
                           factors = mat%matma48%fact,   &
                               rhs = mat%b,              &
                                 x = mat%x,              &
                           control = mat%matma48%ctrl,   &
                             sinfo = mat%matma48%sinf,   &
                             resid = mat%matma48%resid,  &
                             error = mat%error)
#else
   stop 'MA48_LIB not defined'
#endif

         case(MUMP)
            mat%matmump%job = 3
            call dmumps(mat%matmump)
            if (mat%matmump%infog(1) < 0) then
               write(OPU,'(a,a,i6,a,i9)') ' error return: ',                              &
                                          '  mumps_par%infog(1)= ', mat%matmump%infog(1), &
                                          '  mumps_par%infog(2)= ', mat%matmump%infog(2)
               call mpi_finalize(ierr)
               stop 'Error in SOLUTION_SOLVER'
            endif
            ! solution has been assembled on the host
            if ( mat%matmump%myid == 0 ) then
               mat%x(1:mat%nn) = mat%matmump%rhs(1:mat%nn)
            endif

         case(SULU)
            call solv_superlu(sol_x = mat%x,        &
                              sulu  = mat%matsulu,  &
                           verbose  = (mat%matsulu%options%PrintStat==1))
            mat%matsulu%first = .false.

         case(UMFP)
            ! Numeric factors must exist
            if (.not.C_ASSOCIATED(mat%matumfp%c_numeric)) call solve_syst(mat, 'fac')
            mat%matumfp%c_control(UMFPACK_IRSTEP) = 0 ! solve ax=b, without iterative refinement

            ! If you want to evaluate the required RAM (Go)
            ! write(*,*) mat%matumfp%c_info(UMFPACK_PEAK_MEMORY_ESTIMATE)/mat%matumfp%c_info(UMFPACK_SIZE_OF_UNIT)/1e9
            ! write(*,*) sizeof(mat%a_elt)/1e9

            call s_umfpack_di_solve(sys = UMFPACK_A,              &
                                      x = mat%x,                  &
                                      b = mat%b,                  &
                                numeric = mat%matumfp%c_numeric,  &
                                control = mat%matumfp%c_control,  &
                                   info = mat%matumfp%c_info)

            if (mat%matumfp%c_info(UMFPACK_STATUS) < 0) then
               write(OPU, *) 'error occurred in umfpack_di_solve: ', mat%matumfp%c_info(UMFPACK_STATUS)
               stop 'Error in SOLUTION_SOLVER'
            endif

         case default
            stop 'Unknown solver type, SOLUTION_SOLVER'

      endselect

   return
   endsubroutine solution_solver