- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(I know without a program snippet it is difficult to give a verdict but I don't have such snippet.)
I see the following behavior in a large program.
----
Module SomeModule
Implicit None
Contains
Subroutine SomeMethod
if (condition) then
Call Process([],[], arg1,arg2,iError) ! [] => array constructor; process is in another module
! arg1 and arg2 are optional.
endif
End Subroutine
End Module
-------
Condition is set to .False. Thus, the call never happens.
The only difference I make is that in one run the if-block is commented out while the other keeps it. The program uses -O2 (no debug). I get small differences when comparing the results of these runs. In the full debug with no optimization, there is no difference. I checked (in the debug mode) that no array-temporary is created. (No such thing should happen in first place since the call never happens.)
Any clues?
Abhi
I see the following behavior in a large program.
----
Module SomeModule
Implicit None
Contains
Subroutine SomeMethod
if (condition) then
Call Process([],[], arg1,arg2,iError) ! [] => array constructor; process is in another module
! arg1 and arg2 are optional.
endif
End Subroutine
End Module
-------
Condition is set to .False. Thus, the call never happens.
The only difference I make is that in one run the if-block is commented out while the other keeps it. The program uses -O2 (no debug). I get small differences when comparing the results of these runs. In the full debug with no optimization, there is no difference. I checked (in the debug mode) that no array-temporary is created. (No such thing should happen in first place since the call never happens.)
Any clues?
Abhi
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you say, without a test case (even a "snippet" is inadequate), trying to hypothesize on a cause is not worthwhile. Does the call happen if optimization is disabled?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve
The (condition) is always false and hence the happens neither in debug nor in optimized. {However, (condition) is not known at compile-time.}
I definitely see the following behavior:-
(1) compiled with /O2 -- Answer 1.
(2) The only change in the enitre source code is to comment out the call in this particular file, compile with /O2 as before -- Answer 2.
It is not that Answer 1 and 2 are greatly different (well below engineering tolerance) but small numerical pertubations. That makes me think that somehow the stack is changed and as we use MKL some 16-byte alignment issue.
The called subroutine is in a module so the interface is explicit. May be that is not sufficient.
Pardon the lack of a concrete test case, my current option is to create a new array and copy (instead of array constructor).
Abhi
The (condition) is always false and hence the happens neither in debug nor in optimized. {However, (condition) is not known at compile-time.}
I definitely see the following behavior:-
(1) compiled with /O2 -- Answer 1.
(2) The only change in the enitre source code is to comment out the call in this particular file, compile with /O2 as before -- Answer 2.
It is not that Answer 1 and 2 are greatly different (well below engineering tolerance) but small numerical pertubations. That makes me think that somehow the stack is changed and as we use MKL some 16-byte alignment issue.
The called subroutine is in a module so the interface is explicit. May be that is not sufficient.
Pardon the lack of a concrete test case, my current option is to create a new array and copy (instead of array constructor).
Abhi

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