mixed language programming using fortran c++ and openmp

Hi Edwin,

I have no openmp directives in the c++ model. When compiling the coupled model, do I have to set the compiler flags
-mp -Mnosgimp
to the fortran and the c++ compiler flags???

You only need compile those source files which contain OpenMP directives with “-mp” so mixing Fortran code which use OpenMP and C++ code which does not should work fine. Granted, I have not tested this myself so if it doesn’t work I’d consider it a bug. Note that you do need to link with “-mp”.

I did so and after quite some time solving the problem with the libnuma openmp > compiling for OMP on AMD64
I get an executable.

Since this problem had to do with statically linking the Numa libraries, have you tried linking dynamically?

Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (1)

The programm stalls at this point and eats one processors performance without getting anyfurther…

This warning is letting you know that you’re running 4 threads on a system which only has 1 CPU. The question is why only one CPU is being recognized.?

Can you try rerunning without your standard set-up variables and only set OMP_NUM_THREADS?

My question is in generally, is it posible to parallelize a mixed fortran c++ code???

It should. If it doesn’t, it’s a bug. Would you be able to send the code to trs@pgroup.com?

Thanks,
Mat