Issues with BGP Timers (May 2009)
We have been having a lot of trouble with the -BGPTIMERS option in TAU recently, there are numerous bugs in linking depending on the compiler and options that we are trying to work around.
First, some things that we know:
BGPTIMERS can be used statically with XLC.
Given two files. bgwtime.c:
/* bgwtime.c */ #include <common/bgp_personality.h> #include <common/bgp_personality_inlines.h> #include <spi/kernel_interface.h> /* return time in seconds */ double bg_wtime() { static double bgp_clockspeed = 0.0; if (bgp_clockspeed == 0.0) { _BGP_Personality_t mybgp; Kernel_GetPersonality(&mybgp, sizeof(_BGP_Personality_t)); bgp_clockspeed = 1.0/(double)BGP_Personality_clockMHz(&mybgp); } return (_bgp_GetTimeBase() * bgp_clockspeed); }
And main.c:
/* main.c */ #include <stdio.h> double bg_wtime(void); int main(int argc, char **argv) { double t1; t1 = bg_wtime(); printf("Timer = %g\n", t1); printf("success\n"); return 0; }
We can compile and run with:
mpixlc_r main.c bgwtime.c -I/bgsys/drivers/ppcfloor/arch/include -o main qsub -e xlc_static.err -o xlc_static.out -O xlc_static -A Gpaw -t 10 -n 1 ./xlc_static