[Dart-dev] DART/branches Revision: 12821
dart at ucar.edu
dart at ucar.edu
Thu Sep 13 14:18:36 MDT 2018
hendric at ucar.edu
2018-09-13 14:18:36 -0600 (Thu, 13 Sep 2018)
112
a slight correction for calculating the task owner in
the group, given an index i into the distributed array.
Modified: DART/branches/rma_distrib/developer_tests/mpi_groups/simple_test.f90
===================================================================
--- DART/branches/rma_distrib/developer_tests/mpi_groups/simple_test.f90 2018-09-13 19:28:02 UTC (rev 12820)
+++ DART/branches/rma_distrib/developer_tests/mpi_groups/simple_test.f90 2018-09-13 20:18:36 UTC (rev 12821)
@@ -376,7 +376,7 @@
target_disp = (i-1)/(group_size)
if (debug) then
- print*, 'my_task_id() = ', my_task_id(), ' i = ', i, 'owner = ', owner, 'target_disp', target_disp
+ print*, 'my_task_id() = ', my_task_id(), ' i = ', i, 'owner_group = ', owner, 'owner_world', get_owner(i,my_task_id()),' target_disp', target_disp
endif
! grab the info
@@ -442,6 +442,7 @@
integer, intent(in) :: pe
integer :: get_owner
+integer :: my_group
integer :: num_groups
integer :: num_vars
@@ -449,8 +450,11 @@
num_vars = NX / num_groups
!get_owner = (i-1)/num_groups
-get_owner = mod((i-1), num_vars)
+my_group = (pe/group_size) * group_size
+get_owner = my_group+mod(i-1,group_size)
+!get_owner = mod((i-1), num_vars)
+
end function get_owner
!> initialize modules that need it
More information about the Dart-dev
mailing list