Welcome, Guest
Username: Password: Remember me

TOPIC: parallel run, noerod.f problems

parallel run, noerod.f problems 8 years 8 months ago #20000

  • Montserrat
  • Montserrat's Avatar
Hi,

I'm modelling river flow in Telemac 2d Coupled with Sisyphe in parallel. The river banks has shotcrete so I need to set no erodible bed at the river banks. Because of that, I modifed the noerod.f subroutine and It works good in serial, but not in parallel.

I'm using KNOLG to asked for the global number of NPOIN, but is not working.
I attached the noerod.f file with coments of what I'm trying to do (easier to understand) Could you take a look to this file?

Thanks,

Gonzalo
Attachments:
The administrator has disabled public write access.

parallel run, noerod.f problems 8 years 8 months ago #20022

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I do not see anything obviously wrong, but what problem do you get. I would say that it takes a very long time to do the loop:

if(NCSIZE.gt.1)then

Do I=1,NPOIN
gn=mesh%KNOLG%I(I)

Do J=1,172321
if(gn .eq. Pto(J))then
ZR(I)=ZF(I)
end if
end do

end do
end if

Further the test if(NCSIZE.GT.1) THEN should have an else... for scalar cases. I would advise to try to have it working in scalar mode first.

With best regards,

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

parallel run, noerod.f problems 8 years 8 months ago #20036

  • Montserrat
  • Montserrat's Avatar
I think I found the problem, but I don't know how to solve it.

I made the following test:
I replaced Do I=1,NPOIN with DO I=1,392045 where 392045 is the total number of nodes in the mesh and then I asked for the KNOGL instead of the KNOLG.

DO I=1,392045
gn=MESH%KNOGL%I(I)
write(LU,*)I,gn
end do

the printing result is, gn=0 up to I=294000 and then gn≠0 for 294000<I>392045.
I'm running with 4 parallel processos, so each processors should solve 25% of the mesh. The values where gn≠0 are about 25% of the MESH, and the other 294000 nodes where gn=0 correspond to 75% of the mesh.


I do an other excercise:

DO I=1,NPOIN
gn=MESH%KNOLG%I(I)
write(LU,*)I,gn
end do

NPOIN=98442 ~ 25% of the MESH.


It seems that is running the code just in one processor.
How can I ask the program to run this code in all the processors involved?
The administrator has disabled public write access.

parallel run, noerod.f problems 8 years 8 months ago #20037

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Yes, but what you have done just shows that with 4 processors the mesh is split into 4 parts with about 25% of the mesh in each part... What we would like to see is your algorithm written for the scalar mode, and then we can think of writing it in parallel mode, in your Fortran file you have only written the part for parallelism, so we cannot know what is the original simple algorithm for reading your file and applying the boundary conditions. Your implementation should show what you do in scalar and what you do in parallel, so that we can check and see if it will give the same result.

With best regards,

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

parallel run, noerod.f problems 8 years 8 months ago #20038

  • Montserrat
  • Montserrat's Avatar
I attached the file for scalar mode, and works good.

But what I don't understand is why in parallel just read or works just in one processor.

thanks,

Gonzalo
The administrator has disabled public write access.

parallel run, noerod.f problems 8 years 8 months ago #20055

  • jmhervouet
  • jmhervouet's Avatar
Hello,

No file attached ? In parallel all the processors will read the file.

Regards,

JMH
The administrator has disabled public write access.

parallel run, noerod.f problems 8 years 8 months ago #20061

  • Montserrat
  • Montserrat's Avatar
I'm sorry.

There is the file.


File Attachment:

File Name: noerod_v2.f
File Size: 4 KB
The administrator has disabled public write access.

parallel run, noerod.f problems 8 years 8 months ago #20062

  • jmhervouet
  • jmhervouet's Avatar
Hello,

OK, so what I see in the scalar part is :

Do J=1,172321
ZR(Pto(J))=ZF(Pto(J))
end do

What is Pto(J), is it different from J ? If all the Pto(J) cover all the points from 1 to 172321 in a different order, then what you do is equivalent to:

Do J=1,NPOIN
ZR(J)=ZF(J)
end do

and in this case it is the same in parallel and all the bottom is non erodable, is it really what you want ? If yes there is no need of Pto and there is no specific treatment in parallel, the loop:

Do J=1,NPOIN
ZR(J)=ZF(J)
end do

will work for all cases.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.
Moderators: Pablo, pavans

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