[Nek5000-users] WSS on several processors
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Tue Jul 12 08:31:11 CDT 2016
Hi Andrew,
How you write to the file depends on the underlying structure that you want at output. I'm
assuming there is no particular order in this case and therefore you also need to write out
the coordinates. Presumably you've already addressed these questions in your working
serial version.
Let's assume you have an array with 6 quantities per grid point: my_data(6,n) and let's assume
that you've already figured out how to write it in serial.
To do a parallel write, one processor at a time (which actually is a serial write... but it's ok),
you could do the following:
real my_data(6,nmax...)
do mid=0,np-1 ! march over all processors
if (mid.eq.0.and.nid.eq.0) then
open(unit=50,file='my_file.out')
write(6,1) ((my_data(k,j),k=1,6),j=1,n)
elseif (mid.gt.0.and.mid.eq.0) then
handshake=1
len=wdsize
len4=4
mtag=777
call csend(mtag,handshake,len,mid,0) ! send handshake to mid
call crecv(mtag,n,len4) ! get number of incoming words
call csend(mtag,handshake,len,mid,0) ! send handshake to mid
len = wdsize*n*6
call crecv(my_data,n,len) ! get data from mid
write(6,1) ((my_data(k,j),k=1,6),j=1,n)
else ! mid > 0
len = wdsize
len4=4
call crecv(mtag,handshake,len)
call csend(mtag,n,len4,0,0) ! send data size to node 0
call crecv(mtag,handshake,len)
len = wdsize*n*6
call csend(mtag,my_data,len,0,0)
endif
if (nid.eq.0) close(50)
1 format(1p6e19.11)
I've not tested this... but it should be reasonably close to working...
Paul
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
Sent: Tuesday, July 12, 2016 3:30 AM
To: nek5000-users at lists.mcs.anl.gov
Subject: Re: [Nek5000-users] WSS on several processors
Hi Paul,
Yes, torq_calc generates integral quantities, viscous drag (dragvx, dragvy, dragvz) for example. You are right, my issue is different: I defined an object, which is a cylindric pipe's wall, with set_obj; and now I' m trying to find all the coordinates of this object and quantities dg(1,2), dg(2,2), dg(3,2) in these coordinates. My code works fine for the serial setting but with parallel setting only a part of coordinates is dumped into the file. And this part corresponds to the values of one CPU (I run my case with 16 CPU on one node). I have tried to use subroutine gop(x, w op, n) but it doesn't work.
Best regards, Andrew
2016-07-11 18:58 GMT+02:00 <nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>>:
Hi Andrew,
torq_calc (which also computes drag as a byproduct) will generate integral quantities over several
objects.
So, you could have (say) the upper and lower wall as two separate objects, and you can get the
drag on each. This amounts to 2 vector quantities (3 numbers each: fx,fy,fz) at each time step
and is written out by node 0.
It sounds like you are asking for something different, e.g., the wall shear stress as a function of
position --- that requires a bit more sophistication but is certainly accessible.
What are you looking for?
Best, Paul
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov> [nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov>] on behalf of nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov> [nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>]
Sent: Sunday, July 10, 2016 12:39 PM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: [Nek5000-users] WSS on several processors
Hi Neks,
I am working with two routines (torq_calc and drgtrq )in navier5.f. I'm trying to collect viscous drag's values on the wall (in all the grid points) and write them into a file. If I run a calculation on the one CPU it works great, but it doesn't work with several processors: I have an impression that the information is written into result file from only one processors. How can I fix this problem?
Thank you for any suggestion,
Andrew
_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov<mailto:Nek5000-users at lists.mcs.anl.gov>
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20160712/f2f773c7/attachment-0001.html>
More information about the Nek5000-users
mailing list