<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi Jonathan,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
What I'd do in this case is map every file under the directory you want to send to the compute nodes, into an array and pass </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">that along to your apps. You can do this mapping using either ext mapper or array mappers.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I have the following dir structure in my folders:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">./dirs/foo_a/foo_a.txt</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">./dirs/foo_a/foo_b.txt</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
./dirs/foo_b/bar_1</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">./dirs/foo_b/bar_2</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
Here's my ext mapper (mapper.sh) :</div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default">#!/bin/bash</div><div class="gmail_default">find ./dirs -type f | awk '{printf("[%d] %s\n", NR, $0)}'</div>
</div><div class="gmail_default"><br></div><div class="gmail_default">If you are using ext mappers, you would need a script which generates output in the form [<index>] <filename></div><div class="gmail_default">
Here I use find to just output files and awk to get the right format. </div><div class="gmail_default"><br></div><div class="gmail_default">The swift mapping would be like this:</div><div class="gmail_default">file array[] <ext ; exec="mapper.sh" >;</div>
<div class="gmail_default"><br></div><div class="gmail_default">You could also use array mappers to read all files you need from a file containing the filenames. I filled filenames.txt with </div><div class="gmail_default">
the names of all files in the folders. </div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">string[] names = readData("filenames.txt");</div><div class="gmail_default">
file dirmap[] <array_mapper; files=names>;</div><div><br></div></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I've got both cases as examples tarballed here if you'd like to take a look : <a href="http://swift.rcc.uchicago.edu:8042/directory_mapping.tar">http://swift.rcc.uchicago.edu:8042/directory_mapping.tar</a><br>
</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
Yadu </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 1, 2014 at 8:56 AM, Jonathan Ozik <span dir="ltr"><<a href="mailto:jozik@uchicago.edu" target="_blank">jozik@uchicago.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello all,<br>
<br>
Is there a simple way to specify "all files including files in subfolders within a folder" as a file mapper? It looks like the filesys_mapper does get everything within a folder, but has problems if there's a folder in there.<br>
<br>
Jonathan<br>
<br>
_______________________________________________<br>
Swift-user mailing list<br>
<a href="mailto:Swift-user@ci.uchicago.edu">Swift-user@ci.uchicago.edu</a><br>
<a href="https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user" target="_blank">https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Yadu Nand B<div><br></div></div>
</div></div>