<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic There are so many variables in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963857#M95263</link>
    <description>There are so many variables here it's hard to know where to begin. Focusing on the arrays might be useful - please show the declaration of the arrays and their size.</description>
    <pubDate>Wed, 05 Dec 2012 17:10:25 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2012-12-05T17:10:25Z</dc:date>
    <item>
      <title>Fortran dll run on different computers problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963856#M95262</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Im calling a fortran dll from my csharp application. This works fine on most computers, however on several computers appears the following problem:&lt;/P&gt;
&lt;P&gt;When one of the fortran subrutines get called the application is stuck, it enters the subrutine and doesnt come back. you can see the application running in the task manager with&amp;nbsp;50% CPU use...&lt;/P&gt;
&lt;P&gt;The tricky part is that the problem is not the called subrutine but another one that is not got called (when the problem happens). If I remove the code of the other subrutine the application runs fine.&lt;/P&gt;
&lt;P&gt;I also found out that array declarations in the other subrutine are cousing that problem.I have&amp;nbsp;several big arrays declared inside that subrutine and also passed inside as parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;When I removed all the code that's using those arrays it also solved the problem.&lt;/P&gt;
&lt;P&gt;I've tried setting calling conventions on both sides to stdcall or Cdecl, but it had no influence.&lt;/P&gt;
&lt;P&gt;I'he also tried to set the /heap-arrays&amp;nbsp; option, no success.&lt;/P&gt;
&lt;P&gt;Do you have any other suggestions ?&lt;/P&gt;
&lt;P&gt;P.S. All the computers configuration are the same : Windows7 SP1 , 32bit.&lt;/P&gt;
&lt;P&gt;My application is compiled for 32bit , using Visual2008.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Alla&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2012 09:40:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963856#M95262</guid>
      <dc:creator>alla_p_</dc:creator>
      <dc:date>2012-12-04T09:40:15Z</dc:date>
    </item>
    <item>
      <title>There are so many variables</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963857#M95263</link>
      <description>There are so many variables here it's hard to know where to begin. Focusing on the arrays might be useful - please show the declaration of the arrays and their size.</description>
      <pubDate>Wed, 05 Dec 2012 17:10:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963857#M95263</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-12-05T17:10:25Z</dc:date>
    </item>
    <item>
      <title>Hi Steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963858#M95264</link>
      <description>Hi Steve,
Thank you for your response !

The fortran code is quite old and poorly written

This is the subrutine call and variables declarations :

[fortran]
 SUBROUTINE F1(PARAM_1,PARAM_2,PARAM_3,PARAM_4,PARAM_5
     &amp;amp; ,IN_ARRAY_1,IN_ARRAY_2         
     &amp;amp; ,IN_ARRAY_3,IN_ARRAY_4,IN_ARRAY_5
     &amp;amp; ,OUT_ARRAY_1,OUT_ARRAY_1_SIZES                                        
     &amp;amp; ,OUT_ARRAY_2,OUT_ARRAY_3,   
     &amp;amp; ,OUT_ARRAY_4,OUT_ARRAY_5,OUT_ARRAY_5_SIZES                     
     &amp;amp; ,OUT_ARRAY_6,OUT_ARRAY_7 )                              
      !DEC$ ATTRIBUTES DLLEXPORT          ::F1                          
                                                
      COMMON    GRAPH ,TIME ,TEMPS(1000), GRAPH2      
      COMMON/LCO/CO(20,15)                                              
      COMMON/LCW/CW(20,30)                                              
      COMMON/CEP/XX(100),YY(100),NRUN                                   
      COMMON/LX1/X1(20,100)                                             
      COMMON/LY1/Y1(20,100)                                             
      COMMON/X/X_ARRAY_1,X_ARRAY_3,X_ARRAY_2                             
      COMMON/Y/Y_ARRAY_1,Y_ARRAY_3,Y_ARRAY_2                                
      COMMON /ARGMNT/  FMETER , FMR , BASE      
                              

      DIMENSION   GRAPH(60000,50)   , TIME(60000)                       
      DIMENSION   GRAPH2(5,9)                                           
      DIMENSION   VLABLE(2,15)    , IPL(100)        , DER(101)          
      DIMENSION   VAR(101)        , EL(100)         , EU(100)           
     
      DOUBLE PRECISION DSEED                                            
                                                                                                                 

      INTEGER*4 PARAM_1  [VALUE]                                        
      REAL*8    PARAM_2  [VALUE] 
      INTEGER*4 PARAM_3  [VALUE]                                              
      INTEGER*4 PARAM_4  [VALUE]                                             
      INTEGER*4 PARAM_5  [VALUE]                          
                                             

                                             
      REAL*8 	IN_ARRAY_1		(15,20) 
      INTEGER*4 ARRAY_1_SIZES	(5)                                               
      REAL*8 	IN_ARRAY_2		(30,20)                                                 
      REAL*8 	IN_ARRAY_3		(200)                                                  
      REAL*8 	IN_ARRAY_4		(5)        
      INTEGER*4 IN_ARRAY_5		(20)                                                                                          
      
      REAL*8    OUT_ARRAY_1			(3,10000,5)                              
      INTEGER*4 OUT_ARRAY_1_SIZES	(5)    
      REAL*8 	OUT_ARRAY_2			(100,20)                                       
      REAL*8 	OUT_ARRAY_3			(100,20)                                                                      
      REAL*8    OUT_ARRAY_4			(9,5)                                          
      REAL*8    OUT_ARRAY_5			(10000,2,5)                                                                             
      REAL*8 	OUT_ARRAY_6			(2,6,5)                                   
      REAL*8 	OUT_ARRAY_7			(2,2,5)                                    
        
                                              
      DIMENSION X_ARRAY_1(5,2,10000)                                     
      DIMENSION X_ARRAY_2(5,2,6)                                         
      DIMENSION X_ARRAY_3(5)                                                
      DIMENSION Y_ARRAY_1(5,2,10000)                                     
      DIMENSION Y_ARRAY_2(5,2,2)                                         
      DIMENSION Y_ARRAY_3(5)    
