Difference between revisions of "Issues with BGP Timers (May 2009)"
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
BGPTIMERS can be used statically with XLC. | BGPTIMERS can be used statically with XLC. | ||
− | Given two files. bgwtime.c | + | Given two files. bgwtime.c |
/* bgwtime.c */ | /* bgwtime.c */ | ||
Line 23: | Line 23: | ||
return (_bgp_GetTimeBase() * bgp_clockspeed); | 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 | ||
+ | |||
+ | However, you cannot build with -qpic=large | ||
+ | |||
+ | mpixlc_r main.c bgwtime.c -I/bgsys/drivers/ppcfloor/arch/include -o main -qpic=large | ||
+ | |||
+ | main.c: | ||
+ | bgwtime.c: | ||
+ | "/bgsys/drivers/ppcfloor/arch/include/common/bgp_ras.h", line 650.1: 1506-508 (W) Option packed for pragma align is not supported. | ||
+ | bgwtime.o: In function `bg_wtime': | ||
+ | bgwtime.c:(.text+0x102): undefined reference to `$STATIC' | ||
+ | bgwtime.c:(.text+0x10a): undefined reference to `CONSTANT_AREA' | ||
+ | bgwtime.o: In function `_bgp_Out64': | ||
+ | bgwtime.c:(.text+0xa3e): undefined reference to `CONSTANT_AREA' | ||
+ | bgwtime.c:(.text+0xa9e): undefined reference to `CONSTANT_AREA' | ||
+ | bgwtime.o: In function `persist_open': | ||
+ | bgwtime.c:(.text+0x2d9e): undefined reference to `CONSTANT_AREA' |
Latest revision as of 23:32, 8 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
However, you cannot build with -qpic=large
mpixlc_r main.c bgwtime.c -I/bgsys/drivers/ppcfloor/arch/include -o main -qpic=large main.c: bgwtime.c: "/bgsys/drivers/ppcfloor/arch/include/common/bgp_ras.h", line 650.1: 1506-508 (W) Option packed for pragma align is not supported. bgwtime.o: In function `bg_wtime': bgwtime.c:(.text+0x102): undefined reference to `$STATIC' bgwtime.c:(.text+0x10a): undefined reference to `CONSTANT_AREA' bgwtime.o: In function `_bgp_Out64': bgwtime.c:(.text+0xa3e): undefined reference to `CONSTANT_AREA' bgwtime.c:(.text+0xa9e): undefined reference to `CONSTANT_AREA' bgwtime.o: In function `persist_open': bgwtime.c:(.text+0x2d9e): undefined reference to `CONSTANT_AREA'