<div dir="ltr">Hey all,<div><br></div><div>This is a slightly long question and I appreciate your patience. I wanted to use a finite difference lookup table as my forcing, specifically 'ffx'. </div><div><br></div><div>For this, I read in the finite difference array from a text file and used a piecewise linear interpolant routine to interpolate onto the SEM grid given by xm1(i,1,1,1) and ym1(i,1,1,1), where i=1,lx1*ly1*lz1*lelt.</div><div><br></div><div>Now, this worked fine in my smaller test domain having 6 elements, calculated in just 1 processor. However, my actual problem size is big, having 252 elements on 48 processors and I am having trouble with parallelization.</div><div><br></div><div>I tried to load the input finite difference forcing onto each mpi rank and then use the interpolation routine by using a previous suggestion by Paul. </div><div><pre style="white-space:pre-wrap"><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><span style="color:rgb(0,0,0);font-size:16px"> </span><font color="#cc0000">subroutine usrdat2</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> include 'SIZE'</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> include 'TOTAL'</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> parameter (my_array_size=10000)</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> real my_array(my_array_size), work(my_array_size)</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> n = my_array_size</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> call rzero(my_array,n)</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> call rzero(work. ,n)</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> if (nid.eq.0) then</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> open (unit=49,file='myfile')</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> read(49,*) (my_array(k),k=1,n)</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> close(49)</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> endif</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> call gop(my_array,work,'+ ',n) ! Sum over all processors</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"><br></font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> return</font></p><p style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Helvetica,sans-serif;white-space:normal"><font color="#cc0000"> end</font></p></pre></div><div><br></div><div><br></div><div><br></div><div>However, I get a bunch of NaN s in the output log. I believe my troubles are related to the parallelization part. Would like to know how to proceed.</div><div><br></div><div>Thanks,</div><div>Saikat</div><div><br></div><div><br clear="all"><div><div class="gmail-m_-7221484209324871414gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="background-color:rgb(255,255,255)"><font color="#444444" face="georgia, serif" size="2">Saikat Mukherjee,</font></span></div><div dir="ltr"><font color="#444444" face="georgia, serif" size="2">PhD Student,</font></div><div dir="ltr"><font color="#444444" face="georgia, serif" size="2">Paul Research Group - <a href="http://www.me.vt.edu/mpaul/" target="_blank">http://www.me.vt.edu/mpaul/</a><br></font><div><span style="background-color:rgb(255,255,255)"><font color="#444444" face="georgia, serif" size="2">Engineering Science and Mechanics,</font></span></div><div><span style="background-color:rgb(255,255,255)"><font color="#444444" face="georgia, serif" size="2">Virginia Tech.</font></span></div></div></div></div></div></div></div></div></div></div>
</div></div>