<div dir="ltr">Thanks, I missed that usage of it.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 3:28 PM, Ozik, Jonathan <span dir="ltr"><<a href="mailto:jozik@anl.gov" target="_blank">jozik@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 style="word-wrap:break-word">
It looks like line 542 in files.tcl calls blobutils_cast_to_int so I replaced that with blobutils_cast_to_long and it seems to work.
<span class="HOEnZb"><font color="#888888"><div><br>
</div>
<div>Jonathan</div></font></span><div><div class="h5">
<div><br>
<div>
<div>On Sep 24, 2014, at 3:07 PM, Ozik, Jonathan <<a href="mailto:jozik@anl.gov" target="_blank">jozik@anl.gov</a>> wrote:</div>
<br>
<blockquote type="cite">
<div style="word-wrap:break-word">
I believe I’ve applied the patches but it appears that the blobutils_cast_to_int is still being called with the same error resulting:
<div>$ turbine test-b-simple.tcl <br>
   0.000 MODE: SERVER<br>
   0.000 MODE: WORKER<br>
   0.000 MODE: WORKER<br>
   0.000 WORKERS: 2 RANKS: 0 - 1<br>
   0.000 SERVERS: 1 RANKS: 2 - 2<br>
   0.001 function:swift:constants<br>
   0.001 function:swift:constants<br>
   0.001 enter function: main<br>
   0.001 allocated u:b=<1> u:v=<2><br>
   0.001 allocated file: u:data=<3><br>
   0.001 store: <3>=path input.data<br>
   0.010 blob_read: input.data<br>
valgrind_assert(): failed: src/tcl/blob/blob.c:142<br>
valgrind_assert(): pointer is too long for int!<br>
<br>
===================================================================================<br>
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES<br>
=   PID 69379 RUNNING AT <a href="http://nsit-dhcp-250-217.uchicago.edu/" target="_blank">nsit-dhcp-250-217.uchicago.edu</a><br>
=   EXIT CODE: 6<br>
=   CLEANING UP REMAINING PROCESSES<br>
=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES<br>
===================================================================================<br>
<br>
FYI, this is by running the blob example (test-b-swift.tcl).</div>
<div><br>
</div>
<div>Jonathan</div>
<div><br>
<div>
<div>On Sep 24, 2014, at 2:41 PM, Tim Armstrong <<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>> wrote:</div>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>Sorry, I should've checked that it applied cleanly. The change in the patch is ok, it just didn't have the right context to apply.  These are the lines that needed to be added to blob.h<br>
<br>
<br>
+/** DOCD(blobutils_cast_long_to_int_ptr i, +long+ to +int*+.) */<br>
+      int*    blobutils_cast_long_to_int_ptr      (long l);<br>
+/** DOCD(blobutils_cast_long_to_const_int_ptr i, +long+ to +const int*+.) */<br>
+const int*    blobutils_cast_long_to_const_int_ptr(long l);<br>
+/** DOCD(blobutils_cast_long_to_dbl_ptr i, +long+ to +double*+.) */<br>
+      double* blobutils_cast_long_to_dbl_ptr      (long l);<br>
+/** DOCD(blobutils_cast_long_to_const_dbl_ptr i, +long+ to +const double*+.) */<br>
+const double* blobutils_cast_long_to_const_dbl_ptr(long l);<br>
<br>
You shouldn't need any additional patches.  An updated patch that includes all the fixes is attached.<br>
<br>
</div>
<div>- Tim<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Sep 24, 2014 at 2:00 PM, Ozik, Jonathan <span dir="ltr">
<<a href="mailto:jozik@anl.gov" target="_blank">jozik@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word">Thanks Tim.
<div>It looks like my blob.h file is a little shorter than yours. So I got a patching failure:</div>
<div>$ patch -p 5 < ~/Downloads/turbine-0.5.1-pointer-fix.patch <br>
patching file lib/blob.tcl<br>
patching file src/tcl/blob/blob.c<br>
patching file src/tcl/blob/blob.h<br>
Hunk #1 FAILED at 184.<br>
1 out of 1 hunk FAILED -- saving rejects to file src/tcl/blob/blob.h.rej</div>
<div><br>
</div>
<div>I haven’t modified blob.h from the 0.6.1 version, so maybe there are more patches that I should apply?</div>
<div><br>
</div>
<div>Jonathan</div>
<div><br>
<div>
<div>
<div>
<div>On Sep 24, 2014, at 1:49 PM, Tim Armstrong <<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>> wrote:</div>
<br>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">
<div>Hi Jonathan,<br>
</div>
<div>  This looks like another bug that hadn't manifested in our tests.  I've got a fix for it and am in the process of putting together a new release.  In the meantime, you can patch the source if needed with the attached patch.<br>
<br>
</div>
cd turbine<br>
<div>patch -p 5 < turbine-0.5.1-pointer-fix.patch<br>
<br>
</div>
<div>- Tim<br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Sep 23, 2014 at 3:54 PM, Ozik, Jonathan <span dir="ltr">
<<a href="mailto:jozik@anl.gov" target="_blank">jozik@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word">I’m now seeing this error regarding pointer length:
<div><br>
</div>
<div>$ turbine test-b-simple.tcl<br>
   0.000 MODE: WORKER<br>
   0.000 MODE: WORKER<br>
   0.000 MODE: SERVER<span><br>
   0.000 WORKERS: 2 RANKS: 0 - 1<br>
   0.000 SERVERS: 1 RANKS: 2 - 2<br>
