|
[Sponsors] |
September 10, 2010, 05:40 |
OpenMP in Junction Box Routine
|
#1 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
Hi, I've got a Junction Box Routine that is computationally quite expensive. Basically it is an FE-code to calculate the deformation of a boundary based on the pressure computed in CFX.
As a standalone program the FE code is parallelised using OpenMP. The serial version of the FE code works as a part of a junction box routine, with the parallel version I get following error message: +================================================= ===================+ | ****** PROBLEM REPORT ****** | |--------------------------------------------------------------------| | Subsystem: Input | | Subroutine name: ErrAction | | Severity level: Fatal Error | | Error message number: 001100279 | |--------------------------------------------------------------------| | Message: | | | | Error opening /home/FE/linux-amd64/libcom- | | m_lib.so: /home/FE/linux-amd64/libcomm_li- | | b.so: undefined symbol: _mp_lcpu | | | | | | | +================================================= ===================+ The code is compiled using the current version of the PGI Fortran compiler for Linux. Does anyone know whether including OpenMP in Junction Box Routines is possible at all, and if so, how? Cheers, Hannes |
|
September 14, 2010, 14:09 |
|
#2 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
Anyone out there who could help me? A websearch has yielded VERY little information and scrutiny of the manuals for CFX and PGI none.
Cheers, Hannes |
|
September 15, 2010, 09:09 |
|
#3 |
Member
Join Date: Dec 2009
Posts: 44
Rep Power: 16 |
A couple of questions:
How have you linked the FE program to CFX? Have you simply added the library to the link line when compiling the CFX User Fortran extension? If so, have you included all the necessary libraries to allow the FE program to run in parallel? How are you calling the FE program from within CFX? Is it with a subroutine/function call? |
|
September 15, 2010, 09:36 |
|
#4 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
Well, it is my homegrown FE-program which is part of the sourcecode of the Junction box routine. It is compiled and linked to an *.so in the same compiler and linker run as the remainder of the routine.
It is called as a junction box routine at the beginning of each timestep. |
|
September 15, 2010, 10:38 |
|
#5 |
Member
Join Date: Dec 2009
Posts: 44
Rep Power: 16 |
But how are you including refernces to the OpenMP library in your Junction Box Routine?
Clearly the CFX Solver is having trouble locating a particular routine or function (_mp_lcpu). |
|
September 15, 2010, 10:45 |
|
#6 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
I put the OpenMP parallelisation directives into the code, just as with a standalone program. In the standalone case it works.
When creating a small test program for OpenMP, "_mp_lcpu" appears as ASCII in a compiled, yet unlinked binary (*.o) but doesn't in a linked one (*.out). Thank You for helping me, Hannes |
|
September 16, 2010, 10:28 |
|
#7 |
Member
Join Date: Dec 2009
Posts: 44
Rep Power: 16 |
Are you passing the -fopenmp flag (or equivalent) to the compiler when you create your CFX user fortran extension?
|
|
September 16, 2010, 13:12 |
|
#8 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
Actually, due to your help, I found that I was passing the OpenMP flag (-mp) only to the compiler (-WF,-mp) not the linker (-WL,-mp). Additionally a symbolic link from libnuma.so to libpgnuma.so was missing in the PGI redistribution package.
Now it is compiling, linking and running but still only on one core. So there is still some way to go, probably with the source code. Thank You, Hannes |
|
September 17, 2010, 06:40 |
|
#9 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
Well, now it appears that, while the NCPUS environment variable is set correctly (the code detects all processors), the OMP_IN_PARALLEL function returns F within a parallel region and I can get only one thread to run in a region defined as parallel.
|
|
September 20, 2010, 09:14 |
|
#10 |
Member
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17 |
It appears that OpenMP does not start in a shared object / junction box routine the same way it does in a stand-alone program. Does anyone have any hints?
Cheers, Hannes |
|
September 21, 2010, 14:51 |
|
#11 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
Hannes,
guess I can not help you with OpenMP. Possibly OpenMP is not compatible with the internal use within the CFX solver? In that case only their service can help. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
junction box routine and CEL function | bornspur | CFX | 2 | February 3, 2009 03:24 |
Junction Box Routine Shared Object Library | sam | CFX | 0 | March 3, 2008 13:52 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |
user defined function | cfduser | CFX | 0 | April 29, 2006 11:58 |
junction box routine | Lexi | CFX | 2 | January 21, 2004 05:55 |