Simulation hanging

169 views
Skip to first unread message

sam Latrech

unread,
Feb 2, 2021, 1:52:59 PM2/2/21
to Nek5000
Dear all

I am currently running a Nek5000 for pipe flow, i wanted to load from separated files and calculatite the average between them as shown below, but the logFile show that the simulation hang for hours trying  to  load one file.
LogFile
 call userchk
 set initial conditions
 Checking restart options: IC_HIGH.fld            :


     subroutine userchk
c      implicit none
      include 'SIZE'
      include 'TOTAL'

      integer n
      real Ke, Ke_cross
      REAL residual, H1,SEMI,L2,LINF
      parameter(lt=lx1*ly1*lz1*lelv)
      real vxiH(lt), vyiH(lt),vziH(lt),vxiL(lt), vyiL(lt),vziL(lt)

      n = lx1*ly1*lz1*nelv
      if (istep==0) then
      if (nid.eq.0) then
     call load_fld('IC_HIGH.fld')
      call opcopy(vxiH,vyiH,vziH,vx,vy,vz)
             call load_fld('IC_LOW3.fld')
      call opcopy(vxiL,vyiL,vziL,vx,vy,vz)
             do j = 1,n
 
                 vxiL(i) = (vxiL(i)+vxiH(i))/2
                 vyiL(i) = (vyiL(i)+vyiH(i))/2
vziL(i)=(vziL(i)+vziH(i))/2
     end do
  call opcopy(vx,vy,vz,vxiL,vyiL,vziL)

      end if 
      end if 
      !Computing turbulent kinetic energy and cross section energy
      Ke_cross = glsc3(vx,vx,bm1,n) + glsc3(vy,vy,bm1,n)
      Ke = Ke_cross + glsc3(vz,vz,bm1,n)
      Ke_cross = Ke_cross / (2*volvm1)
      Ke = Ke / (2*volvm1)
      
      !Computing residual
      call normvc(h1,semi,l2,linf,vx-vxlag(:,:,:,:,1),
     &                            vy-vylag(:,:,:,:,1),
     &                            vz-vzlag(:,:,:,:,1))
      residual = linf/dt


      if (Ke_cross > 1e-3) then
        call outpost(vx,vy,vz,pr,t,'HIGH_')
call exitt
      end if
        !Check if solution has converged and stop
      if (Ke_cross < 3e-6) then
        call outpost(vx,vy,vz,pr,t,'LOW_')
call exitt
      end if
 
  !Print to screen informations
      if (nid.eq.0) write(6,*) 'K_e = ', Ke
      if (nid.eq.0) write(6,*) 'Ke_cross = ', Ke_cross
      if (nid.eq.0) write(6,*) 'residual = ', residual
  
      !Write energy into a file
      if (nid.eq.0) then
     if (istep==0) then
    open(unit=20, file = 'nekEnergy.dat', status='replace' )
    write(20,*) "# time TKE TKE_cross residual"
         end if
         write(20,900) time, Ke, Ke_cross, residual
900      format(1F12.3,3E15.5)
         if (istep==nsteps) close(20)
      end if
Looking forward to your thoughts on this.
Best regards
Latrech



YuHsiang Lan

unread,
Feb 2, 2021, 2:29:56 PM2/2/21
to Nek5000
Hi Latrech

load_fld will let each mpi processes take turns to read the data.
However, the ` if (nid.eq.0) then` restrict other mpi process doing the work. Therefore, nid=0 will wait forever for others to finish.

Hope this helps,
Yu-Hsiang
--

sam Latrech

unread,
Feb 4, 2021, 11:53:53 AM2/4/21
to Nek5000
Hi Yu-Hsiang

Thank you for your response, i still have a question about my code, it appears that the average between the two files loaded is not done even if i specified in the code, the results shows that the code have loaded  just one file. Looking forward to your thoughts on this.
Best regards
Latrech
Reply all
Reply to author
Forward
0 new messages