Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Coarrays with WinMain()

Chris_G_2
Beginner
2,716 Views

I have a problem with coarrays using Intel Parallel Studio XE 2011 on Windows 7. I have written some coarray code which works well as a standalone program with an impressive speed increase using 2/4 or 8 cores. I am now trying to integrate it into an existing Windows application using

 integer function WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow)

This is compiled with the coarray option enabled. However, when I interrogate the program for num_images() it always returns a value of zero and not 8 which is the number of cores on this computer. this_image() is always returned as 1.

The environmental variable NUMBER_OR_PROCESSORS returns a value of 8.

Help would be much appreciated!

Chris

0 Kudos
22 Replies
Chris_G_2
Beginner
324 Views
I think I am being stupid (not for the first time): I need 2 seperate programs - the first compiled without the /Qcoarray option but using OpenMP, and the second, called from the first, compiled without OpenMP but using /Qcoarray:shared. Is this correct? Chris
0 Kudos
Steven_L_Intel1
Employee
324 Views
Yes, if I understand what you're doing that's what you want. The second program with the coarrays should be something that could be run on its own as a console application.
0 Kudos
Reply