CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   OpenMP in Junction Box Routine (

Hannes_Kiel September 10, 2010 04:40

OpenMP in Junction Box Routine
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- |
| /home/FE/linux-amd64/libcomm_li- |
| 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?


Hannes_Kiel September 14, 2010 13:09

Anyone out there who could help me? A websearch has yielded VERY little information and scrutiny of the manuals for CFX and PGI none.


cfdgremlin September 15, 2010 08:09

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?

Hannes_Kiel September 15, 2010 08:36

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.

cfdgremlin September 15, 2010 09:38

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).

Hannes_Kiel September 15, 2010 09:45

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,

cfdgremlin September 16, 2010 09:28

Are you passing the -fopenmp flag (or equivalent) to the compiler when you create your CFX user fortran extension?

Hannes_Kiel September 16, 2010 12:12

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 to 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_Kiel September 17, 2010 05:40

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.

Hannes_Kiel September 20, 2010 08:14

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?


joey2007 September 21, 2010 13:51

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.

All times are GMT -4. The time now is 16:18.