- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
does anybody knows how to use libraries in fortran?
For example, I would like to use GMRES subprogram for solving linear system of equations. At the beginning I define:
extarnal gmres
and then somewhere in the program I call the subroutine:
call gmres(....)
But I cannot build .exe file because there is an error:
GMRES.obj : error LNK2001: unresolved external symbol _GMRES@28
Does anybody know what is the problem and how I am supose to include those external libraries?
I am using Visual Fortran 5.0
Thanks,
S.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have never worked with external but usually use CALL in combination with SUBROUTINE. Did you try your gmres as SUBROUTINE instead of external?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But my probelm is how to solve (which solver to use) very simple linear equation system:
A * x = b
Does anybody know if there is any library in fortran doing that and how to use it?
How can I find this Programmers Manual, because I have some problems to find it on my computer, is there any online version?
Regards,
S.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
there are three interesting pdf files usually in
C:programsintelfortrancompiler80docs
for_igs.pdf
for_lib.pdf
for_lang.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Google search shows GMRES as a routine available in MATLAB (a commercial product.) You will have to find either source for a GMRES routine or use someone else's library that provides one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it is only a very simple (small N) system of linear equations, you should consider to use a direct solver instead of the iterative approach GMRES. Use, for instance, LU-Decomposition. You can find appropriate Fortran code in the book "Numerical Recipes in Fortran". You could also use the routines provided by LAPACK (In this case e.g. ZGETRS and ZGETRF and the corresponding depencdencies). Fortran77-Reference code is available at www.netlib.org/Lapack. However, these are not tuned for best performance but may work well for small problem sizes. Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And I tried to use LINPACK too, but the problem is that I need to call some subroutines (which are external) and I dont know how to include them in my project. That doesnt go automatically, and therefore, I cannot build the code.
Does anybody know how to include this in the libraries, or in a project, or how to install LINPACK?
Regards,
S.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CVF does provide the Compaq Extended Math Library in all editions, though I don't think it was in DVF 5. I don't think GMRES is there either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
He could try using MKL implementation of PARDISO.
PARDISO, especially as implemented in MKL, is almost across the board superior to All other Commercially available linear system solvers, even the hugely more expensive HSL routine (MA57 in particular).
I suggest he look at
http://www.intel.com/cd/software/products/asmo-na/eng/perflib/mkl/266853.htm
as well as
ftp://ftp.numerical.rl.ac.uk/pub/reports/shgNAGIR20041.pdf
wherein it reads "The codes BCSLIB-EXT, MA57, and PARDISO have the fastest solve times." for definite systems and "Overall, PARDISO was the fastest code on our set of inde nite problems." for indefinite systems.
He will have to (possibly) learn to input the Compressed Sparse Row format arrays required by PARDISO, but it's not terribly difficult.
I've found PARDISO to be very memory efficient and blisteringly fast on IA-32, and I'm going to see soon what's it's efficiency/speed characteristics are on EM64T. But first I've got to get my head around IVF 9.1.
Anyway, it says quite a bit that Intel goliath "picked up" PARDISO for inclusion in its MKL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.netlib.org/utk/people/JackDongarra/la-sw.html
Maybe, there is a routine (or package) that better fits your needs (or is easier to include in your projekt).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My experience is soley with PARDISO; I've not used the DSS MKL "components" implementation of sparese solver.
Yes, exe's built (currently one can only statically link to mkl_solver.lib) against PARDISO will run properly on single processor machines.
You would be well advised to visit the MKL forum for (much more expert) advice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
GMRES is not predefined in Fortran...you have to get the separate code from other sources like netlib.org etc..I got it from there but got stucked somewhere in debugging..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to second the recommendation to use PARDISO. The performance is very impressive--single/dual Intel or AMD, all very fast. In my code I call PARDISO anywhere from 2 to several thousand times on sparse linear systems ranging in size from 4x4 to 83700x83700 (even larger for "real world problems"). One of the nice features with PARDISO is that the setup is separate from the solving, to wit:
! Create a handle for the sparse direct solver error = dss_create(handle, MKL_DSS_DEFAULTS) IF(error .NE. MKL_DSS_SUCCESS) THEN WRITE(*,*) 'Unable to initialize DSS, error = ', error STOP END IF CALL initialize_sparse_matrix(transport_data, nRows, nElements) error = dss_define_structure(handle, & MKL_DSS_NON_SYMMETRIC, & rowIndex, nRows, nRows, columns, & nElements) ! Number of non-zero elements IF(error .NE. MKL_DSS_SUCCESS) THEN WRITE(*,*) 'Unable to define structure, error = ', error STOP END IF ! Reorder the matrix. Pass a dummy permutation matrix ! because we are going to let DSS figure it out perm = 0 error = dss_reorder(handle, MKL_DSS_AUTO_ORDER, perm) IF(error .NE. MKL_DSS_SUCCESS) THEN WRITE(*,*) 'Unable to reorder matrix, error = ', error STOP END IF
Then, to solve a system, requires
! Factor the matrix. error = dss_factor_real( handle, MKL_DSS_DEFAULTS, values) IF (error .NE. MKL_DSS_SUCCESS) THEN WRITE(*,*) 'Unable to factor matrix, error = ', error STOP END IF ! Solve the system ! Passing BJface(1,1) passes the start of the array. Due to Fortran's ! sequence association rules, the array will be arranged in the correct ! order. This should work for any compiler and avoid an expensive ! (both in memory and execution time) penalty associated with a RESHAPE. error = dss_solve_real(handle, MKL_DSS_DEFAULTS, & BJextface(1,1), 1, BJface(1,1)) IF (error .NE. MKL_DSS_SUCCESS) THEN WRITE(*,*) 'Unable to factor matrix, error = ', error STOP END IF
On a slightly separte note, Intel also has a cluster version of PARDISO (which is interesting because it was designed for a shared uniform memory architecture--OpenMP style vice MPI). We have been toying with the idea of picking up a license for Cluster MKL to try it out.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page