forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JIT Compiler encountered an internal limitation
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri Apr 08, 2016 3:12 am    Post subject: Reply with quote

I may be wrong, but I have never considered that .NET is a useful coding environment for linear equation solution, while win32 and soon FTN95 /64 to be more suited. Win32 and .NET are very different.

Is finding the problem with this .NET approach more related to an unsuitable environment, rather than a code problem ?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Fri Apr 08, 2016 5:37 am    Post subject: Re: Reply with quote

JohnCampbell wrote:
I may be wrong, but I have never considered that .NET is a useful coding environment for linear equation solution, while win32 and soon FTN95 /64 to be more suited. Win32 and .NET are very different.

Is finding the problem with this .NET approach more related to an unsuitable environment, rather than a code problem ?


I think that the meanderings in this thread have spread more confusion than necessary. If I am not mistaken, OP is working with a character mode Fortran program. When he mentions ".NET", he is talking about using FTN95 to compile the Fortran source code into MSIL, which is then run on the .NET VM. In other cases, he has FTN95 compiling and linking the code to generate a Win32 PE EXE. Therefore, as far as "coding environment" is concerned, there is only one: Fortran source code using some editor (Plato, VS Editor, ...) .

When there are bugs in the Fortran source code, the (mis)behavior of the compiled program is, in general, ill-defined and, as we may expect, depend on the "instruction set" that is targeted (X86 instruction set or MSIL).
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Sun Apr 10, 2016 7:57 am    Post subject: Re: Reply with quote

mecej4 wrote:
I'm afraid that your code fragments add up to more lines of code than I am inclined to read line by line.

Not much can be done until you post the source codes for all the subroutines, modules and the main program plus any needed data files, and provide instructions for building and running the program in such a way that the bug can be reproduced.

The Silverfrost forum does not allow posting large amounts of code. Please zip up all the files that you need, upload the zip file to a shareable cloud storage space such as OneDrive, DropBox, Google Drive, etc., and provide a link in a post to this forum.


Thanks mecej4. I realised this while posting my message. but before "submit"ting the post, while seeing the "Preview", it shows me the complete post preview, hence Am submitted that post.

I will follow the code sending like the way you suggested. Thanks a lot.
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Sun Apr 10, 2016 8:01 am    Post subject: Re: Reply with quote

narayanamoorthy_k wrote:


Thanks mecej4. I realised this while posting my message. but before "submit"ting the post, while seeing the "Preview", it shows me the complete post preview, hence Am submitted that post.

I will follow the code sending like the way you suggested. Thanks a lot.


Hi mecej4. Just after posting the previous message, I see that my post shows the "x" button on its right top corner. Means, I am now only started getting that feature in my posting. Earlier I never seen it. But I don't get that in the older posts.

Thanks.
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Sun Apr 10, 2016 8:07 am    Post subject: Re: Reply with quote

John-Silver wrote:
Quote:
I have the FTN95 personal edition already active and the Express use that FTN95 personal edition kernal


I don't understand. The Express version is 'sealed' as far as I'm aware and uses v5.4 (very old now) of the compiler. As far as I'm aware its not possivle to 'activate' the latest compiler version from within Express.
hence my suggestion of community version of VS + Personal version compiler


I mean the FTN95 express (visual studio IDE) V5.4 from this link where I downloaded.

http://www.silverfrost.com/52/ftn95_express.aspx

Is it frozen one and not active?
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sun Apr 10, 2016 3:51 pm    Post subject: Reply with quote

Yes, that's my understanding Moorthy.
My understanding is that it incorporates FTN95 compiler v5.4 (latest PE version is 7.2)
There are also some installeìation issues (for me anyway) when I tried to install it a couple of years ago on a Win7 machine
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Mon Apr 11, 2016 6:04 am    Post subject: Re: Reply with quote

narayanamoorthy_k wrote:
mecej4 wrote:
I'm afraid that your code fragments add up to more lines of code than I am inclined to read line by line.

Not much can be done until you post the source codes for all the subroutines, modules and the main program plus any needed data files, and provide instructions for building and running the program in such a way that the bug can be reproduced.

The Silverfrost forum does not allow posting large amounts of code. Please zip up all the files that you need, upload the zip file to a shareable cloud storage space such as OneDrive, DropBox, Google Drive, etc., and provide a link in a post to this forum.


