Author Topic: problem calling sparse MKL library in a user macro  (Read 5383 times)

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
problem calling sparse MKL library in a user macro
« on: April 20, 2014, 01:08:55 PM »
Hello FEAP Users,
I would like to use the sparse routines from Intel MKL library. There seems to be memory overwriting error that occurs when the routine is called from FEAP. To help resolve this problem a small routine is attached to illustrate. The input data file calls the routine for matrix vector operation. The result retrieved is incorrect. Attached the same routine but in standalone form that performs same operation. Now the result is correct.
I am wondering if I am missing something in regards to the user macro or perhaps if anyone encountered similar problem. Please let me know.

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: problem calling sparse MKL library in a user macro
« Reply #1 on: April 20, 2014, 07:03:49 PM »
Your standalone program is not a standalone program.  How did you run this?

That said, the codes are essentially the same but in one you initialize Y and in the other you do not.
Is this the problem?

Otherwise I see no reason for the failure.

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
Re: problem calling sparse MKL library in a user macro
« Reply #2 on: April 21, 2014, 04:37:27 AM »
Both programs compiled using gfortran and linked to
-L /usr/global/intel/mkl/11.0.0.079/lib/intel64/ -lmkl_rt -lX11 -lm -g. In FEAP this is just inserted in the makefile.in

 

« Last Edit: April 21, 2014, 02:23:02 PM by M. Kurdi »

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
Re: problem calling sparse MKL library in a user macro
« Reply #3 on: April 21, 2014, 02:32:48 PM »
The problem is due to the -i8 flag for "ifort" or -fdefault-integer-8 flag in gfortran. If these are removed then the program can be executed correctly within gdb but crashes when run separately. This could be due to the fact that the mkl library is pre-built based on short integers. However I am puzzled why running without gdb crashes.
« Last Edit: April 21, 2014, 05:28:28 PM by M. Kurdi »

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: problem calling sparse MKL library in a user macro
« Reply #4 on: April 22, 2014, 06:05:36 PM »
Why are you using -i8?  This something you only need to do if you have extremely large problems.  Otherwise you should be using 32-bit integers (note this is independent of whether or not you have 64-bit pointers and are using include/integer8).
« Last Edit: April 22, 2014, 06:15:42 PM by FEAP_Admin »

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
Re: problem calling sparse MKL library in a user macro
« Reply #5 on: April 22, 2014, 06:19:45 PM »
Correct, I'm not using this anymore. In addition I had erroneously set ipr=1 in feap84.f Now life is good :)

Brian

  • Jr. Member
  • **
  • Posts: 33
Re: problem calling sparse MKL library in a user macro
« Reply #6 on: October 21, 2015, 04:48:12 AM »
How to link umacr19 to feap by visual studio?

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: problem calling sparse MKL library in a user macro
« Reply #7 on: October 21, 2015, 09:46:42 AM »
add the files to your project and rebuild.

Brian

  • Jr. Member
  • **
  • Posts: 33
Re: problem calling sparse MKL library in a user macro
« Reply #8 on: October 22, 2015, 05:48:09 AM »
umacr19 has been added to project in visual studio and feap has been rebuiled but there is the following error when Ifile is run. How to manage the problem, please?

  Inconsistency occurred from PMACIO in data file Ifile                                                                                                                           
  at or near record number    27.  Input record is:

  mumv conv !END OPTIMIZATION LOOP                                             

  If this record is correct error may result from
  missing blank record before new command type.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: problem calling sparse MKL library in a user macro
« Reply #9 on: October 22, 2015, 02:13:32 PM »
If your umacr19 is the  mumv command then that is what is causing the error --  feap does not see your command?  If you use
the following command while in an interactive mode you can see all the available commands that feap knows

> MANUal,,5
> HELP

The first sets the command to show all manual commands to a maxiumum,  otherwise you only see a subset of the available commands. 

Brian

  • Jr. Member
  • **
  • Posts: 33
Re: problem calling sparse MKL library in a user macro
« Reply #10 on: October 23, 2015, 05:47:33 AM »
Calling manual,,5 and help in an interactive mode does not show mumv command because umacr19 cannot be linked to feap. How can umacr19 be linked to feap in visual studio? I did the following steps but it does not work.

1. Add umacr19 to feap project
2. Rebuild feap


pjarz

  • Jr. Member
  • **
  • Posts: 12
Re: problem calling sparse MKL library in a user macro
« Reply #11 on: November 03, 2015, 07:13:36 AM »
Are you sure that you have removed (or replaced) the default file umacr19.f from "user" folder?

Brian

  • Jr. Member
  • **
  • Posts: 33
Re: problem calling sparse MKL library in a user macro
« Reply #12 on: November 03, 2015, 07:54:23 AM »
Yes, I am sure. I did all steps as mentioned in post http://feap.berkeley.edu/forum/index.php?board=7.0.