Skip to content

Commit

Permalink
Add a note
Browse files Browse the repository at this point in the history
  • Loading branch information
metdyn committed May 22, 2024
1 parent aff31f6 commit bcaf779
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- fixed a bug in generate_newnxy in MAPL_SwathGridFactory.F90 (NX*NY=Ncore)
- pFIO Clients don't send "Done" message when there is no request
- Update `components.yaml`
- ESMA_cmake v3.45.1
Expand Down
14 changes: 7 additions & 7 deletions base/MAPL_SwathGridFactory.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1148,9 +1148,9 @@ subroutine generate_newnxy(this,unusable,rc)
pet_count = this%nx * this%ny
n = this%im_world/this%nx
if (n < 2) then
do j = int(sqrt(real(this%im_world))), 1, -1
do j = this%im_world/2, 1, -1
if ( mod(pet_count, j) == 0 .and. this%im_world/j >= 2 ) then
exit
exit ! found a decomposition
end if
end do
this%nx = j
Expand All @@ -1159,23 +1159,23 @@ subroutine generate_newnxy(this,unusable,rc)

n = this%jm_world/this%ny
if (n < 2) then
do j = int(sqrt(real(this%jm_world))), 1, -1
do j = this%jm_world/2, 1, -1
if ( mod(pet_count, j) == 0 .and. this%jm_world/j >=2 ) then
exit
exit ! found a decomposition
end if
end do
this%ny = j
this%nx = pet_count/j
end if

if ( this%im_world/this%nx < 2 .and. this%jm_world/this%ny < 2 ) then
if ( this%im_world/this%nx < 2 .OR. this%jm_world/this%ny < 2 ) then
_FAIL ('Algorithm failed')
end if

deallocate(this%ims)
if (allocated(this%ims)) deallocate(this%ims)
allocate(this%ims(0:this%nx-1))
call MAPL_DecomposeDim(this%im_world, this%ims, this%nx)
deallocate(this%jms)
if (allocated(this%jms)) deallocate(this%jms)
allocate(this%jms(0:this%ny-1))
call MAPL_DecomposeDim(this%jm_world, this%jms, this%ny)

Expand Down

0 comments on commit bcaf779

Please sign in to comment.