Welcome, Guest
Username: Password: Remember me

TOPIC: parallel runs with noerod.f

parallel runs with noerod.f 12 years 1 month ago #5956

  • ewang
  • ewang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 100
I am trying to set up a parallel run involving noerod.f which reads in list of node numbers and the corresponding bedrock depth from FORMATTED DATA FILE 1. The codes seem to read in part of the data correctly.

Can someone provide a brief explanation on how the parallel code deal with input file? should I place some sort of 'barrier' (can't remember the term now) to bring all processors back and read the input file?

This is what I have so far:


USE BIEF, ONLY: NCSIZE
USE DECLARATIONS_TELEMAC2D, ONLY: T2D_FILES, T2DFO1, MESH

INTEGER INP, K, NODE_IN
REAL ARMOUR

INP = T2D_FILES(T2DFO1)%LU

do i = 1, NPOIN
read (INP,*) NODE_IN, ARMOUR
if (NCSIZE .GT. 1) THEN
k = MESH%KNOLG%I(I)
ELSE
k = i
ENDIF
ZR(k) = ARMOUR
end do


Thanks.
The administrator has disabled public write access.

parallel runs with noerod.f 12 years 1 month ago #5971

  • ails
  • ails's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 17
Hello,

Actually, different attributes for I/O files are available (you can refer to the french comments in the Telemac dictionnary header):
  • SCAL : the file is copied in the TMP directory with NO CHANGES and the same file is read by all processors (but a race course between processors can occur)
  • PARAL : the file is duplicated with an extension (see extens.f function) with NO CHANGES (but some CPU time may be lost by opening too many files)
  • SELAFIN : the file will be automatically split/merged (through partel / gretel). Both node and elements numbering are affected.
  • SELAFIN-GEOM : similar as SELAFIN option but for the geometry file
  • CONLIM : only for the boundary conditions file, used in partel
  • SECTION
  • Sections input file, to be treated in parallel by partel in a similar way as CONLIM
For example, the T2DFO1 file you try to read has a PARAL attribute.

So, what do you mean by "part of the data" :
- part of the file ? test with the SCAL attribute
- or you get incorrect data? You don't seem to use the NODE_IN value - which I guess - is the global number which goes with the ARMOUR value. As there is no-renumbering on this file, you should directly use the NODE_IN value (ZR(NODE_IN) = ARMOUR)

Hope it helps...

Best regards,

Fabien Decung
The administrator has disabled public write access.

parallel runs with noerod.f 12 years 1 month ago #5980

  • ewang
  • ewang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 100
Hi Fabien,

I believe renumbering does take place in noerod.f subroutine. If my mesh has 100 nodes and I am running with 2 processors, then NPOIN is 50.

I have come up with a temporary solution which seems to work for now.

1) Essentially I force each thread to read the ZR values based on the global number rather than on NPOIN and assign them as ZR_TEMP

2) Then in the "do i = 1, NPOIN" loop, I determine the global number corresponding to the local number and assign the ZR(i) = ZR_TEMP(k)


INP = T2D_FILES(T2DFO1)%LU

! read in shared input file
do i = 1, total_npoin
read (INP,*) node_in,ZR_temp(i)
end do

IF (NCSIZE .GT. 1) THEN
do i = 1, NPOIN
k = MESH%KNOLG%I(i) ! determine the corresponding global number
ZR(i) = ZR_temp(k)
end do
ELSE
do i = 1, NPOIN
k = i
ZR(i) = ZR_temp(k)
end do
ENDIF

Edwin
The administrator has disabled public write access.

parallel runs with noerod.f 12 years 1 month ago #5983

  • ails
  • ails's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 17
Ok, my mistake.
Indeed, as Npoin is affected in parallel, you weren't reading the file entirely.

Fabien
The administrator has disabled public write access.

parallel runs with noerod.f 12 years 1 month ago #5985

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
There is another simpler solution to read in a map of values without having to do much coding nor declaring superbig arrays, and yet working in parallel.

You can map the value onto your mesh and add that as a new variable to your GEOMETRY file (for instance, or to one of the BIs (i.e. BINARY 1 or 2)). TELEMAC will then split the mesh for you and all you need to do is to read the value from that file using something like (storing the value in PRIVE array, the name of the variable in the BIN1 being "MY VAR"):
  INTEGER ERR
  DOUBLE PRECISION BID
  REAL, ALLOCATABLE :: WSEB(:)
  LOGICAL OK
  ALLOCATE(WSEB(NPOIN),STAT=ERR)
  IF(ERR.NE.0) STOP

  IF( NPRIV.GE.1 ) THEN
    CALL OS( 'X=C     ',PRIVE%ADR(1)%P, ZF,ZF,(0.D0) )
    CALL FIND_IN_SEL(PRIVE%ADR(1)%P,'MY VAR          ',
&     T2D_FILES(T2DBI1)%LU,WSEB,OK,TIME=BID)
  ENDIF
  IF( OK ) WRITE(LU,'(//,1X,A)') 'MY VAR'
  DEALLOCATE(WSEB)

Hope this helps,

Sébastien
The administrator has disabled public write access.

parallel runs with noerod.f 12 years 1 month ago #6015

  • ewang
  • ewang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 100
Hi Sébastien,

Thanks for the insight. I will explore the suggested approach as well.

Edwin
The administrator has disabled public write access.
Moderators: Pablo, pavans

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.