Skip to content

Commit

Permalink
avoid associate to remote value
Browse files Browse the repository at this point in the history
  • Loading branch information
everythingfunctional committed Jul 25, 2023
1 parent 6c284cc commit d60de52
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/runner_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function do_work(dag) result(tasks_left)
end function

function find_next_image() result(next_image)
integer :: next_image, i, ev_count
integer :: next_image, i, ev_count, task_just_completed

next_image = NO_IMAGE_READY
do i = 1, size(ready_for_next_task)
Expand All @@ -125,10 +125,9 @@ function find_next_image() result(next_image)
call event_query (ready_for_next_task(i), ev_count)
if (ev_count > 0) then
next_image = i
associate (task_just_completed => (task_identifier[i]))
if (task_just_completed /= no_task_assigned) &
task_done(task_just_completed) = .true.
end associate
task_just_completed = (task_identifier[i])
if (task_just_completed /= no_task_assigned) &
task_done(task_just_completed) = .true.
end if
end do
end function
Expand Down Expand Up @@ -179,16 +178,15 @@ function assign_task(dag) result(tasks_left)
end function

subroutine assign_completed_to_images()
integer :: i
integer :: i, task_just_completed

do i = 1, size(ready_for_next_task)
if (i == scheduler_image) cycle ! don't wait on the scheduler image

event wait (ready_for_next_task(i))
associate (task_just_completed => (task_identifier[i]))
if (task_just_completed /= no_task_assigned) &
task_done(task_just_completed) = .true.
end associate
task_just_completed = task_identifier[i]
if (task_just_completed /= no_task_assigned) &
task_done(task_just_completed) = .true.
task_identifier[i] = ALL_TASKS_DONE
event post (task_assigned[i])
end do
Expand Down

0 comments on commit d60de52

Please sign in to comment.