Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed some synchronization issues with coarrays
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jun 12, 2023
1 parent 0d4935b commit 2da4a93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/swiftest/swiftest_coarray.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@ module subroutine swiftest_coarray_balance_system(nbody_system, param)
write(param%display_unit,*) "ntp_min : " // trim(adjustl(min_str))
write(param%display_unit,*) "ntp_max : " // trim(adjustl(max_str))
write(param%display_unit,*) "difference: " // trim(adjustl(diff_str))
flush(param%display_unit)
sync all
if (ntp_max - ntp_min >= num_images()) then
write(param%display_unit,*) trim(adjustl(diff_str)) // ">=" // trim(adjustl(ni_str)) // ": Rebalancing"
flush(param%display_unit)
call nbody_system%coarray_collect(param)
call nbody_system%coarray_distribute(param)
write(param%display_unit,*) "Rebalancing complete"
else
write(param%display_unit,*) trim(adjustl(diff_str)) // "<" // trim(adjustl(ni_str)) // ": No rebalancing needed"
end if
call flush(param%display_unit)
flush(param%display_unit)
return
end subroutine swiftest_coarray_balance_system

Expand Down
1 change: 1 addition & 0 deletions src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ module subroutine swiftest_io_dump_storage(self, param)
call iotimer%stop()
sync all
call iotimer%report(message="File output :", unit=param%display_unit)
flush(param%display_unit)
#endif
end associate

Expand Down

0 comments on commit 2da4a93

Please sign in to comment.