Problems while using PARDISO

Problems while using PARDISO

Hi,

I have a question about the PARDISO under Windows. I have written a fortran code which is to solve a very large sparse symmetric problem. And I used a subroutine to specify the parameters for PARDISO and solve the system. Following the demo given in the mkl folder, I included the mkl_pardiso.f90 file at the very beginning of the main program and also used the mkl_pardiso file. If I build the solution, it will give the following error message

Error  1  Compilation Aborted (code 1). 

And then if I comment out the mkl_pardiso.f90 inclusion, the error message disappears and the code can run without any further error and the solution results are correct. I also tried to clean the successfully built solution and keep the mkl_pardiso.f90 file commented out and then rebuild the solution. This time, there came more errors:

Error    3     error #6404: This name does not have a type, and must have an explicit type.   [PT]    
Error    2     error #6457: This derived type name has not been declared.   [MKL_PARDISO_HANDLE]   
Error    4     error #6458: This name must be the name of a variable with a derived type (structure type)   [PT]     
Error    1     error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MKL_PARDISO]  
Error    5    Compilation Aborted (code 1)

So, the questions is why this happens and how can I correctly use the PARDISO in my subroutine? Any thoughts will be much appreciated.

 

16 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Quote:

G.v.S wrote:
I included the mkl_pardiso.f90 file at the very beginning of the main program
Your description is a bit unclear as to how you included the MKL include file in your sources. If you have something similar to

program XYZ
INCLUDE 'mkl_pardiso.f90'
...

the compilation will fail. If, instead of that, you have something similar to

      INCLUDE 'mkl_pardiso.f90'
      subroutine pqr(...)
      USE mkl_pardiso
      ...

the compilation should go through. 

If you comment out or omit necessary INCLUDE and USE statements, you will succeed in fooling the compiler into accepting erroneous code. The outcome will be that instead of compile-time errors you will run into run-time errors or your computed results will be wrong.

Quote:

mecej4 wrote:

Quote:

G.v.S wrote:I included the mkl_pardiso.f90 file at the very beginning of the main program

Your description is a bit unclear as to how you included the MKL include file in your sources. If you have something similar to

program XYZ
INCLUDE 'mkl_pardiso.f90'
...

the compilation will fail. If, instead of that, you have something similar to

      INCLUDE 'mkl_pardiso.f90'
      subroutine pqr(...)
      USE mkl_pardiso
      ...

the compilation should go through. 

If you comment out or omit necessary INCLUDE and USE statements, you will succeed in fooling the compiler into accepting erroneous code. The outcome will be that instead of compile-time errors you will run into run-time errors or your computed results will be wrong.

 

Hi mecej4,

Thanks for your comment on my issue. To be clear, I have initially included the source file to the main program as follows:

      INCLUDE 'mkl_pardiso.f90'
      Main xyz
      USE mkl_pardiso
      ...

I also tried what you have suggested in the subroutine as

      INCLUDE 'mkl_pardiso.f90'
      subroutine PARDISOsolve
      USE mkl_pardiso
      ...

It gave me even more error messages as follows:

Error    2     error #6236: A specification statement cannot appear in the executable section.   
Error    3     error #6236: A specification statement cannot appear in the executable section.   
Error    4     error #6236: A specification statement cannot appear in the executable section.    
Error    12     error #6285: There is no matching specific subroutine for this generic subroutine call.   [PARDISO]   
Error    13     error #6285: There is no matching specific subroutine for this generic subroutine call.   [PARDISO]    
Error    16     error #6285: There is no matching specific subroutine for this generic subroutine call.   [PARDISO]   
Error    15     error #6404: This name does not have a type, and must have an explicit type.   [DU]
Error    14     error #6404: This name does not have a type, and must have an explicit type.   [FORCE_P]
Error    10     error #6404: This name does not have a type, and must have an explicit type.   [IK]
Error    19     error #6404: This name does not have a type, and must have an explicit type.   [INITIALP]
Error    11     error #6404: This name does not have a type, and must have an explicit type.   [JK]
Error    9     error #6404: This name does not have a type, and must have an explicit type.   [K_GLOBAL]
Error    18     error #6404: This name does not have a type, and must have an explicit type.   [NPARTICLE]  
Error    7     error #6404: This name does not have a type, and must have an explicit type.   [P_TEMP] 
Error    8     error #6404: This name does not have a type, and must have an explicit type.   [POSITIONS]  
Error    20     error #6404: This name does not have a type, and must have an explicit type.   [POSITIONS] 
Error    21     error #6785: This name does not match the unit name.   [MAIN]
Error    6     error #6785: This name does not match the unit name.   [MKL_PARDISO_PRIVATE]   
Error    5     error #6790: This is an invalid statement; an END [PROGRAM]  statement is required.   
Error    1     error #6818: The statement following a CONTAINS is not a function-stmt or a subroutine-stmt.   
Error    17     error #6911: The syntax of this substring is invalid.   [POSITIONS]
Error    22    Compilation Aborted (code 1) 

All the variables are defined at the main program to be global variables and shared among subroutines. Do you have any suggestions on this. Thanks. Anybody help me out, please!

 

      INCLUDE 'mkl_pardiso.f90'
      Main xyz                     !<<<=== syntax error
      USE mkl_pardiso
      ...

Perhaps, you meant to say "Program xyz".

It would be helpful if you could zip up your source files and attach the zip to your reply.

