Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

PARDISO and FEAST

$
0
0

The old 73 Harrison Structural Analysis program written in 66 Fortran has now had the solver taken out and PARDISO put in its place.  It was an interesting task as I tried to ensure it was all in MODULES.

MODULE StructureType
    USE SOLVER
    INTEGER, PARAMETER :: dp = selected_real_kind(15, 307)
    REAL (KIND=dp) :: g = 9.806, pi = 3.14159265D0

​So the interesting question is the use of the standard DP constant, if I use it in each module, they conflict when I call the solver module from the structure type module - it is also useful having the g and pi defined. I can fix it by making DP private in SOLVER, but that means if I use solver elsewhere alone, I have to unprivate DP to declare the main program variables - How am I supposed to do it for real?

      MODULE Solver
      INTEGER, PRIVATE, PARAMETER :: dp = selected_real_kind(15, 307)

      contains

      subroutine linsolve(n, error, nnz, a, ja, ia, b, x)
      implicit none
      include 'mkl_pardiso.fi'

It is fascinating climbing into someone's old code, Harrison created a GK matrix to hold the data for the inversion routine, quite clever, but not easy to unwind when you want to use PARDISO -  took a while to sort out his names for the various arrays -- the book gave some clues, but it took a while.  Slowly cleaning up the code -- was it worth it -- I think so as he had excellent notes -- and a good sample problem, although he made some mistakes with his units conversions but it means I have a nice front end for PARDISO -- which is somewhat faster than my normal structures package and a simple text file is nice for small structures models.  

The FEAST is a real treat, it works now from within the program so I get the solution and the modes, should not be hard to do time stepping, but that can wait. The program takes less than 0.5 seconds to solve a simple problem - my issue is all the writing out from the different codes, Pardios is only 0.015 seconds of time.

STEVE:  Can I suggest that if INTEL put PARDISO and FEAST together you would have an excellent routine - not that it is not that hard, but the different methods for storing matrices is a bit of a waste and calling them one after the other is tedious.

do 567 j=1,mn_6
            do 566 L4 = 1,mn_12
                Results(J) = Results(J) + SATT(I,J,L4)*disp(L4)
566 END do
567 end do

The S matrix (location in XYZ) and the A transpose matrix are set up in SAT to do the final beam resultant forces and moments it is quickest to take the SAT results adn store each one in an 3 D array where I is each beam.  I is an outside loop, is there a way to simplify this set of loops or am I stuck with them. 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>