- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to run a simple numerical integration program, and it is giving me a strange error I've never seen before.
It's getting into a "multi-thread locking routine" and generating an unhandled exception error. I don't have any intention of using multi-threading whatsoever.
When I remove the DO WHILE loop (just have it run thru the code once) the problem disappears.........
Anyway, there is no reason why I'd want to use multi-threading, and I don't see why it would force that on me.
There are only two executable statements in the loop, and this problem appears even after I do a CLEAN and rebuild.
So I don't think it's the subroutine interface.
Is there a way to PREVENT this?
parameter NVAR=4
real*16 y(NVAR),yd(NVAR),t,dt
!
print *,"t,dt="
read *,t,dt
do while (.true.) ! this causes the problem
call rkstep(y,yd,t,dt)
print 101,t,y,yd
101 format(5f20.12/20x,4f20.12)
end do
return
end
It's getting into a "multi-thread locking routine" and generating an unhandled exception error. I don't have any intention of using multi-threading whatsoever.
When I remove the DO WHILE loop (just have it run thru the code once) the problem disappears.........
Anyway, there is no reason why I'd want to use multi-threading, and I don't see why it would force that on me.
There are only two executable statements in the loop, and this problem appears even after I do a CLEAN and rebuild.
So I don't think it's the subroutine interface.
Is there a way to PREVENT this?
***********************************************************************
subroutine testRK()
implicit nonesubroutine testRK()
parameter NVAR=4
real*16 y(NVAR),yd(NVAR),t,dt
!
print *,"t,dt="
read *,t,dt
do while (.true.) ! this causes the problem
call rkstep(y,yd,t,dt)
print 101,t,y,yd
101 format(5f20.12/20x,4f20.12)
end do
return
end
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you give more details about the error you're having? Which version of VS are you using? While you are not using multithreading, the run-time libraries are "thread-safe" and have code to protect themselves when threading is in use. An exception should not occur - perhaps you have an error in your code that is corrupting data somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Can you give more details about the error you're having? Which version of VS are you using? While you are not using multithreading, the run-time libraries are "thread-safe" and have code to protect themselves when threading is in use. An exception should not occur - perhaps you have an error in your code that is corrupting data somewhere.
One of the variables in the subroutine I called was not REAL*16, it was REAL*4.
But what I don't understand is why the interface checking feature did not catch that.
I had both Warn-interface AND GEN-interface turned on, and did a CLEAN and REBUILD before I started execution.
The VS I'm using is 2008.
Yours; Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hard to say. If the order of compilation that VS chose didn't build the subroutine first, that could happen. Glad to hear you sorted it out. In the future, I suggest using module procedures so you'll always have an explicit interface.

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