<div dir="ltr">Yes, the arrays are just nested arrays, so this works: pickle[outer]<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 3:47 PM, Ketan Maheshwari <span dir="ltr"><<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Tim. That makes sense. One more question:<div><br></div><div>Is it possible to consume the resulting 2D array in an outer loop of a nested loop such that for each outer dimension all elements of inner dimension are passed to a function. eg:</div>
<div><br></div><div>foreach outer in outerlist{</div><div> foreach inner in innerlist{</div><div> pickle[outer][inner] = producearray(args);</div><div> }</div><div> dumpedout[outer] = consume(pickle[outer][*]);</div>
<div>}</div><div><br></div><div>So, the synchronization is partial here: as soon as a round of inner loop is done the result can be used by consume.</div><div><br></div><div>Thanks,</div><div>Ketan</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div class="">On Thu, Jun 26, 2014 at 3:04 PM, Tim Armstrong <span dir="ltr"><<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="">
<div dir="ltr">
<div>Yes 2D arrays are supported with the same declaration syntax as Swift/K. You're trying to declare a 2D array with key types i and j in each loop iteration. The compiler is correctly pointing out that i isn't a type. You need to declare it outside of
the loops then assign it inside the loops.<br>
<br>
</div>
- Tim<br>
</div>
</div><div class="gmail_extra"><br>
<br>
<div class="gmail_quote"><div class=""><div><div>On Thu, Jun 26, 2014 at 2:44 PM, Ketan Maheshwari <span dir="ltr">
<<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
</div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div><div>
<div dir="ltr">Are 2D arrays of this style supported in T:
<div><br>
</div>
<div>
<div>main {</div>
<div>foreach i in [0:31]{</div>
<div> /*string commands[] = ["head","tail","wc","stat"];*/</div>
<div> foreach j in [0:24]{</div>
<div> string pyline=sprintf("import cPickle as pickle\n\nrepr(pickle.dumps({'foo1':%s,'foo2':%s}))", i, j);</div>
<div> string pickle[i][j] = python(pyline);</div>
<div> }</div>
<div>}</div>
<div>}</div>
</div>
<div><br>
</div>
<div>stc gives following error:</div>
<div><br>
</div>
<div>
<div>stc error:</div>
<div>multi-map-reduce.swift:15:3: The following type was not defined in the current context: j</div>
</div>
</div>
<br></div></div></div></div><div class="">
_______________________________________________<br>
ExM-user mailing list<br>
<a href="mailto:ExM-user@lists.mcs.anl.gov" target="_blank">ExM-user@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/exm-user" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/exm-user</a><br>
<br>
</div></blockquote>
</div>
<br>
</div>
</div>
</blockquote></div><br></div>
</blockquote></div><br></div>