Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

MIxed Fortran C OpenMP code

unrue
Débutant
661 Visites

Dear Fortran and OpenMP developers, I have a mixed Fortran/C code and I want to ask you if this situation is correct:

 

From C:

int a;

#omp threadprivate(a)

void foo() {

a = //something

}

From Fortran Main:

$OMP PARALLEL

foo()

$OMP END PARALLEL

So, I have a function from C that set a global variable declared as threadprivate. The function is called from a PARALLEL from Fortran. The threadprivate works well in this case? 

 

Thanks.

0 Compliments
1 Répondre
jimdempseyatthecove
Contributeur émérite III
661 Visites

That works for me on both Linux and Windows. Note, I used Intel C++ and Intel Fortran.

Jim Dempsey

0 Compliments
Répondre