Hi all,
 
I have a doubt about lbound and bound in the test below 
using gfortran with opencoarrays, gasnet, and openmpi.

With the AA coarray (each AA entry is a 2D array), 
the values obtained with lbound and ubound are different 
from the initial and final values arbitrarily defined for 
each array entry. 

Is this ok and did I miss something here? 

Thanks in advance for some clarification.

Regards.
Jorge.

$ which gfortran
/usr/beta/gcc-trunk/bin/gfortran

$ gfortran --version
GNU Fortran (GCC) 11.0.1 20210315 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.

$ which ompi_info
/usr/beta/openmpi/bin/ompi_info

$ ompi_info
  ...
  /usr/beta/gcc-trunk/bin/gfortran

$ mpifort -Wall -Wextra -g -fcoarray=lib doubt1.f90 -o doubt1-openmpi.exe 
-L/usr/beta/opencoarrays-openmpi/lib64 -lcaf_mpi -lopencoarrays_mod -lmpi

$ mpirun --mca pml ucx --mca osc ucx -np 4 --mca btl vader,self,tcp 
--machinefile ${HOME}/machi-openmpi.dat --map-by node --map-by slot --map-by 
core --bind-to l2cache --mca orte_base_help_aggregate 0 --report-bindings 
--display-allocation --display-devel-map  doubt1-openmpi.exe
 
======================   ALLOCATED NODES   ======================
        flags=0x11 slots=16 max_slots=16 slots_inuse=0 state=UP
=================================================================
 Data for JOB [53806,1] offset 0 Total slots allocated 16

 Mapper requested: NULL  Last mapper: round_robin  Mapping policy: 
BYCORE:NOOVERSUBSCRIBE  Ranking policy: CORE
 Binding policy: L2CACHE  Cpu set: NULL  PPR: NULL  Cpus-per-rank: 0
         Num new daemons: 0        New daemon starting vpid INVALID
         Num nodes: 1

 Data for node: State: 3        Flags: 11
         Daemon: [[53806,0],0]        Daemon launched: True
         Num slots: 16        Slots in use: 4        Oversubscribed: FALSE
         Num slots allocated: 16        Max slots: 16
         Num procs: 4        Next node_rank: 4
         Data for proc: [[53806,1],0]
                 Pid: 0        Local rank: 0        Node rank: 0        App 
rank: 0
                 State: INITIALIZED        App_context: 0
                 Locale:  [BB/../../..]
                 Binding: [BB/../../..]
         Data for proc: [[53806,1],1]
                 Pid: 0        Local rank: 1        Node rank: 1        App 
rank: 1
                 State: INITIALIZED        App_context: 0
                 Locale:  [../BB/../..]
                 Binding: [../BB/../..]
         Data for proc: [[53806,1],2]
                 Pid: 0        Local rank: 2        Node rank: 2        App 
rank: 2
                 State: INITIALIZED        App_context: 0
                 Locale:  [../../BB/..]
                 Binding: [../../BB/..]
         Data for proc: [[53806,1],3]
                 Pid: 0        Local rank: 3        Node rank: 3        App 
rank: 3
                 State: INITIALIZED        App_context: 0
                 Locale:  [../../../BB]
                 Binding: [../../../BB]
[55028] MCW rank 0 bound to socket 0[core 0[hwt 0-1]]: [BB/../../..]
[55028] MCW rank 1 bound to socket 0[core 1[hwt 0-1]]: [../BB/../..]
[55028] MCW rank 2 bound to socket 0[core 2[hwt 0-1]]: [../../BB/..]
[55028] MCW rank 3 bound to socket 0[core 3[hwt 0-1]]: [../../../BB]

  ti h lbound(aa%oo,1) ubound(aa%oo,1) lbound(aa%oo,2) ubound(aa%oo,2)
           1           1           1           2           1           2
           3           1           1           2           1           2
           4           1           1           2           1           2
           2           1           1           2           1           2
           2           2           1           3           1           3
           1           2           1           3           1           3
           4           2           1           3           1           3
           3           2           1           3           1           3
           3           3           1           4           1           4
           2           3           1           4           1           4
           1           3           1           4           1           4
           4           3           1           4           1           4
           4           4           1           5           1           5
           3           4           1           5           1           5
           2           4           1           5           1           5
           1           4           1           5           1           5

  ti h aa[h]%i1 aa[h]%i2 aa[h]%j1 aa[h]%j1 aa[h]%j2
           1           1           2           3           4           5
           2           1           2           3           4           5
           2           2           8          10          12          14
           1           2           8          10          12          14
           2           3          14          17          20          23
           2           4          20          24          28          32
           3           1           2           3           4           5
           4           1           2           3           4           5
           1           3          14          17          20          23
           3           2           8          10          12          14
           4           2           8          10          12          14
           1           4          20          24          28          32
           3           3          14          17          20          23
           4           3          14          17          20          23
           3           4          20          24          28          32
           4           4          20          24          28          32

$ cat doubt1.f90
program doubt1
  implicit none
  type tma
    integer, allocatable :: oo (:,:)
    integer :: i1,i2,j1,j2
  end type tma
  type (tma) :: aa [*]
  !
  integer, parameter :: np = 2, nq = 2
  integer :: map (np,nq)
  integer :: ni, ti
  integer :: i1, i2, j1, j2
  integer :: h, k, p, q
  !
  ni = num_images()
  ti = this_image()
  !
  if (ni .ne. 4) error stop "num_images() must be 4"
  !
  k = 1
  do q = 1, nq
  do p = 1, np
    map (p,q) = k
    k = k + 1
  end do
  end do
  !
  i1 = 2
  i2 = 3
  j1 = 4
  j2 = 5
  do  h = 1, ni
    if (ti .eq. h) then
      allocate (aa % oo (i1:i2,j1:j2))
      aa % oo (i1:i2,j1:j2) = k
      aa % i1 = i1
      aa % i2 = i2
      aa % j1 = j1
      aa % j2 = j2
    end if
    i1 = i1 + 6
    i2 = i2 + 7
    j1 = j1 + 8
    j2 = j2 + 9
  end do
  !
  sync all
  !
  if (ti .eq. 1) then
    write (*,*)
    write (*,*)" ti h lbound(aa%oo,1) ubound(aa%oo,1) lbound(aa%oo,2) 
ubound(aa%oo,2)"
  end if
  do h = 1, ni
    write (*,*) ti,h,lbound (aa[h]%oo,1), ubound (aa[h]%oo,1), &
                     lbound (aa[h]%oo,2), ubound (aa[h]%oo,2)
  end do
  !
  sync all
  !
  if (ti .eq. 1) then
    write (*,*)
    write (*,*)" ti h aa[h]%i1 aa[h]%i2 aa[h]%j1 aa[h]%j1 aa[h]%j2"
  end if
  do h = 1, ni
    write (*,*) ti, h, aa [h] % i1, aa [h] % i2, &
                       aa [h] % j1, aa [h] % j2
  end do
  !
end program doubt1
#end

Reply via email to