Welcome, Guest
Username: Password: Remember me

TOPIC: Getting the total number of nodes of mesh in a parallel run

Getting the total number of nodes of mesh in a parallel run 11 years 6 months ago #8678

  • gourish
  • gourish's Avatar
Hi,

How to find the total number of mesh nodes in a simulation mesh, when the run is performed in parallel. Is there any variable or, I have to find out using some method.

The variable NPOIN gives the total number of nodes in the domain, the domain is actually a sub-domain after partitioning performed by the partel program of the global simulation mesh.

Thanks,
Gourish
The administrator has disabled public write access.

Getting the total number of nodes of mesh in a parallel run 11 years 6 months ago #8699

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Gourish,

Of course you are right. Note that you should not need to know that number ... maybe you want to share with us what you are really trying to achieve and we can help ....

If you really wish you had that total number of nodes, there are a few ways to get it ... here is one way to show you also how to do these things generically:
NT = NPOIN
IF( NCSIZE.GT.1 ) THEN
   NT = P_ISUM(NT)
ENDIF

NT is the total sum of NPOIN for each sub-domain

Of course, here you are duplicating the number of internal points (boundary of a sub-domain but not boundary of the overall domain) shared between two or more sub-domains. So what is the solution ?

You can use KNOLG ...
There is an array (type BIEF_OBJ) in the TELEMAC system that gives you the global node number (in your overall domain) for any local node on a sub-domain: MESH%KNOLG (KNOLG is a field of MESH).
NT = NPOIN
DO IPOIN = 1,NPOIN
  NT = MAX( NT,MESH%KNOLG%I(IPOIN) )
ENDDO
IF( NCSIZE.GT.1 ) THEN
   NT = P_IMAX(NT)
ENDIF

You can also use IPOBO ... I'll let you find out if you wish.

Hope this helps,
Sebastien.
The administrator has disabled public write access.
The following user(s) said Thank You: gourish, TelemacUser1

Getting the total number of nodes of mesh in a parallel run 11 years 6 months ago #8708

  • gourish
  • gourish's Avatar
Hi Sebastien,
Thanks for you reply.

Actually I want impose wind forcing (derived from NCEP winds) for my model, which is varying with time and space.

It was quite easy to modify meteo subroutine for the wind forcing to work, when the model runs in serial. However when I try to run in parallel I had to take care of the nodes number when the data is being read from the file.

If I have N nodes in the model, then for each node and specified time, I have a U, V and P value. I have attached the data file which gives the format of the wind input data. When I make a parallel run the number of nodes for each processor changes (NPOIN), however my file has N number of nodes at the specified time. I require the value N for each process, if I use NPOIN for each process then the complete values are not read. Tentatively I made a work around by writing the total number of nodes in the data file, where each processor program can read a uniform value.

I am currently also using the MESH%KNOLG%I(I) to find the global node number, of the local mesh node.

I shall try the method which you have suggested to find the total node number in the mesh. Can you also let me know as how to use IPOBO to find the total node number. Also is it also possible to get access to the other nodes from other shared processes, which are not being used by a local process.

I have attached the sample data file and modified meteo subroutine.

With Best regards,

Gourish

File Attachment:

File Name: windforcing.zip
File Size: 601 KB
The administrator has disabled public write access.

Getting the total number of nodes of mesh in a parallel run 11 years 6 months ago #8709

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Sébastien, I had already posted your second solution but apparently it did not show up for some reason. Your first algorithm coounts twice or more the interface points, don't you think ?

Regards,

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

Getting the total number of nodes of mesh in a parallel run 11 years 6 months ago #8711

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Hello,

(Jean-Michel, Yes, the second one is the solution. You count the internal boundary node twice otherwise.)

Also for wind, you should not need to access the other processors' node numbers. Particularly if you know alrady about MESH%KNOLG%I(I), where I is on your local processor node number, then MESH%KNOLG%I(I) is your global node number. You could therefore have a column in your wind file that has that global node number in the header of the column and get to its column data from the local processor, ignoring all those you do not need. Each processor will then take whatever column data it needs based on a global node number reference.

Note that this method is very generic -- for instance, we do that all the time when we use space/time varying boundaries even if one boundary is split over two or more processors. We create a liquid boundary file with headers such as SL(19876) SL(19878) ... where the number are global node number. A call to READ_FIC_FR_LIQ from SL.f then picks up the correct column using MESH%KNOLG%I(I) in the build-up of the string.

Using an IPOBO implementation would be more complicated as you would still need to avoid counting interface nodes twice.

Hope this helps.
Sebastien.
The administrator has disabled public write access.
The following user(s) said Thank You: gourish

Getting the total number of nodes of mesh in a parallel run 11 years 6 months ago #8714

  • gourish
  • gourish's Avatar
Hi Sebastien,

Yes indeed the method which you have suggested to read the wind file is really a better method to pick up the wind values.

I am currently changing the program to use the suggested method.

Thanks and regards,
Gourish
The administrator has disabled public write access.
Moderators: pham

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