Quote:

mecej4 wrote:

      INCLUDE 'mkl_pardiso.f90'
      Main xyz                     !<<<=== syntax error
      USE mkl_pardiso
      ...

Perhaps, you meant to say "Program xyz".

It would be helpful if you could zip up your source files and attach the zip to your reply.

Yes, you are right. I just meant it's the main program.

      INCLUDE 'mkl_pardiso.f90'
      Program Main                    
      USE mkl_pardiso
      ...

 

Hi,

Based on this line:

Error    2     error #6236: A specification statement cannot appear in the executable section

You have definition of some variable, for example, after executable part of code, like:

i = 5*n

INTEGER error1

error1 = n-i

that could provide an output similar to your.

Thanks,

Alex

Quote:

Alexander Kalinkin (Intel) wrote:

Hi,

Based on this line:

Error    2     error #6236: A specification statement cannot appear in the executable section

You have definition of some variable, for example, after executable part of code, like:

i = 5*n

INTEGER error1

error1 = n-i

that could provide an output similar to your.

Thanks,

Alex

 

I think the reason why this error was given is that I include the source file at the beginning of my subroutine, which is suggested by mecej4. 

INCLUDE 'mkl_pardiso.f90'
Subroutine xyz
USE mkl_pardiso

.....

By doing this, the subroutine is even not recognized by the compiler.

Error    1     error #6818: The statement following a CONTAINS is not a function-stmt or a subroutine-stmt.

 

 

Hi,

Have you change 

subroutine xyz

on

program xyz 

like mecej4 recommended? If yes and nothing change just send this example to us to have a chance to reproduce issue on our side.

Thanks,

Alex

 

Quote:

Alexander Kalinkin (Intel) wrote:

Hi,

Have you change 

subroutine xyz

on

program xyz 

like mecej4 recommended? If yes and nothing change just send this example to us to have a chance to reproduce issue on our side.

Thanks,

Alex

 

 

Hi,

 

Attached is my code. Please help me out. Thanks in advance.

I uncommented the line in pc.F90 with "INCLUDE 'mkl_pardiso.f90'" in it and could compile and run your program with no other changes. The output, from the program compiled on Windows 8.1 X64 using 32-bit IFort 14.0.2:

S:\lang\MKL>pc
 Local stiffness matrix:   0.614186966558918
 Size of factors(MB):         2779
 Solve completed at iteration:            1
 The following ERROR was detected:           -2
1

Please provide more details about which versions of IFort, VS, and Windows were used by you. Secondly, can you tell us if the program output is as you expected?

Hi mecej4,

The result is what have expected. The error is due to the memory is not enough. The following is the environment for my run: 

IFort: Intel parallel studio xe 2013 update 2

VS: 2010 

system: Windows 7 Enterprise

Thanks.

Compiling for X64 overcomes the memory problem (Error -2), and you can use the /heap-arrays:nnnn option to reduce the stack requirement. With these in effect, I obtained:

 Local stiffness matrix:   0.592930262209848
 Size of factors(MB):         2779
 Solve completed at iteration:            1
 Total computation time:    39.87500     seconds.

 

Quote:

mecej4 wrote:

Compiling for X64 overcomes the memory problem (Error -2), and you can use the /heap-arrays:nnnn option to reduce the stack requirement. With these in effect, I obtained:

 Local stiffness matrix:   0.592930262209848
 Size of factors(MB):         2779
 Solve completed at iteration:            1
 Total computation time:    39.87500     seconds.

 

Yes, you are right. But how can I solve my original issue? Is it related to my ifort version, or the VS, or the windows OS? 

It is not clear what your "original issue" is.

We requested you to post code (stripped-down example or actual version) that would bring out those issues in your description that are related to compile-time errors.  The code that you posted (with the one-line modification that I flagged), however, compiles and runs with no compile-time errors.

Please clarify.

Quote:

mecej4 wrote:

It is not clear what your "original issue" is.

We requested you to post code (stripped-down example or actual version) that would bring out those issues in your description that are related to compile-time errors.  The code that you posted (with the one-line modification that I flagged), however, compiles and runs with no compile-time errors.

Please clarify.

 

My original issue was clearly stated in my first post: I need to build the code first not comment out the included resource file. i.e. mkl_pardiso.f90. And then rebuild but this time with the resource file comment out. Otherwise there will always be compilation error as I have listed previously. But my code runs without any problem on your pc with the resource file not commented. How can I solve this issue? Is this because of my ifort version, or VS, or OS? Thanks.

With VS2012 (I do not have VS2010 installed any more) and IFort 14.0.2 running on Windows 8.1 Pro X64, I can build a console project with your pc.f90 in Release mode, targeting ia32 or X64. The builds succeeded several times, with Clean Project done in between. No error messages or any problems.

One item that may be worth checking is whether you have more than one copy of mkl_pardiso.mod. This file is produced by the compiler as a result of the line "INCLUDE 'mkl_pardiso.f90'. If this line is active, a fresh copy of the .MOD file is produced and used when compiling the subsequent part of the source file which contains the "USE mkl_pardiso" declaration. If the INCLUDE line is left out, the compiler will look in the %INCLUDE% path for the module file. If you can compile successfully with the INCLUDE line left out, the implication is that a copy of the module file is visible to the compiler.

The build-log file may provide additional information on what is happening on your system.

发表评论

登录添加评论。还不是成员?立即加入