Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28386 Discussions

Program using IMSL LIN_SOL_GEN crashing on runtime machine

Cédric_H_
Beginner
392 Views

Hello all,

This has to be a silly problem but I can't seem to find the source of it.

I have created a Fortran module which I compile and link to work with Python. This module makes use of several routines of the IMSL library, including LIN_SOL_GEN. Compilation seems to work fine( I'm using static linking) and the whole thing runs fine on my machine. However, when I give the compiled file to a colleague to run on his machine (he has installed the Intel Fortran redistributables library), everything works fine except for the LIN_SOL_GEN routine. On his machine, when that particular routine is called, the program stops without any error message. Absolutely no clue whatsoever.

I have modified the terminal error flags so that IMSL routines won't stop the program, to no avail.

I have tried to use an alternate routine to perform the linear solve, LIN_SOL_SVD (basically, just changed the name of the routine called!), and the whole thing works fine on the runtime machine, albeit LIN_SOL_SVD is a lot slower than LIN_SOL_GEN for my particular problem.

I suspect this has to do with "High performance"/SMP behaviour of LIN_SOL_GEN but can't find exactly what makes it fail on the runtime machine but not on mine. Is there something special to do to make SMP routines work on runtime-only machines?

Many thanks.

 

Cédric

 

0 Kudos
3 Replies
Steven_L_Intel1
Employee
376 Views

You might need to install MKL redistributables on the target system. These are not included with the compiler redist installer.

0 Kudos
Cédric_H_
Beginner
376 Views

Thanks for the suggestion Steve.

I've tried that but it did not fix the problem (I copied the mkl folder from the redist folder and added the copied folder to the path on the target machine). However, I think it did send me on the right path since I have now fixed the issue, which was related to the linking process.

I have found out that the crash depended on array size. When the arrays used were small enough, the program would run fine on the target machine and above a certain unknown size, it just crashed silently. I've looked at the event log and the exception code was 0x000000c5 (access violation?). That was all puzzling and didn't help. But perhaps it can be seen as a symptom for other people.

This occurred when using LIN_SOL_GEN and LSADS. I didn't have the problem when using LIN_SOL_SVD (but it's far slower since not optimised for my kind of problem, real symmetric positive definite matrix).

I have managed to resolve the problem by changing a /MD flag to a /MT and adding the mkl path to the link paths. The size of the compiled dll went from 8MB to 11MB, which indicates something was not getting statically linked (perhaps mkl?). I guess on the target machine, something strange happened because of that. Perhaps something was getting screwed up in some calls to mkl.

Anyway, problem solved.

Thanks.

Cédric

0 Kudos
Steven_L_Intel1
Employee
376 Views

Ok, glad to hear it.

0 Kudos
Reply