<div dir="ltr"><div>This is often called  &#39;task prallelism&#39; or  &#39;embarrasingly parallel&#39;.<br></div><div>From the WWW: &quot;A problem that is obviously decomposable into many identical but separate subtasks is called &#39;embarrasingly parallel.&#39;<br><br>==<br></div><div>There is tool developed within our section called the CVDP (Climate Variability Diagnostics Processor). NCL is used to perform shell scripting type tasks and to do the diagnostics which include EOFs, assorted indices, etc, netCDF creation and graphics for 100+ ensemble  members. It can take 3+days to run in serial mode. Each ensemble run is independent of all other ensemble runs. <br><br></div><div>I talked with a software engineer within NCAR&#39;s computing division and she proposed a python approach. She called it &#39;python light&#39;. Here is a crude prototype of what it might look like. It uses NCL&#39;s &#39;command line arguments&#39;.<br><br>=====<br>#!/usr/bin/env python<br><br>import parUtils as par<br>from mpi4py import MPI <br>import os<br><br></div><div># the following is an ascii (text) file which contains the names of<br></div><div># ensembles members to process and the periods<br></div><div>namelist_fn = &#39;namelist.CESMcomparison&#39;<br><br># open the namelist file and store it in a file pointer variable<br></div><div># think of this as NCL&#39;s asciiread. Each line is a different ensemble member<br></div><div>namelist_fp = open(namelist_fn,&quot;r&quot;)<br><br># read the file and split the lines into an array<br></div><div># think of this as NCL&#39;s str_get_field<br></div><div>nl_lines = namelist_fp.read().splitlines()<br><br># partition the lines up between the mpi tasks<br>local_nl_lines = par.Partition(nl_lines)<br><br># for each line in the orig nl file that this task is responsible for,<br># parse the line and call ncl with the variables<br><br>for line in local_nl_lines:<br>  #split line at &quot;|&quot;<br>  name,location,start,stop = line.split(&quot;|&quot;)<br>  os.system(&quot;ncl &#39;name=\&quot;&quot;+name+&quot;\&quot;&#39; &#39;location=\&quot;&quot;+location+&quot;\&quot;&#39; &#39;start=\&quot;&quot;+start+&quot;\&quot;&#39; &#39;stop=\&quot;&quot;+stop+&quot;\&quot;&#39; CVDP.ncl&quot;)<br><br># Wait for all procs to get to this point<br>par.Sync()<br><br>=======<br></div><div><br></div><div>The advantage is that  python  does the book keeping.<br><br>=======<br><br><br></div><div>Nothing much has gone beyond the above. I am just too busy to focus on this right now.<br><br></div><div>D<br></div><div><br></div><div><br></div><div><br></div><table><tbody></tbody></table></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 12:29 PM, jbuzan <span dir="ltr">&lt;<a href="mailto:jbuzan@purdue.edu" target="_blank">jbuzan@purdue.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Yes, I agree.  I recommend using shell scripts that feed NCL the specifics.  For example, I have scripts that will submit 100s of ncl routines that are executed on individual processors on a cluster.  This aides you in a couple of ways: 1) you have short NCL scripts, which reduce programming time, 2) they are less likely to have errors script errors, and 3) you speed up your throughput dramatically.<div><br></div><div>-Jonathan</div><div><div class="h5"><div><br></div><div><br><div><div>On Oct 13, 2014, at 2:22 PM, Colin Zarzycki &lt;<a href="mailto:zarzycki@umich.edu" target="_blank">zarzycki@umich.edu</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr">It&#39;s worth pointing out that for some applications, you can write shell scripts which can pseudo-parallelize NCL by running multiple instances (which are in serial) alongside one another.<div><br></div><div>Ex: If you have a high-resolution file which contains 20 time records and you would like to use NCL to calculate vorticity from U/V for each of the 20 time records, you could spawn 20 instances of NCL which each operate on 1 of the time records. Then concatenate the output in serial after each of the 20 jobs finishes. This will be much faster than reading the entire dataset into a single instance of NCL.</div><div><br></div><div>I have found this technique highly useful when processing very large datasets (or large numbers of files).</div><div><br></div><div>-Colin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 12, 2014 at 9:29 PM, 杨玉华 <span dir="ltr">&lt;<a href="mailto:yangyh@mail.typhoon.gov.cn" target="_blank">yangyh@mail.typhoon.gov.cn</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>






