CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

OpenMP in Junction Box Routine

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2010, 05:40
Default OpenMP in Junction Box Routine
  #1
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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
Hannes_Kiel is offline   Reply With Quote

Old   September 14, 2010, 14:09
Default
  #2
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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
Hannes_Kiel is offline   Reply With Quote

Old   September 15, 2010, 09:09
Default
  #3
Member
 
Join Date: Dec 2009
Posts: 44
Rep Power: 16
cfdgremlin is on a distinguished road
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?
cfdgremlin is offline   Reply With Quote

Old   September 15, 2010, 09:36
Default
  #4
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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.
Hannes_Kiel is offline   Reply With Quote

Old   September 15, 2010, 10:38
Default
  #5
Member
 
Join Date: Dec 2009
Posts: 44
Rep Power: 16
cfdgremlin is on a distinguished road
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).
cfdgremlin is offline   Reply With Quote

Old   September 15, 2010, 10:45
Default
  #6
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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
Hannes_Kiel is offline   Reply With Quote

Old   September 16, 2010, 10:28
Default
  #7
Member
 
Join Date: Dec 2009
Posts: 44
Rep Power: 16
cfdgremlin is on a distinguished road
Are you passing the -fopenmp flag (or equivalent) to the compiler when you create your CFX user fortran extension?
cfdgremlin is offline   Reply With Quote

Old   September 16, 2010, 13:12
Default
  #8
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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
Hannes_Kiel is offline   Reply With Quote

Old   September 17, 2010, 06:40
Default
  #9
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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 is offline   Reply With Quote

Old   September 20, 2010, 09:14
Default
  #10
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 16
Hannes_Kiel is on a distinguished road
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
Hannes_Kiel is offline   Reply With Quote

Old   September 21, 2010, 14:51
Default
  #11
Senior Member
 
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17
joey2007 is on a distinguished road
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.
joey2007 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 11:25.