Thanks mecej4. I realised this while posting my message. but before "submit"ting the post, while seeing the "Preview", it shows me the complete post preview, hence Am submitted that post.

I will follow the code sending like the way you suggested. Thanks a lot.


Hi John, mecej4

Greetings.

I have uploaded my code in rar file in the Google Drive. Pls. find the link below.

https://drive.google.com/file/d/0B0mTpY0HUClYNmE5bFF0X2pXYjQ/view?usp=docslist_api

It consists the following:
Fortran files:
BiFact_01.f95 = Main file
Remaining f95 = associated fortran files
TestIn1a.dat = Input data file.

Just simply build it using our FTN95 and the JIT issues can be seen in .NET building the solution or this project.

Pls. let me know, if you see any issues why it is not successfully running during Runtime, when it has been built in .NET environment.

Thanks a lot in advance and for your attention.
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Apr 12, 2016 3:18 am    Post subject: Reply with quote

Moorthy,

I have no experience with .net so am not able to advise on it's use.
My understanding of .net is that it is not suited to solution to large sets of equations, although the example size you have supplied is not large.

I did look at the code you supplied. It is not a style of code that I would use, as you have extensive use of GOTO and statement numbers.
Fortran 90 provides for CYCLE and EXIT in DO loops and IF () THEN ; ELSE constructs, which can assist with the flow of the code. However, if you prefer the use of GOTO and statement numbers, this code will still work, if the logic is correct. I changed SUBROUTINE DIRECTSOLUTIONSYMMATRIX to use some of these features (hopefully correctly) to give you an idea of a different coding approach. Others probably have different ideas that are also valid.
This should not be the source of your .net problem.
Code:
     SUBROUTINE DIRECTSOLUTIONSYMMATRIX

        USE globalmaster      !  Inputs : NORDR, NSEQ(*), LCOL(*), LNXT(*), ITAG(*), V(*), CE(*)

       INTEGER :: L, i,j,k   ! variables not used KP, LK, IP, LN, LA, MIN, M,
       real :: CF, SUM

!    The following are not required
!       KP=0
!       LK=0
!       IP=0
!       LN=0
!       LA=0
!       MIN=0
!       M=0
!
!       L=0
!       CF=0.
!       SUM=0.
      
        DO J = 1,NORDER
          K    = NSEQ(J)
          CF   = V(K)
          V(K) = 0
          L    = LCOL(K)
          DO WHILE (L > 0)
            I    = ITAG(L)
            V(I) = V(I) + CE(L)*CF
            L    = LNXT(L)
          END DO
        END DO      

        DO J = (NORDER-1),1,-1
          K   = NSEQ(J)
          SUM = V(K)
          L   = LCOL(K)
          DO WHILE (L > 0)
            I = ITAG(L)
            IF ( I /= K ) SUM = SUM + CE(L)*V(I)
            L = LNXT(L)
          END DO
          V(K) = SUM
         END DO
         DirectSolution = .true.

     print*, 'Direction Solution just completed.....'
!!!
!!!      print*, 'No.              LCOL          NOZE          NSEQ'
!!!      DO II = 1, (YMAT1SIZE) !IARRAYCOLSIZE
!!!        WRITE(*,222) II,LCOL(II), NOZE(II),NSEQ(II)
!!!      END DO
!!!
!!!      PRINT*, 'YMAT2 MATRIX'
!!!      PRINT*, 'II,     ITAG,       LNXT,          CE'    
!!!      DO II = 1, (YMAT2SIZE)
!!!        WRITE(*,223) II, ITAG(II), LNXT(II),CE(II)
!!!      END DO
!!!
!!! 222  FORMAT(I2,'   ',I3,'     ',I3,'     ', I3)     
!!! 223  FORMAT(I2,'     ',I3,'     ',I3,'       ',F8.2)
!!! 

     END SUBROUTINE DIRECTSOLUTIONSYMMATRIX
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Tue Apr 12, 2016 3:21 am    Post subject: Reply with quote

As I suspected, the program has bugs and is rather cluttered :

    o Pointer variables are used with ALLOCATED
    o The output file is opened with STATUS='OLD'
    o Unit numbers 5 and 6 are used to open disk files
    o Lots of lines of code that have been commented out
    o Many variables are declared (and assigned values) unnecessarily.

I have cleaned up the code and placed it at

