How to use UMFPACK from Fortran 90

573 views
Skip to first unread message

Kevin

unread,
May 19, 2011, 4:11:52 PM5/19/11
to matrixprogramming
I am trying to solve AX=B, where A is a huge sparse matrix. So, how to
combine UMFPACK with Fortran program?

Evgenii Rudnyi

unread,
May 19, 2011, 4:21:25 PM5/19/11
to matrixpr...@googlegroups.com
On 19.05.2011 22:11 Kevin said the following:

> I am trying to solve AX=B, where A is a huge sparse matrix. So, how to
> combine UMFPACK with Fortran program?
>

UMFPACK should have a Fortran-77 interface. Presumably you should use
it. Alternatively you can use MUMPS that is written directly in Fortran
90.

Zhizhuo Zhao

unread,
May 19, 2011, 4:35:02 PM5/19/11
to matrixpr...@googlegroups.com
I prefer UMFPACK. Where can I get the Fortran-77 interface for it?


--
You received this message because you are subscribed to the Google Groups "matrixprogramming" group.
To post to this group, send email to matrixpr...@googlegroups.com.
To unsubscribe from this group, send email to matrixprogramm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/matrixprogramming?hl=en.


Evgenii Rudnyi

unread,
May 20, 2011, 1:38:08 AM5/20/11
to matrixpr...@googlegroups.com
A good starting point is the documentation, for example

7 Using UMFPACK in a Fortran program

Well, in

8.3 Installing the Fortran interface

there is following:

>This interface is highly non-portable, since it depends on how C and
Fortran are interfaced.

So you may need to be ready to invest some time. It could be that my
document

Using Fortran Subroutines from C++
http://matrixprogramming.com/2008/03/usingfortranfromc

could be of help to understand the potential problems even though it
considers another way, from Fortran to C.

On 19.05.2011 22:35 Zhizhuo Zhao said the following:

Kevin

unread,
May 20, 2011, 12:22:07 PM5/20/11
to matrixpr...@googlegroups.com
I thought UMFPACK is based on LU and I am wondering whether it is efficient to solve a huge sparse matrix, like 2 million by 2 million? LINSOL is based on the conjugate gradient method and might be the better option for my case. Anyway, did you use LINSOL before? I met some trouble on compiling it.

./source/linsol/linsol.f is being compiled ...
ifort -c -O3 -I./include -I/opt/mpich/include ./source/linsol/linsol.f
cp linsol.o ./source/linsol/linsol.o
linsol.o is being linked ...
ifort  -o ./bin/linsol linsol.o ./lib/liblinsol.a ./lib/libnocomm.a -I/opt/mpich/include -L/opt/mpich/lib -lmpichf90 -lmpich
ld: skipping incompatible /opt/mpich/lib/libmpichf90.a when searching for -lmpichf90
ld: cannot find -lmpichf90
make: *** [linsol] Error 1

Evgenii Rudnyi

unread,
May 20, 2011, 3:49:21 PM5/20/11
to matrixpr...@googlegroups.com
On 20.05.2011 18:22 Kevin said the following:

> I thought UMFPACK is based on LU and I am wondering whether it is efficient
> to solve a huge sparse matrix, like 2 million by 2 million? LINSOL is based

Yes, UMFPACK is a direct solver (the same for MUMPS). Yes, a direct
solver can be used nowadays for 2 million by 2 million but you may need
a lot of RAM. It is highly depends on the matrix however.

> on the conjugate gradient method and might be the better option for my case.

An iterative solver could be better than a direct solver, or it could be
worse. It is again highly depends on the matrix. Usually you need a
preconditioner for an iterative solver.

> Anyway, did you use LINSOL before? I met some trouble on compiling it.
>
> ./source/linsol/linsol.f is being compiled ...
> ifort -c -O3 -I./include -I/opt/mpich/include ./source/linsol/linsol.f
> cp linsol.o ./source/linsol/linsol.o
> linsol.o is being linked ...
> ifort -o ./bin/linsol linsol.o ./lib/liblinsol.a ./lib/libnocomm.a
> -I/opt/mpich/include -L/opt/mpich/lib -lmpichf90 -lmpich
> ld: skipping incompatible /opt/mpich/lib/libmpichf90.a when searching for
> -lmpichf90
> ld: cannot find -lmpichf90
> make: *** [linsol] Error 1

Something is wrong with libmpichf90.a. It could be that you compile for
32-bit and this library is for 64-bit or vice versa. Or it from some
other platform.

Kevin

unread,
May 23, 2011, 6:00:00 PM5/23/11
to matrixpr...@googlegroups.com
Anyone in this group is using/used LINSOL?


--
Reply all
Reply to author
Forward
0 new messages