- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Whether it is possible to allocate for a array of coarray on different images the different size?
I have tested a following example, but it does not work:
module moduls
real(8), allocatable:: Z(:,:)[:]
! d - for transfer of dimension of matrix Z
integer :: d
end module moduls
program main
use moduls
np = this_image()
call impedance! Allocation of memory and initialization of matrix Z
sync all
if (np ==1) then
m = d[4]
print*,'check Z on image', m
do j = 1,m
write(*,'(
enddo
sync images(*)
else
sync images(1)
endif
end program main
subroutine impedance
use moduls
np = this_image()
d = np
allocate( Z(d,d)
!initialization of matrix Z
do i = 1,d
do j = 1,d
Z(i,j) = real(i)
enddo
enddo
if (np == 4) then
print*,'input Z on image', d
do j = 1,d
write(*,'(
enddo
endif
return
END subroutine impedance
Result: wrong transfer of a array
input Z on image 4
1.00 1.00 1.00 1.00
2.00 2.00 2.00 2.00
3.00 3.00 3.00 3.00
4.00 4.00 4.00 4.00
check Z on image 4
1.00 2.00 3.00 4.00
2.00 3.00 4.00 1.00
3.00 4.00 1.00 2.00
4.00 1.00 2.00 3.00
Where a error?
Sincerely, Yuri
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"The values of corresponding bounds and corresponding cobounds shall be the same on every image."
However, the standard also says that "The processor is not required to detect violations of the rule that the bounds are the same on all images".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the detailed answer.
Sincerely,
Yuri

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page