PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

problems with call exit(code)

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
jw2519



Joined: 20 Dec 2006
Posts: 1

PostPosted: Tue Jan 23, 2007 2:44 pm    Post subject: problems with call exit(code) Reply with quote

Hi,

I've been having trouble with call(exit) using pgf90. This problem actually came up when trying to compile and set up a climate model, in which an exit code should be passed to the setup script to verify that an initial run has executed correctly. This initial run did execute correctly, but call exit(code) (where code as passed to exit is 13) always returns an exit code of 127 , which halts the setup script unnecessarily. There is an easy workaround in my case, but it would be bad form for future compilations.

I then wrote a basic script to see what call exit(13) would return. The code:

Code:

program test

  implicit none

  print *,"Make it work, please."

  call exit(13)

end program test


The output:

Quote:

$ pgf90 -o test.o test.f90
$ ./test.o
Make it work, please.
$ echo $?
127


So it appears that call exit conveys an exit code of 127 in this case as well. I've tried using export PGI_TERM=signal, but I haven't had any luck. Any ideas?

For reference, I'm on an AMD-64 Linux machine with kernel 2.6.17-10.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6213
Location: The Portland Group Inc.

PostPosted: Fri Jan 26, 2007 2:24 pm    Post subject: Reply with quote

Hi jw2519,

I asked our compiler team about this. While exit is not standard, we use to have this behavior where exit returned the requested status. However, when they put in better trace back support in the 6.2, they changed the behavior to return either "0" or non-zero. I've asked them to revisit this and see how they can add this support back.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
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 © phpBB Group