NERSCPowering Scientific Discovery Since 1974

Resolved: pgi/12.4.0 has link error with OpenMP when perftools/5.3.x is loaded

June 14, 2012 by Helen He (0 Comments)

 

Symptom:

Using the default pgi/12.4.0 compiler, when perftools/5.3.x is loaded, OpenMP codes have linking errors similar to the following: 

/global/homes/y/yunhe/.craypat/a.out/13554/pgccPJtd7jk8ihft.o: In function `main':
/global/u1/y/yunhe/shared/./xthi.c:46: undefined reference to `_mp_trace_parallel_enter'
/global/u1/y/yunhe/shared/./xthi.c:52: undefined reference to `_mp_trace_parallel_begin'
/global/u1/y/yunhe/shared/./xthi.c:60: undefined reference to `_mp_trace_parallel_end'
/global/u1/y/yunhe/shared/./xthi.c:60: undefined reference to `_mp_trace_parallel_exit'
/usr/bin/ld: link errors found, deleting executable `a.out'

Workaround

Use the older pgi/12.2.0 instead for openmp codes when perftools/5.3.x is loaded.

% module swap pgi pgi/12.2.0

There is another workaround which will enable you to use pgi 12.4.0 and later versions.

Create a file called stubs.c which contains this:

void _mp_trace_loop_chunk_begin () {}
void _mp_trace_loop_chunk_end () {}
void _mp_trace_loop_enter () {}
void _mp_trace_loop_exit () {}
void _mp_trace_master_enter () {}
void _mp_trace_master_exit () {}
void _mp_trace_parallel_begin () {}
void _mp_trace_parallel_end () {}
void _mp_trace_parallel_enter () {}
void _mp_trace_parallel_exit () {}
void _mp_trace_section_begin () {}
void _mp_trace_section_end () {}
void _mp_trace_sections_enter () {}
void _mp_trace_sections_exit () {}
void _mp_trace_single_enter () {}
void _mp_trace_single_exit () {}
void _mp_trace_task_begin () {}
void _mp_trace_task_end () {}
void _mp_trace_task_enter () {}
void _mp_trace_task_exit () {}
void _mp_trace_workshare_begin () {}
void _mp_trace_workshare_end () {}
void _mp_trace_workshare_enter () {}
void _mp_trace_workshare_exit () {}

Include this file in the command line and the code will compile and link without problems:

ftn -o omphello -mp=nonuma omphello.f stubs.c

Status

It is confirmed that the bug has been fixed with pgi/12.5.0.

 


Post your comment

You cannot post comments until you have logged in. Login Here.

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments