PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Profiler timing routine?

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



Joined: 02 Feb 2012
Posts: 51

PostPosted: Wed Jun 13, 2012 8:25 am    Post subject: Profiler timing routine? Reply with quote

I have problems getting my code built in timing calls to work, the code returns zero time. It does a call to the system and I've tried several system routines as you can see below.

I've found however that if I turn on profiling, function level is the easiest, the timing calls work. My question is what does setting the profiler option in the compiler do that could allow my timing calls to work?

Note: Running PVF 12.5 in Windows 7 64-bit using Visual Studio 2008.


************************
SUBROUTINE timcpu(XTIme)
IMPLICIT NONE

C*--TIMCPU5
REAL(KIND=8) XTIme
INTEGER count_0, count_1, count_rate, count_max
INTEGER time_array(8)
C
C SYSTEM TIME IN SECONDS
C
C CALL cpu_time(XTIme)
C CALL system_clock(count_0, count_rate, count_max)
CALL date_and_time(values=time_array)
C XTime = count_0 * 1.0 / count_rate
XTime = time_array (5) * 3600 + time_array (6) * 60
& + time_array (7) + 0.001 * time_array (8)
C
END SUBROUTINE timcpu
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jun 13, 2012 10:12 am    Post subject: Reply with quote

Hi Ralph,

I really wish we could get to the bottom of this one. I still think it's some Windows configuration or library issue, but not being able to recreate it here makes it very difficult.

I'm not sure if this will be helpful, but I'd like to try a few things. First, do you have access to Microsoft's or PGI's C compiler? If so, please compile the following C code which calls localtime. I looked our run time code for "date_and_time" and on Windows it basically make a call to the C localtime routine.

If you don't have a C compiler, I'll send you my binary.

Code:
#include <time.h>
#include <stdio.h>

void main () {

    char            lbuf[16];
    time_t          ltime;
    struct tm      *ltimvar;
    int i;

    ltime = time(0);
    ltimvar = localtime(&ltime);
    sprintf(lbuf,"%2.2d:%2.2d:%2.2d",
            ltimvar->tm_hour,
            ltimvar->tm_min,
            ltimvar->tm_sec);
    for(i=0; i < 16; ++i) {
    printf("%d ",lbuf[i]);
    }
    printf("\n%s\n",lbuf);
}

Code:

$ pgcc time.c -o time.exe
$ time.exe
49 48 58 48 57 58 52 48 0 0 0 0 0 0 0 0
10:09:40


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



Joined: 02 Feb 2012
Posts: 51

PostPosted: Wed Jun 13, 2012 3:35 pm    Post subject: Reply with quote

Mat,

Since the Intel Fortran compiler has no problems with timing I expect any executable I build with an Intel compiler won't exhibit the problem.

Please send me an executable, remember it is for Windows7 64bit.
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