<div>
<div><div align="left">Dear Kyle Griffin,
<p>Thanks for your great information.</p><p>Yuhua</p><div> <br></div><div> <br></div><strong>您于 Sun, 12 Oct 2014 22:03:49 -0500 的来信中写到: </strong><br><br></div><div><div>


<div>
<div dir="ltr">There is the ParVis project, based on being able to run a select few (but crucial) functions from NCL on multiple processors: 
<div><br></div>
<div><a href="http://trac.mcs.anl.gov/projects/parvis/wiki" target="_blank">http://trac.mcs.anl.gov/projects/parvis/wiki</a><br></div>
<div><br></div>
<div>Unfortunately, the only binaries provided are for system types not widely used in the atmospheric science community (as far as I&#39;m aware) and the build instructions aren&#39;t particularly detailed. As such, I&#39;ve never gotten the ncl included in the ParVis project to work. There is a separate mailing list for the discussion, should you have any problems and/or success with the software. Beyond this, though, I&#39;m not aware of any other efforts to parallelize NCL.</div>
<div><br></div>
<div><br></div>
<div>Kyle</div></div>
<div class="gmail_extra"><br clear="all">
<div>
<div dir="ltr">---------------------------------------- 
<div>Kyle S. Griffin</div>
<div>Department of Atmospheric and Oceanic Sciences</div>
<div>University of Wisconsin - Madison</div>
<div>Room 1421</div>
<div>1225 W Dayton St, Madison, WI 53706</div>
<div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div><br>
<div class="gmail_quote">2014-10-12 21:56 GMT-05:00 杨玉华 <span dir="ltr">&lt;<a href="mailto:yangyh@mail.typhoon.gov.cn" target="_blank">yangyh@mail.typhoon.gov.cn</a>&gt;</span>:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><u></u>
<div>
<div><div style="margin:0cm 0cm 0pt"><span lang="EN-US"><font face="Calibri" size="3">Hi all,</font></span></div><div style="margin:0cm 0cm 0pt"><span lang="EN-US"><font face="Calibri" size="3">Is there a way to run NCL on multiple processors?</font></span></div><div style="margin:0cm 0cm 0pt"><span lang="EN-US"><font face="Calibri" size="3">Thanks,</font></span></div><div style="margin:0cm 0cm 0pt"><span lang="EN-US"><font face="Calibri" size="3">Yuhua</font></span></div></div><br>===================== <br>名称: 中国气象局上海台风研究所 <br>地址: 中国上海市徐汇区蒲西路166号 <br>电话:<a href="tel:%EF%BC%88%EF%BC%8B86%EF%BC%89021-64391966" value="+862164391966" target="_blank">(+86)021-64391966</a> <br>传真:<a href="tel:%EF%BC%88%EF%BC%8B86%EF%BC%89021-64391966" value="+862164391966" target="_blank">(+86)021-64391966</a> <br>============================ </div><br>_______________________________________________<br>ncl-talk mailing list<br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br><br></blockquote></div><br></div></div></div></div></div><div><div>
<br>
=====================
<br>
名称: 中国气象局上海台风研究所
<br>
地址: 中国上海市徐汇区蒲西路166号
<br>
电话:<a href="tel:%EF%BC%88%EF%BC%8B86%EF%BC%89021-64391966" value="+862164391966" target="_blank">(+86)021-64391966</a>
<br>
传真:<a href="tel:%EF%BC%88%EF%BC%8B86%EF%BC%89021-64391966" value="+862164391966" target="_blank">(+86)021-64391966</a>
<br>
============================
</div></div></div>

<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br clear="all"><div><br></div>-- <br></a><div dir="ltr"><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank"><div dir="ltr" style="font-family:arial;font-size:small">Colin M. Zarzycki, ASP postdoctoral fellow</div></a><div dir="ltr" style="font-family:arial;font-size:small"><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">Atmospheric Modeling and Predictability<br>National Center for Atmospheric Research<br></a><a href="http://www.colinzarzycki.com/" style="color:rgb(17,85,204)" target="_blank">http://www.colinzarzycki.com</a></div></div>
</blockquote></div></div>
_______________________________________________<br>ncl-talk mailing list<br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>