[/fortran]

Alla</description>
      <pubDate>Thu, 06 Dec 2012 11:30:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963858#M95264</guid>
      <dc:creator>alla_p_</dc:creator>
      <dc:date>2012-12-06T11:30:00Z</dc:date>
    </item>
    <item>
      <title>Nothing jumps out at me here.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963859#M95265</link>
      <description>Nothing jumps out at me here. The arrays are large but not too large.  Can you figure out how far it gets into the routine before the problem occurs?  Perhaps put in some print statements at various points?  Can you run this under the debugger and see the problem?</description>
      <pubDate>Thu, 06 Dec 2012 14:55:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963859#M95265</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-12-06T14:55:55Z</dc:date>
    </item>
    <item>
      <title>You should notice that the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963860#M95266</link>
      <description>You should notice that the problem is not at run time of this routine.
It's when I load the dll for the first time (by calling other routine in the same dll file)
So printouts and debug do not really help me here...
Also, the problem occurs only on some computers, on my computer it works fine.

When I replaced all array definitions in the following matter:
[fortran]
REAL*8    IN_ARRAY_1      (15)                           -&amp;gt;  REAL*8    IN_ARRAY_1      (1)
REAL*8    IN_ARRAY_2      (30,20)                      -&amp;gt;  REAL*8    IN_ARRAY_2      (1,1)
REAL*8    IN_ARRAY_3      (30,20,10)                 -&amp;gt;  REAL*8    IN_ARRAY_3      (1,1,1)
[/fortran]
it also helped to load the dll successfully

But I'm not sure this is the way to go...</description>
      <pubDate>Thu, 06 Dec 2012 15:21:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963860#M95266</guid>
      <dc:creator>alla_p_</dc:creator>
      <dc:date>2012-12-06T15:21:13Z</dc:date>
    </item>
    <item>
      <title>That's strange, because these</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963861#M95267</link>
      <description>That's strange, because these are all dummy arguments and don't actually take any space here. I wonder if you're compiling with bounds checking and getting a bounds error signaled.</description>
      <pubDate>Thu, 06 Dec 2012 15:49:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963861#M95267</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-12-06T15:49:15Z</dc:date>
    </item>
    <item>
      <title>First, I would put all your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963862#M95268</link>
      <description>First, I would put all your COMMON variables into  MODULE and USE the MODULE where it is needed. That way you will know that the dimensions of all the arrays that are presently defined in COMMON (especially X_array_1, Y_ARRAY_1 etc.) are defined to be the same everywhere in your code.

Second, how can you be sure that the dimensions of IN_ARRAY_1 etc. and OUT_ARRAY_1 etc in the code that calls subroutine F1 match those you define in the body of the subroutine? Should you not check this first?</description>
      <pubDate>Thu, 06 Dec 2012 15:54:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963862#M95268</guid>
      <dc:creator>Anthony_Richards</dc:creator>
      <dc:date>2012-12-06T15:54:51Z</dc:date>
    </item>
    <item>
      <title>Steve, I think you are right</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963863#M95269</link>
      <description>Steve, I think you are right about the bound checking. It doesn't solve the whole problem, but it does have an influence.
We will try to use the MODULE also...

Thank you both</description>
      <pubDate>Mon, 10 Dec 2012 07:41:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-dll-run-on-different-computers-problem/m-p/963863#M95269</guid>
      <dc:creator>alla_p_</dc:creator>
      <dc:date>2012-12-10T07:41:51Z</dc:date>
    </item>
  </channel>
</rss>

