Opened 3 years ago

Closed 3 years ago

#901 closed upgrade (Done)

Improved memory.F

Reported by: arango Owned by:
Priority: minor Milestone: Release ROMS/TOMS 4.0
Component: Nonlinear Version: 3.9
Keywords: Cc:

Description

Updated memory.F to avoid creating a temporary vector for the fifth argument in the call to mp_collect during Fortran execution. Now, we have:

#ifdef DISTRIBUTE
      IF (.not.allocated(Bwrk)) THEN
        allocate ( Bwrk(Ntiles+1) )
      END IF
      IF (.not.allocated(Dwrk)) THEN
        allocate ( Dwrk(Ntiles+1) )
      END IF
#endif
      ...

#ifdef DISTRIBUTE
      Bwrk=spv
      Dwrk=spv
      DO ng=1,Ngrids
        Bwrk(MyRank+1)=BmemMax(ng)*1.0E-6_r8        ! already in bytes
        Dwrk(MyRank+1)=megabytefac*Dmem(ng)
        CALL mp_collect (ng, iNLM, numthreads, spv, Bwrk)
        CALL mp_collect (ng, iNLM, numthreads, spv, Dwrk)
        Bsize(MyRank,ng)=Bwrk(MyRank+1)
        Dsize(MyRank,ng)=Dwrk(MyRank+1)
        Bwrk=spv
        Dwrk=spv
      END DO
#else

where Bwrk and Dwrk are temporary vectors.

Change History (1)

comment:1 by arango, 3 years ago

Resolution: Done
Status: newclosed
Note: See TracTickets for help on using tickets.