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

Commit

Permalink
Shutdown unused images when coarrays are turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Apr 21, 2023
1 parent 2600ef9 commit bc84508
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/swiftest/swiftest_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ program swiftest_driver
param%integrator = trim(adjustl(integrator))
param%display_style = trim(adjustl(display_style))
call param%read_in(param_file_name)
if (.not.param%lcoarray .and. (this_image() /= 1)) stop ! Single image mode

associate(t0 => param%t0, &
tstart => param%tstart, &
Expand Down Expand Up @@ -96,7 +97,7 @@ program swiftest_driver

#ifdef COARRAY
! The following line lets us read in the input files one image at a time
if (this_image() /= 1) sync images(this_image() - 1)
if (param%lcoarray .and. (this_image() /= 1)) sync images(this_image() - 1)
#endif
call nbody_system%initialize(system_history, param)
#ifdef COARRAY
Expand Down Expand Up @@ -128,7 +129,7 @@ program swiftest_driver
#endif

#ifdef COARRAY
if (this_image() < num_images()) sync images(this_image() + 1)
if (param%lcoarray .and. (this_image() < num_images())) sync images(this_image() + 1)
! Distribute test particles to the various images
call nbody_system%coarray_distribute(param)
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,7 @@ module subroutine swiftest_io_param_reader(self, unit, iotype, v_list, iostat, i

#ifdef COARRAY
end if ! this_image() == 1
call coparam%coclone()
if (self%lcoarray) call coparam%coclone()
select type(self)
type is (swiftest_parameters)
self = coparam
Expand Down

0 comments on commit bc84508

Please sign in to comment.