The simultaneous use of coarrays and parallelization

The simultaneous use of coarrays and parallelization

Bild des Benutzers Chris G.

I have a general question concerning the simultaneous use of coarrays and parallelization using Intel Fortran on Windows 7.

I have a program which is compiled for coarray use. The computer I am using has 4 cores. The software uses 1 image only for the first part of the calculations, then splits into 4 images for further, compute intensive steps, then reverts to a single image. The ‘sync  all’  statement is used as necessary to synchronise the 3 stages.

However, if you monitor cpu usage with the Windows 7 Task Manager, all four cores are shown as running at 100% utilization throughout the run of the software. I presume that this is a consequence of the use of  ‘sync all’?

My questions are:

  1. Am I correct in my assumptions about ‘sync all’?

I could usefully carry out some parallelization in the 1st and 3rd parts of the calculations where only a single image is used, but if all the cores are fully utilized is there any point?

Chris

9 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Chris G.

There seems to be a typo on my posting. The end part should read:

1. Am I correct in my assumptions about ‘sync all’?

2. I could usefully carry out some parallelization in the 1st and 3rd parts of the calculations where only a single image is used, but if all the cores are fully utilized is there any point?

Bild des Benutzers Steve Lionel (Intel)

Theoretically, there's no reason you can't use other parallelization methods with coarrays, but it isn't something we have tested well and we say it's not supported. You do want to be careful, though, as you're likely to "oversubscribe" your cores here.  Each image will think it can use all four cores.

Having all images go CPU bound is usually indicative of one of the images failing with an error of some sort. A SYNC ALL should not trigger this. Which version of Intel Fortran are you using?

Steve
Bild des Benutzers Chris G.

Thanks for your comments.

I am using Visual Fortran Compiler XE for applications running on IA-32, Version 13.1.1.171

My program structure looks like this:
program UsingCoarrays
.
if(this_image() == 1) then
! A 5 min calculation using only one image (and 1 core)
! I would like to use parallelization here.
! All 4 cores are shown to be operating at 100% while image 1 is
! working (Using Windows Task Manager).
.
endif

sync all
if(this_image() == 1) then
!  A 3-4 min calculation on image 1. No parallelization
else if (this_image() == 2) then
!  A 3-4 min calculation on image 2. No parallelization
else if (this_image() == 3) then
!  A 3-4 min calculation on image 3. No parallelization
else if (this_image() == 4) then
!  A 3-4 min calculation on image 4. No parallelization
endif
sync all
if(this_image() == 1) then
! A final 5 min calculation using only one image (and 1 core)
! I would like to use parallelization here as well.
! All 4 cores are shown to be operating at 100% while image 1 is
! working (Using Windows Task Manager).
sync all
.
endif

end program UsingCoarrays

Bild des Benutzers jimdempseyatthecove

From your description:

The computer I am using has 4 cores. The software uses 1 image only for the first part of the calculations, then splits into 4 images for further, compute intensive steps, then reverts to a single image.

Your single processor (chip) has 4 images, each running in a separate Process (different virtual machine), with one of the images (1) being multi-threaded. Potential situation:

Part 1: Core 0/Image 1/Thread 0, Core 1/Image 1/Thread 1, Core 2/Image 1/Thread 2, Core 3/Image 1/Thread 3 (all  cores busy)
Part 2: Core 0/Image 1/Thread 0, Core 1/Image 2/Thread 0, Core 2/Image 3/Thread 0, Core 3/Image 3/Thread 0 (all  cores busy)
Part 3: Core 0/Image 1/Thread 0, Core 1/Image 1/Thread 1, Core 2/Image 1/Thread 2, Core 3/Image 1/Thread 3 (all  cores busy)

N.B. Considersetting KMP_BLOCK_TIME = 0. This will permit images 2:4 to begin immediately upon completion of part 2.

Jim Dempsey

 

 

www.quickthreadprogramming.com
Bild des Benutzers Chris G.

Thanks Jim, but I'm not using OPENMP (at least not directly) just coarrays, so can I use KMP_BLOCK_TIME = 0 ?

Chris

Bild des Benutzers Steve Lionel (Intel)

Please try the newest compiler version - we've made several improvements to coarrays, and more in the version to be released in a couple of months. If you can provide a test program I can look at, that would be helpful.

The KMP_ environment variables are used by OpenMP or autoparallel only. They don't apply to coarrays.

Steve
Bild des Benutzers Chris G.

Here is the simplest possible program that shows all the processor cores (except one) working at full steam when using sync all.

program DemoSyncAll
  ! A simple program to demonstratte that all the cores wotk flat out when using sync all
  character (len=1) :: acharacter
  if(this_image() == 1) then
    write(*,"('Start the Window Task Manager/Performance now.')")
    write(*,"('Enter any character to quit: ',$)")
    read(*,*) acharacter
  endif
  ! Until you enter a character all the processor cores are working flat out except one.
  sync all
  stop
  end program DemoSyncAll

If you start the Windows Task Manage with the Performance graphs, then run this program you will see that all the cores are shown as running flat out.

ChrisG

Bild des Benutzers Steve Lionel (Intel)

I can reproduce this - we'll investigate and will let you know what we find. The issue ID is DPD200246029.

Steve

Melden Sie sich an, um einen Kommentar zu hinterlassen.