[FLASH-USERS] sum variable across different processors

Maksim Kozlov maksim.kozlov at nu.edu.kz
Sun Jun 6 10:50:38 EDT 2021


Dear Flash users,
How can I sum variable across all blocks , not just blocks calculated by
one processor?
I am trying to do the following
I need to sum some variable calculated inside Simulation_initBlock over
several blocks. So in "gr_expandDomain" I added
     srce_volume=0
     do i = 1, count
        ...
        call Simulation_initBlock (blkList(i),tvolume)
        srce_volume=srce_volume+tvolume
     end do
to use srce_volume in different subroutines I added
real, save :: srce_volume
to Simulation_data
and
use Simulation_data, ONLY : srce_volume
in all subroutines where I need it
but what happens is that all blocks are divided between different
processors so srce_volume is summed only over blocks of one processor
instead of adding it for all blocks.
Thank you very much!
Maksim Kozlov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20210606/c4431ac0/attachment.htm>


More information about the flash-users mailing list