From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.intec.unl.edu.ar (intec.santafe-conicet.gob.ar [200.9.237.140]) by sourceware.org (Postfix) with ESMTPS id A4DBA3858C27 for ; Sun, 21 Mar 2021 16:16:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A4DBA3858C27 Received: from localhost (localhost [127.0.0.1]) by mail.intec.unl.edu.ar (Postfix) with ESMTP id 16DFC28377E for ; Sun, 21 Mar 2021 13:18:16 -0300 (ART) Received: from mail.intec.unl.edu.ar ([127.0.0.1]) by localhost (mail.intec.unl.edu.ar [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9W5Nb47QJUXN for ; Sun, 21 Mar 2021 13:18:14 -0300 (ART) Received: from localhost (localhost [127.0.0.1]) by mail.intec.unl.edu.ar (Postfix) with ESMTP id 44C58283D8B for ; Sun, 21 Mar 2021 13:18:14 -0300 (ART) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.intec.unl.edu.ar 44C58283D8B X-Virus-Scanned: amavisd-new at intec.unl.edu.ar Received: from mail.intec.unl.edu.ar ([127.0.0.1]) by localhost (mail.intec.unl.edu.ar [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RSmaCiNfwEzO for ; Sun, 21 Mar 2021 13:18:14 -0300 (ART) Received: from mail.intec.unl.edu.ar (mail.intranet [192.168.0.134]) by mail.intec.unl.edu.ar (Postfix) with ESMTP id EE10728377E for ; Sun, 21 Mar 2021 13:18:13 -0300 (ART) Date: Sun, 21 Mar 2021 13:18:13 -0300 (ART) From: Jorge D'Elia Reply-To: Jorge D'Elia To: Gfortran List Message-ID: <1171521953.1070.1616343493686.JavaMail.zimbra@intec.unl.edu.ar> In-Reply-To: <121178681.597.1612108263047.JavaMail.zimbra@intec.unl.edu.ar> References: <121178681.597.1612108263047.JavaMail.zimbra@intec.unl.edu.ar> Subject: A doubt about lbound and ubound of an array inside a coarray MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.8.12_GA_3803 (ZimbraWebClient - FF86 (Linux)/8.8.12_GA_3794) Thread-Topic: A doubt about lbound and ubound of an array inside a coarray Thread-Index: lrKgL4FrmrHNCGEJ/ug/30udopcYwcR+i8Im X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KAM_ASCII_DIVIDERS, PDS_BTC_ID, SCC_5_SHORT_WORD_LINES, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2021 16:16:41 -0000 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