<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div><br>
</div>
Hi Andrew,
<div><br>
</div>
<div>How you write to the file depends on the underlying structure that you want at output.  I'm</div>
<div>assuming there is no particular order in this case and therefore you also need to write out</div>
<div>the coordinates.  Presumably you've already addressed these questions in your working </div>
<div>serial version.</div>
<div><br>
</div>
<div>Let's assume you have an array with 6 quantities per grid point:   my_data(6,n) and let's assume</div>
<div>that you've already figured out how to write it in serial.</div>
<div><br>
</div>
<div>To do a parallel write, one processor at a time (which actually is a serial write... but it's ok),</div>
<div>you could do the following:</div>
<div><br>
</div>
<div>      real my_data(6,nmax...)</div>
<div><br>
</div>
<div>      do mid=0,np-1  ! march over all processors</div>
<div><br>
</div>
<div>          if (mid.eq.0.and.nid.eq.0) then</div>
<div>             open(unit=50,file='my_file.out')</div>
<div>             write(6,1) ((my_data(k,j),k=1,6),j=1,n)</div>
<div><br>
</div>
<div>          elseif (mid.gt.0.and.mid.eq.0) then</div>
<div>             handshake=1</div>
<div>             len=wdsize</div>
<div>             len4=4</div>
<div>             mtag=777</div>
<div>             call csend(mtag,handshake,len,mid,0) ! send handshake to mid</div>
<div>             call crecv(mtag,n,len4)                        ! get number of incoming words</div>
<div><br>
</div>
<div>
<div>             call csend(mtag,handshake,len,mid,0) ! send handshake to mid</div>
<div>             len = wdsize*n*6</div>
<div>             call crecv(my_data,n,len)                   ! get data from mid</div>
<div>             </div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px"><span style="font-family: Tahoma; font-size: 13px;">             write(6,1) ((my_data(k,j),k=1,6),j=1,n)</span></div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px"><span style="font-family: Tahoma; font-size: 13px;"><br>
</span></div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px"><span style="font-family: Tahoma; font-size: 13px;">        else ! mid > 0</span></div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px"><span style="font-family: Tahoma; font-size: 13px;">             len = wdsize</span></div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px"><span style="font-family: Tahoma; font-size: 13px;">             len4=4</span></div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px"><span style="font-family: Tahoma; font-size: 13px;">             call crecv(mtag,handshake,len)</span></div>
<div><span style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px;">             call c</span>send(mtag,n,len4,0,0)            ! send data size to node 0</div>
<div>             call crecv(mtag,handshake,len)</div>
<div>             len = wdsize*n*6</div>
<div>             call csend(mtag,my_data,len,0,0)</div>
<div><br>
</div>
<div>       endif</div>
<div><br>
</div>
<div>       if (nid.eq.0) close(50)</div>
<div>    1 format(1p6e19.11)</div>
<div><br>
</div>
<div>I've not tested this... but it should be reasonably close to working...</div>
<div><br>
</div>
<div><br>
</div>
<div>Paul</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div style="color: rgb(0, 0, 0);"><br>
</div>
<div style="color: rgb(0, 0, 0);"><br>
</div>
<div style="color: rgb(0, 0, 0);"><br>
<hr tabindex="-1" style="font-family: 'Times New Roman'; font-size: 16px;">
<div id="divRpF371436" style="font-family: 'Times New Roman'; font-size: 16px; direction: ltr;">
<font face="Tahoma" size="2" color="#000000"><b>From:</b> nek5000-users-bounces@lists.mcs.anl.gov [nek5000-users-bounces@lists.mcs.anl.gov] on behalf of nek5000-users@lists.mcs.anl.gov [nek5000-users@lists.mcs.anl.gov]<br>
<b>Sent:</b> Tuesday, July 12, 2016 3:30 AM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> Re: [Nek5000-users] WSS on several processors<br>
</font><br>
</div>
<div style="font-family: 'Times New Roman'; font-size: 16px;"></div>
<div style="font-family: 'Times New Roman'; font-size: 16px;">
<div dir="ltr">
<div>
<div>Hi Paul, <br>
</div>
<br>
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.<br>
<br>
<br>
</div>
Best regards, Andrew<br>
<div>
<pre><br></pre>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-07-11 18:58 GMT+02:00 <span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div><br>
</div>
Hi Andrew,
<div><br>
</div>
<div>torq_calc (which also computes drag as a byproduct) will generate integral quantities over several</div>
<div>objects.</div>
<div><br>
</div>
<div>So, you could have (say) the upper and lower wall as two separate objects, and you can get the</div>
<div>drag on each.   This amounts to 2 vector quantities (3 numbers each:  fx,fy,fz) at each time step</div>
<div>and is written out by node 0.</div>
<div><br>
</div>
<div>It sounds like you are asking for something different, e.g., the wall shear stress as a function of </div>
<div>position --- that requires a bit more sophistication but is certainly accessible.</div>
<div><br>
</div>
<div>What are you looking for?</div>
<div><br>
</div>
<div>Best, Paul</div>
<div><br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b>
<a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.mcs.anl.gov</a> [<a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.mcs.anl.gov</a>] on behalf of
<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a> [<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>]<br>
<b>Sent:</b> Sunday, July 10, 2016 12:39 PM<br>
<b>To:</b> <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a><br>
<b>Subject:</b> [Nek5000-users] WSS on several processors<br>
</font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>
<div dir="ltr">
<div dir="ltr" style="font-size:12.8px">
<div>Hi Neks, </div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>
<div style="color:rgb(80,0,80); font-size:12.8px"><span lang="en">Thank you for any suggestion, <br>
</span></div>
<span lang="en" style="color:rgb(80,0,80); font-size:12.8px">Andrew</span><br>
</div>
</div>
<div style="margin:2px 0px 0px; font-size:12.8px"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov" target="_blank">Nek5000-users@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>