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

Crashing of the program (matrix 500 x 500)

Lukas_W_
Beginner
3,713 Views

Good day,

In the main subroutine is declared a matrix size of 500 times 500. This matrix is transferred to the subroutine Set_null. In the subroutine Set_null I want another matrix (matrix_work) of the same size (a_matrix), but the program crashes. I have simplified the example to a minimum so that the problem still existed (see figures).

If you make
the same thing, but for matrix 300 by 300 everything is OK (
MAX_SIZE = 300).
If you use matrix_work allocatable everything is OK.

Intel Fortran Compiler 11.1.067.

Best regards
Lukas Weis

[fortran]

 

 !*******************************************************************************
  ! Experiment6 - Padani.
  !*******************************************************************************
  subroutine Experiment6    
    implicit none
    integer(4), parameter ::                  MAX_SIZE = 500
    real(8), dimension(MAX_SIZE, MAX_SIZE)::  a_matrix
 

      call Set_null(a_matrix(1:MAX_SIZE, 1:MAX_SIZE))

    
    return
  contains
    
    !*******************************************************************************
    ! Nulovani matice.
    !*******************************************************************************
    pure subroutine Set_null(matrix)
      implicit none
      real(8), intent(inout), dimension(:,:) ::                        matrix
      real(8), dimension(size(matrix, dim=1), size(matrix, dim=2)) ::  matrix_work
      
      matrix = 0.d0
      matrix_work = 0.d0
      
      return
    end subroutine
    
  end subroutine Experiment6

[/fortran]

0 Kudos
27 Replies
jimdempseyatthecove
Honored Contributor III
871 Views

Now, copy from VD C++, paste to Word, copy from Word, "past from Word"

long SerialFib2( long n )

{

       if( n<2 )

              return n;

       long fib0 = 1;       // most recent

       long fib1 = 1;       // 1 prior to most recent

       long fib2 = 0;       // 2 prior to most recent

       long i;

       for(i=2; i<n; ++i)

       {

              fib2 = fib1;

              fib1 = fib0;

              fib0 = fib1 + fib2;

       }

       return fib0;

}

Jim

 

0 Kudos
mecej4
Honored Contributor III
871 Views

Steve Lionel (Intel) wrote:

I know copy and paste inline doesn't work. The code button does.

Steve, I wish you would have them fix the Symbol button (the capital Omega button just to the left of the Code button). "I am the Alpha and the Omega", someone is reported to have said, but I seen neither an Alpha nor an Omega in the box of characters that pop up when I press the Symbol button. The old forum software was good in this regard, allowing mathematical content to be typed and displayed properly. The lack of symbols is more of a problem in the MKL forum, but it affects this forum, as well, because Fortran is heavily used to implement mathematical algorithms.

 

We can, of course, substitute from the available symbols, but m = p qdoes not carry the same punch as E = m c2.

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
871 Views

The above looks nothing like it came from Word.

Also note, post #20 using {...} code, doesn't color "long" properly.

Jim Dempsey

0 Kudos
FortranFan
Honored Contributor III
871 Views

jimdempseyatthecove wrote:

The above looks nothing like it came from Word.

Also note, post #20 using {...} code, doesn't color "long" properly.

Jim Dempsey

Jim,

Even in Word, you need to do syntax highlighting and wrap your C code in either (plain) .. (/plain) or preferably (cpp) .. (/cpp), etc. (note: parenthesis need to be replaced by square brackets.)

 

0 Kudos
Steven_L_Intel1
Employee
871 Views

Don't use the tags. Just use the Code button.

0 Kudos
andrew_4619
Honored Contributor III
871 Views
             icombomsg=[447,448,449,450,452] !combo text strings 
             do l1=1,ubound(icombomsg,1)
                ibuf=gtxzzW(icombomsg(l1))
                lres = SendDlgItemMessageW(hDlg, IDC_COMBO_LH, CB_ADDSTRING, NULL, loc(ibuf)) 
                ibuf=gtxzzW(icombomsg(l1))
                lres = SendDlgItemMessageW(hDlg, IDC_COMBO_RH, CB_ADDSTRING, NULL, loc(ibuf)) 
             enddo

And this is a VC paste in the "code" button. This thread has been hijacked for the forum paste sandbox :-)

Actually that worked rather well. I have always used the fortran tags manually as suggested by the help bit  on the posting page....

 

 

0 Kudos
John_Campbell
New Contributor II
871 Views

My ps comment on Quote #9 has created a few responses!

I should explain that I put the ps at the end of the post and was going to edit it once I saw how the post looked, but my post was sent for review and now is the first time I have been able to see the post and all the responses.

Since seeing the layout of what I posted, the result is a bit of a mess. It really should not be this way.

There are problems with both vertical alignment (extra blank lines, but strangely not after all lines?) and horizontal alignment (lines 3, 7,9,11, 15, 17, 24, 26 etc have additional horizontal spacing.

Before posting the code, I filtered out all tabs <ht>, hoping that would clean up the text layout.

All lines end with <cr> <lf>, which is the standard Microsoft windows text file format. (see attached)

I copied the text from a notepad screen, using ctl_a ctl_c, then ctl_v into the IDZ comment window. I enclosed the text using the syntax highlighting recommendations of square brackets and fortran /fortran.

I just do not understand that after over a year of this new IDZ development that it does not support this basic copy - paste approach and we cannot get a reasonable presentation of the code layout.

Why, in a windows screen environment, (I am using Internet Explorer 9) can’t IDZ recognise this and not keep inserting hard or soft returns. No other forum or editing tools I use does this.

The IDZ development looks like a project being undertaken by a work experience group, not professional software developers. They have consistently failed to provide an environment that considers the likely users of this forum and it has been going on for too long.

It is just not a user friendly environment.

 

John

 

Pps: I have written this post in word so who knows how it will appear when I copy it into the comment box.  "Paste from Word" gave double line spaces !!

0 Kudos
Reply