Skip to content

Commit

Permalink
Improve subroutine compute_block_ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Jan 27, 2024
1 parent 181bd08 commit afc00b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/formatmul.f90
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ pure subroutine compute_block_ranges(d, nimg, block_size, start_elem, end_elem)
remainder = mod(d, nimg)
block_size(1:remainder) = block_size(1:remainder) + 1
start_elem(1) = 1
end_elem(1) = block_size(1)
do i = 2, nimg
start_elem(i) = start_elem(i - 1) + block_size(i - 1)
end_elem(i) = start_elem(i) + block_size(i) - 1
end do
end_elem(1) = block_size(1)
end_elem(2:) = start_elem(2:) + block_size(2:) - 1
! Check if the block sizes are valid.
if (minval(block_size) <= 0) error stop 'ForMatmul: reduce the number of images of coarray.'
if (minval(block_size) <= 0) error stop 'ForDot: reduce the number of images of coarray.'
end subroutine compute_block_ranges
!===============================================================================

Expand Down

0 comments on commit afc00b6

Please sign in to comment.