migrating from IMSL to petsc

knutert at stud.ntnu.no knutert at stud.ntnu.no
Mon Oct 8 02:38:03 CDT 2007


Hello,

I have converted a code of similar size to use PETSc solvers.
What I did was to write small, generic subroutines to convert arrays
to Vec and Mat format. Very small changes to the actual code had to be made,
and the conversion process went relatively painless.

Good luck, maybe the PETSc developers have some better suggestions.

-Knut Erik-
Siterer Kamaraju Kusumanchi <kamaraju at bluebottle.com>:

> Hi all
>
>     I have a rather large Fortran 90 code (say 10,000 lines long) which
> extensively uses IMSL libraries for solving linear systems. Because of the
> limited capabilities of IMSL, the cost involved in purchasing the license
> etc., we are considering going with petsc instead. I have read the FAQs on
> the petsc website, finished reading the user manual. I have a few questions
> which the experts might find trivial to answer...
>
>     Let's say I am solving Ax=B using IMSL's LU decomposition   
> routine. In this
> case, A would be an nxn matrix, x and B would nx1 vectors. In the fortran 90
> code these are declared as (assuming statically allocated)
>
> real :: A(1:n,1:n), B(1:n), x(1:n)
>
> The IMSL routines just directly accept A, x, B as arguments. Whereas, the
> petsc's solvers seem to require the arguments to be of type Vec, Mat etc.,
> Converting all the arrays into Vec, Mat types would involve quite a bit of
> changes in the code, which I would like to avoid if possible. So my questions
> are
>
> 1) What is the best way to migrate a fortran 90 code using IMSL libraries to
> Petsc libraries with minimal changes in the code?
>
> 2) Is there any way to use petsc linear solvers (to solve Ax=b) without
> dealing with new data types Vec, Mat etc., and just sticking with real
> arrays? At this point, I am only interested in solving the system of
> equations Ax=b and am not trying to exploit other cool features of petsc.
>
> thanks for any suggestions
> raju
>
> --
> Kamaraju S Kusumanchi
> http://www.people.cornell.edu/pages/kk288/
> http://malayamaarutham.blogspot.com/
>
> ----------------------------------------------------------------------
> Find out how you can get spam free email.
> http://www.bluebottle.com/tag/3
>
>
>






More information about the petsc-users mailing list