! This particular example can be found in MUMPS_4.7.3/test ! ! stali@purdue.edu program main implicit none #include "mpif.h" #include "dmumps_struc.h" type(dmumps_struc) :: mumps_par integer :: ierr, i call mpi_init(ierr) ! Define a communicator for the package. mumps_par%comm = mpi_comm_world ! Initialize an instance of the package ! for LU factorization (sym = 0, with working host) mumps_par%job = -1 mumps_par%sym = 0 mumps_par%par = 1 call dmumps(mumps_par) ! Define problem on the host (proc 0) if ( mumps_par%myid == 0 ) then read*, mumps_par%n read*, mumps_par%nz allocate (mumps_par%irn (mumps_par%nz)) allocate (mumps_par%jcn (mumps_par%nz)) allocate (mumps_par%a (mumps_par%nz)) allocate (mumps_par%rhs (mumps_par%n)) do i = 1, mumps_par%nz read*, mumps_par%irn(i),mumps_par%jcn(i),mumps_par%a(i) end do do i = 1, mumps_par%n read*, mumps_par%rhs(i) end do end if ! Call package for solution mumps_par%job = 6 call dmumps(mumps_par) ! Solution has been assembled on the host if ( mumps_par%myid == 0 ) then print*, mumps_par%rhs end if ! Deallocate user data if ( mumps_par%myid == 0 )then deallocate ( mumps_par%irn, mumps_par%jcn, mumps_par%a, mumps_par%rhs ) end if ! Destroy the instance (deallocate internal data structures) mumps_par%job = -2 call dmumps(mumps_par) call mpi_finalize(ierr) end program main