Welcome, Guest
Username: Password: Remember me

TOPIC: Problem with donau example in parallel

Problem with donau example in parallel 11 years 1 month ago #10499

  • VictorOpenOcean
  • VictorOpenOcean's Avatar
the validation example donau of telemac2d doesn't works in parallel with the 6.3 version of OpenTELEMAC, while it walking with 6.2 version in parallel.
It seems that the problem comes from "KFROPT%I(K) = IVAL2" to the 505 line in the subroutine friction_user.

Are there been a change between 6.2 version and 6.3 that could cause this?

Best regards.

Victor.
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10500

  • jmhervouet
  • jmhervouet's Avatar
Hello,

We were not aware of this but if I look at the guilty line, I see above a use of KNOGL which has been suppressed (this array is far too large compared to others when we have many processors). So a correct implementation of the line :

K = MESH%KNOGL%I(I)

is now:

K=GLOBAL_TO_LOCAL_POINT(I,MESH)

However this function does a large loop to find K so it is not very efficient and has to be used with care, which is not the case here because it is called for every point in the sub-domain. Anyway it should solve the problem.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10501

  • Lufia
  • Lufia's Avatar
Hello,

does this mean that KNOGL also shouldn't/can't be used in other subroutines? What is the actual solution when working in parallel when MESH%KNOGL%I(I) was used often in a subroutine? Should GLOBAL_TO_LOCAL_POINT be used once and the data be stored or is there a fast alternative?

With best regards,

Leo
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10502

  • y.kervella
  • y.kervella's Avatar
Hello Jean-Michel,

I have tried to use the routine friction_user.f with the GLOBAL_TO_LOCAL_POINT transformation instead of the MESH%KNOLG%I one (as you said to Victor), like that:
DO I = 1,NPOIN_GLOB
READ(NFILE,*,END=999,ERR=998) IVAL1, IVAL2
IF (NCSIZE>1) THEN
K = GLOBAL_TO_LOCAL_POINT(I,MESH)
ELSE
K = I
ENDIF
KFROPT%I(K) = IVAL2
ENDDO

but it doesn't work.
The only solution I've found is this one:
DO I = 1,NPOIN_GLOB
READ(NFILE,*,END=999,ERR=998) IVAL1, IVAL2
IF (NCSIZE.GT.1) THEN
DO K =1,NPOIN_GLOB
IF(GLOBAL_TO_LOCAL_POINT(K,MESH).EQ.I) THEN
KFROPT%I(I) = IVAL2
ENDIF
ENDDO
ELSE
KFROPT%I(K) = IVAL2
ENDIF
ENDDO
but it's very expensive in terms of computing time (2 loops on all points..).
Is there another way to solve the problem ?
Thanks,

Youen
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10505

  • riadh
  • riadh's Avatar
Hello

First, you there is no need for the IF (ncsize>1) because the subroutine GLOBAL_TO_LOCAL_POINT(I,MESH) will return I if ncsize is <=1. But this is not the problem ! this is just a part of the problem.
Actually, if node I is not in the subdomain, subroutine GLOBAL_TO_LOCAL_POINT will return 0 and that's why you have problem when you use KFROPT%I(K) because K is 0.
Therefore, you can replace, for instance, the line
KFROPT%I(K) = IVAL2
by
IF(K.NE.0)KFROPT%I(K) = IVAL2

and the final code reads:
DO I = 1,NPOIN_GLOB
READ(NFILE,*,END=999,ERR=998) IVAL1, IVAL2
K = GLOBAL_TO_LOCAL_POINT(I,MESH)
IF(K.NE.0)KFROPT%I(K) = IVAL2
ENDDO

Actually, as it was said by Jean Michel and Leo, this solution is expensive and needs to be optimized especially if there are many calls to GLOBAL_TO_LOCAL_POINT.

A final remark about your second solution. yes it works, but is false: you are looping with the index I (first loop DO I=1,NPOIN_GLOB) and in serial case you use the index K (KFROPT%I(K) = IVAL2). Thus the serial case is not good.

With my best regards

Riadh ATA
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10507

  • y.kervella
  • y.kervella's Avatar
Thanks for the answer Riadh,

Now, the friction routine works correctly with the test IF(K.NE.0).

Best regards,

Youen
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10508

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Yes you are right, I tested with Nag compiler without checking of bounds.

Yes in this case the double loop is akward, on this test case we would have to re-engineer from scratch, e.g. reading a selafin file which will be partitioned.

We do not consider that we can go on with KNOGL, as we have in mind applications with 32000 processors, in which case this array would be 32000 larger than others.

Regards,

JMH
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10514

  • Lufia
  • Lufia's Avatar
Hello,

so I assume that KNOLG will be still available?

With best regards,

Leo
The administrator has disabled public write access.

Problem with donau example in parallel 11 years 1 month ago #10515

  • jmhervouet
  • jmhervouet's Avatar
Yes, this one has a small size.

JMH
The administrator has disabled public write access.
Moderators: pham

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