https://www.dropbox.com/s/g07ljzp2t2c9tzt/symmat.rar?dl=0

The cleaned up code can be compiled and linked either for Win32 or .NET. It runs to completion and outputs results that appear reasonable (but you must check if the results are, in fact, correct).

While cleaning up the code and attempting to run it, I found that FTN95 sometimes outputs buggy code when expressions containing UBOUND are used as indices (and, perhaps, in the loop control list of a DO construct. I have reported this bug separately ( http://forums.silverfrost.com/viewtopic.php?t=3239 ) . To side-step this bug, use a local variable, assign the UBOUND value to the local variable and use the local variable in subscript expressions and DO loop control lists.
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Tue Apr 12, 2016 5:05 am    Post subject: Re: Reply with quote

JohnCampbell wrote:
Moorthy,

I have no experience with .net so am not able to advise on it's use.
My understanding of .net is that it is not suited to solution to large sets of equations, although the example size you have supplied is not large.

I did look at the code you supplied. It is not a style of code that I would use, as you have extensive use of GOTO and statement numbers.
Fortran 90 provides for CYCLE and EXIT in DO loops and IF () THEN ; ELSE constructs, which can assist with the flow of the code. However, if you prefer the use of GOTO and statement numbers, this code will still work, if the logic is correct. I changed SUBROUTINE DIRECTSOLUTIONSYMMATRIX to use some of these features (hopefully correctly) to give you an idea of a different coding approach. Others probably have different ideas that are also valid.


John
Thank you very much for your time in taking my code and suggested the improved way of coding. Thanks a lot, Your ideas are very useful. In fact, I learn out of your suggestions as well.

I was focussing the logic to make it work correctly. But,I am new to FTN95 advanced features that uses fortran 90 specs. However, I will improve the code further too.

Thanks a lot and I will continue to remodel my code. Thank you
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Tue Apr 12, 2016 5:30 am    Post subject: Re: Reply with quote

mecej4 wrote:
As I suspected, the program has bugs and is rather cluttered :

    o Pointer variables are used with ALLOCATED
    o The output file is opened with STATUS='OLD'
    o Unit numbers 5 and 6 are used to open disk files
    o Lots of lines of code that have been commented out
    o Many variables are declared (and assigned values) unnecessarily.

I have cleaned up the code and placed it at

https://www.dropbox.com/s/g07ljzp2t2c9tzt/symmat.rar?dl=0

The cleaned up code can be compiled and linked either for Win32 or .NET. It runs to completion and outputs results that appear reasonable (but you must check if the results are, in fact, correct).

While cleaning up the code and attempting to run it, I found that FTN95 sometimes outputs buggy code when expressions containing UBOUND are used as indices (and, perhaps, in the loop control list of a DO construct. I have reported this bug separately ( http://forums.silverfrost.com/viewtopic.php?t=3239 ) . To side-step this bug, use a local variable, assign the UBOUND value to the local variable and use the local variable in subscript expressions and DO loop control lists.


Dear mecej4

Thank you very much for your time in cleaning up my code to help me out to run them cleanly in win32 and .NET. Thanks a lot.

I will go through the code again and verify its working.

Its true that I also found the strange behaviour of UBOUND and added to that, the arrays keep the junk value which is observed in single-step debug mode, but while printing it prints the values correctly. Anyhow, I am happy that my code has helped to bring out one bug that can be fixed and improves our FTN95 compiler.

Once again, thanks a lot for your time and Ideas.. Its nice learning experience also to me to improve my code.

Thank you and John and to our forum to help me out to improve the way of the usage of FTN95. Fantastic and Amazing. A Big salute to you all and to our Forum.. Thanks a lot..
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Tue Apr 12, 2016 2:11 pm    Post subject: Re: Reply with quote

John-Silver wrote:

I'd suggest you also try downloading and installing VS Community Edition (this was mentioned in one of your other recent posts) and using the latest Personal Compiler version (which is 7.2), simply because the version of compiler is v5.4 in Express and was released a long time ago and also the cut-down VS shell used goes way back too.



Hi John
I just downloaded the VS Community 2013 and installed, and later reinstalled the FTN95 Personal edition. Just Establishing a better platform again to make my life easier.

As you said the VS Shell 2008 was there as part of Express. I will uninstall that also.

Thanks for your suggestions John.
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group