- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following routine causes a "debug assertion error" when it is called.
The problem appears to be isolated to the PRINT 101 statement, trying to print the 9x9 integer array.
The reason: When I comment that out, it runs fine.
So it appears to be a combination of the RECORD TYPE and that nested DO Loop in the print statement.
Maybe it generates bad code?
*********************************************************************************
The problem appears to be isolated to the PRINT 101 statement, trying to print the 9x9 integer array.
The reason: When I comment that out, it runs fine.
So it appears to be a combination of the RECORD TYPE and that nested DO Loop in the print statement.
Maybe it generates bad code?
*********************************************************************************
[cpp]subroutine print_record(irec)
implicit NONE
include "sud004.cmn"
integer( kind=4)irec,ii,jj
integer (kind=1)b(9,9)
101 format(1x,a/(9I2))
102 format("forward pointers:",10i6)
103 format("backward pointers:",i6)
104 format("dead",l2)
105 format("Board hash:",i10)
106 format(1x,a,i8)
!
print 106,"contents of record ",irec
print 101,"board contents",((brec.b(ii,jj),jj=1,9),ii=1,9)
print 102,brec(irec).fptr
print 103,brec(irec).bptr
print 104,brec(irec).dead
print 105,brec(irec).hash
end subroutine
! * * * * * contents of sud004.cmn * * * * * * * * * *
PARAMETER recsize=1000
type board_rec
integer*4 fptr(10)
integer*4 bptr
integer*4 hash
integer*4 flink
integer*2 nomoves
integer*2 moveno
integer*1 done
logical*1 dead
integer*1 level
integer*1 dummy
integer*1 b(9,9)
end type board_rec
common/sud004/work_level,high_board,stlink,brec
integer*4 work_level,high_board,stlink(60000)
type(board_rec)brec(0:4194304)
[/cpp]
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please attach a complete test case that can be built and run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Please attach a complete test case that can be built and run.
Should be entirely self-contained.
I checked it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok - I missed that you had also provided the common declaration. This program is getting a stack overflow because the compiler decides it needs to create a large temp for something - exactly what and why I am not sure. Compiling with /heap-arrays resolves that. I'll take a closer look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change the print to:
print 101,"board contents",((brec(irec).b(ii,jj),jj=1,9),ii=1,9)
The way you have it, it's trying to print all 4+ million sets of 9x9 matrices and it's overflowing memory.
- Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, so if it's trying to print over 4 million records, that might explain it -
Interestingly enough, when I took out the embedded DO LOOPS, the problem went away.
I just copied the contents of the record to a single line one row at a time, and printed that instead.
Interestingly enough, when I took out the embedded DO LOOPS, the problem went away.
I just copied the contents of the record to a single line one row at a time, and printed that instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - billsincl
Oh, so if it's trying to print over 4 million records, that might explain it -
Interestingly enough, when I took out the embedded DO LOOPS, the problem went away.
I just copied the contents of the record to a single line one row at a time, and printed that instead.
Interestingly enough, when I took out the embedded DO LOOPS, the problem went away.
I just copied the contents of the record to a single line one row at a time, and printed that instead.
print 101,"board contents",((brec.b(ii,jj),jj=1,9),ii=1,9)
you have a whole array of records. Presumably you did more than just take out the embedded do loops, you must have selected the record you want.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page