PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

About library functions such as 'eoshift' and 'isnan' in PVF
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
HuWei39533



Joined: 06 Dec 2012
Posts: 9

PostPosted: Tue Jun 04, 2013 10:14 pm    Post subject: About library functions such as 'eoshift' and 'isnan' in PVF Reply with quote

When I use library functions such as 'eoshift' and 'isnan' in PVF, errors occured. But in intel fortran compiler, no errors occured.

PVF does not support these library functions ?
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jun 05, 2013 9:06 am    Post subject: Reply with quote

Hi HuWei39533,

"isnan" is a C99 external routine and not part of Fortran. I would highly recommend using the standard F2003 method of using the "ieee_arithmetic" module, and then calling the routine "ieee_is_nan".

The "eoshift" intrinsic is part of the F95 standard and is supported by PVF. What error are you getting? Can you post a simple reproducing example?

Thanks,
Mat
Back to top
View user's profile
HuWei39533



Joined: 06 Dec 2012
Posts: 9

PostPosted: Sat Jun 08, 2013 7:35 pm    Post subject: Reply with quote

here is my code:

program MAIN
IMPLICIT NONE
DOUBLE PRECISION :: AX(5)
INTEGER :: ADD

AX=(/1.0d0,1.0d0,1.0d0,1.0d0,1.0d0/)
ADD=0
PRINT *, ' AX ', Ax(1),Ax(2),Ax(3),Ax(4),Ax(5),ADD
PAUSE
AX( 1:5 )=EOSHIFT( AX(1:5 ),-ADD)
PRINT *, ' AX ', Ax(1),Ax(2),Ax(3),Ax(4),Ax(5)
PAUSE
end program

when ADD/=0, the result is correct, when ADD=0, the values in AX would all be 0.0d0
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jun 11, 2013 1:45 pm    Post subject: Reply with quote

This is what I get.
Code:

PGI$ pgf90 test_eoshift.f90 -V13.6
PGI$ test_eoshift.exe
  AX     1.000000000000000         1.000000000000000
    1.000000000000000         1.000000000000000         1.000000000000000
            0
FORTRAN PAUSE: enter <return> or <ctrl>d to continue>
  AX     0.000000000000000         0.000000000000000
    0.000000000000000         0.000000000000000         0.000000000000000
FORTRAN PAUSE: enter <return> or <ctrl>d to continue>


What compiler version are you using? Many years ago we had a problem with negative zero, but that's been long fixed.

- Mat
Back to top
View user's profile
HuWei39533



Joined: 06 Dec 2012
Posts: 9

PostPosted: Thu Jun 13, 2013 10:48 pm    Post subject: Reply with quote

The compiler version I am using is 12.10.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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