</span><span>   0.001 function:swift:constants<br>
   0.001 function:swift:constants<br>
   0.001 enter function: main<br>
   0.002 allocated u:b=<1> u:v=<2><br>
   0.002 allocated file: u:data=<3><br>
</span>   0.003 store: <3>=path input.data<br>
   0.003 blob_read: input.data<br>
valgrind_assert(): failed: src/tcl/blob/blob.c:142<br>
valgrind_assert(): pointer is too long for int!</div>
<span><font color="#888888">
<div><br>
</div>
<div>Jonathan</div>
</font></span>
<div>
<div>
<div><br>
<div>
<div>On Sep 23, 2014, at 11:18 AM, Tim Armstrong <<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>> wrote:</div>
<br>
<blockquote type="cite">
<div dir="ltr">Oops, one additional fix was needed:<br>
<br>
-     proc blob_read_body { result input } {<br>
+     proc blob_read_body { result src } {<br>
        set val [ retrieve_decr_file $src ]<br>
-       set input_name [ dict get $val path ]<br>
+       set input_name [ local_file_path $val ]<br>
<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Sep 23, 2014 at 11:08 AM, Ozik, Jonathan <span dir="ltr">
<<a href="mailto:jozik@anl.gov" target="_blank">jozik@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto">
<div>Thanks Tim!<br>
<br>
</div>
<div>
<div>
<div><br>
On Sep 23, 2014, at 10:51 AM, Tim Armstrong <<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div>There's a bug in one of our library functions.  Thanks for reporting.  I've fixed it in the repository so it'll get into the next point release. If you want to quickly patch your version as a workaround, you can edit line 535 of turbine/lib/files.tcl in
 the Swift/T source as below, then run "make install" to install the fixed version of the file.<br>
<br>
-    proc blob_read_body { result input } {<br>
+   proc blob_read_body { result src } {<br>
 <br>
</div>
- Tim<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Sep 23, 2014 at 9:47 AM, Ozik, Jonathan <span dir="ltr">
<<a href="mailto:jozik@anl.gov" target="_blank">jozik@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I’m attempting the blob example (<a href="http://swift-lang.org/Swift-T/leaf.html#_complete_example_3_c_function_with_binary_data" target="_blank">http://swift-lang.org/Swift-T/leaf.html#_complete_example_3_c_function_with_binary_data</a>) and am seeing this
 error:<br>
<br>
>> turbine test-b-simple.tcl<br>
   0.000 MODE: SERVER<br>
   0.000 MODE: WORKER<br>
   0.000 WORKERS: 2 RANKS: 0 - 1<br>
   0.000 SERVERS: 1 RANKS: 2 - 2<br>
   0.000 MODE: WORKER<br>
   0.001 function:swift:constants<br>
   0.001 function:swift:constants<br>
   0.001 enter function: main<br>
   0.002 allocated u:b=<1> u:v=<2><br>
   0.002 allocated file: u:data=<3><br>
   0.002 store: <3>=path input.data<br>
CAUGHT ERROR:<br>
can't read "src": no such variable<br>
    while executing<br>
"retrieve_decr_file $src "<br>
    (procedure "blob_read_body" line 2)<br>
    invoked from within<br>
"blob_read_body 1 {file 3 is_mapped 0}"<br>
Turbine worker task error in: blob_read_body 1 {file 3 is_mapped 0}<br>
    invoked from within<br>
"c::worker_loop $WORK_TYPE(WORK)"<br>
    (procedure "worker" line 28)<br>
    invoked from within<br>
"worker $rules $startup_cmd"<br>
    (procedure "enter_mode_unchecked" line 5)<br>
    invoked from within<br>
"enter_mode_unchecked $rules $startup_cmd"<br>
    (procedure "enter_mode" line 5)<br>
    invoked from within<br>
"enter_mode $rules $startup_cmd "<br>
CALLING adlb::abort<br>
ADLB_Abort(1)<br>
MPI_Abort(1)<br>
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0<br>
<br>
It appears that this is being triggered by the line:<br>
printf("size(v) = %i", size(v));<br>
<br>
Any thoughts on what might be going on?<br>
<br>
I’m testing this on a Mac OS X setup.<br>
<span><font color="#888888"><br>
Jonathan<br>
</font></span>
<div>
<div><br>
On Sep 22, 2014, at 10:20 PM, Ozik, Jonathan <<a href="mailto:jozik@anl.gov" target="_blank">jozik@anl.gov</a>> wrote:<br>
<br>
> Thank you Justin. That should work great.<br>
><br>
> Jonathan<br>
><br>
> On Sep 22, 2014, at 8:05 PM, Justin M Wozniak <<a href="mailto:wozniak@mcs.anl.gov" target="_blank">wozniak@mcs.anl.gov</a>> wrote:<br>
><br>
>> Hi<br>
>>   You can do this based on the instructions for C binary data:<br>
>><br>
>> <a href="http://swift-lang.org/Swift-T/leaf.html#_complete_example_3_c_function_with_binary_data" target="_blank">
http://swift-lang.org/Swift-T/leaf.html#_complete_example_3_c_function_with_binary_data</a><br>
>><br>
>> The Swift blob is a void* - you can cast to whatever you want.  You can cast it to a double* that is actually a 2D array (following BLAS conventions).<br>
>><br>
>>   Justin<br>
>><br>
>> On 9/22/2014 6:32 PM, Ozik, Jonathan wrote:<br>
>>> Hello all,<br>
>>><br>
>>> I’m curious about how people generally go about passing (and returning) two (or n-) dimensional arrays to leaf functions. Are there simple examples using SWIG and Tcl? Or are file based approaches used via app fuctions?<br>
>>><br>
>>> Any thoughts would be appreciated,<br>
>>><br>
>>> Jonathan<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<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>
>> --<br>
>> Justin M Wozniak<br>
>><br>
><br>
> _______________________________________________<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>
_______________________________________________<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>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
_______________________________________________<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>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
<span><turbine-0.5.1-pointer-fix.patch></span></blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<span><turbine-0.5.1-pointer-fix-v2.patch></span></blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<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>
</blockquote>
</div>
<br>
</div>
</div></div></div>

</blockquote></div><br></div>