[ExM Users] Passing two dimensional numerical arrays to leaf functions

Ozik, Jonathan jozik at anl.gov
Tue Sep 23 15:54:46 CDT 2014


I’m now seeing this error regarding pointer length:

$ turbine test-b-simple.tcl
   0.000 MODE: WORKER
   0.000 MODE: WORKER
   0.000 MODE: SERVER
   0.000 WORKERS: 2 RANKS: 0 - 1
   0.000 SERVERS: 1 RANKS: 2 - 2
   0.001 function:swift:constants
   0.001 function:swift:constants
   0.001 enter function: main
   0.002 allocated u:b=<1> u:v=<2>
   0.002 allocated file: u:data=<3>
   0.003 store: <3>=path input.data
   0.003 blob_read: input.data
valgrind_assert(): failed: src/tcl/blob/blob.c:142
valgrind_assert(): pointer is too long for int!

Jonathan

On Sep 23, 2014, at 11:18 AM, Tim Armstrong <tim.g.armstrong at gmail.com<mailto:tim.g.armstrong at gmail.com>> wrote:

Oops, one additional fix was needed:

-     proc blob_read_body { result input } {
+     proc blob_read_body { result src } {
        set val [ retrieve_decr_file $src ]
-       set input_name [ dict get $val path ]
+       set input_name [ local_file_path $val ]


On Tue, Sep 23, 2014 at 11:08 AM, Ozik, Jonathan <jozik at anl.gov<mailto:jozik at anl.gov>> wrote:
Thanks Tim!


On Sep 23, 2014, at 10:51 AM, Tim Armstrong <tim.g.armstrong at gmail.com<mailto:tim.g.armstrong at gmail.com>> wrote:

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.

-    proc blob_read_body { result input } {
+   proc blob_read_body { result src } {

- Tim

On Tue, Sep 23, 2014 at 9:47 AM, Ozik, Jonathan <jozik at anl.gov<mailto:jozik at anl.gov>> wrote:
I’m attempting the blob example (http://swift-lang.org/Swift-T/leaf.html#_complete_example_3_c_function_with_binary_data) and am seeing this error:

>> turbine test-b-simple.tcl
   0.000 MODE: SERVER
   0.000 MODE: WORKER
   0.000 WORKERS: 2 RANKS: 0 - 1
   0.000 SERVERS: 1 RANKS: 2 - 2
   0.000 MODE: WORKER
   0.001 function:swift:constants
   0.001 function:swift:constants
   0.001 enter function: main
   0.002 allocated u:b=<1> u:v=<2>
   0.002 allocated file: u:data=<3>
   0.002 store: <3>=path input.data
CAUGHT ERROR:
can't read "src": no such variable
    while executing
"retrieve_decr_file $src "
    (procedure "blob_read_body" line 2)
    invoked from within
"blob_read_body 1 {file 3 is_mapped 0}"
Turbine worker task error in: blob_read_body 1 {file 3 is_mapped 0}
    invoked from within
"c::worker_loop $WORK_TYPE(WORK)"
    (procedure "worker" line 28)
    invoked from within
"worker $rules $startup_cmd"
    (procedure "enter_mode_unchecked" line 5)
    invoked from within
"enter_mode_unchecked $rules $startup_cmd"
    (procedure "enter_mode" line 5)
    invoked from within
"enter_mode $rules $startup_cmd "
CALLING adlb::abort
ADLB_Abort(1)
MPI_Abort(1)
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

It appears that this is being triggered by the line:
printf("size(v) = %i", size(v));

Any thoughts on what might be going on?

I’m testing this on a Mac OS X setup.

Jonathan

On Sep 22, 2014, at 10:20 PM, Ozik, Jonathan <jozik at anl.gov<mailto:jozik at anl.gov>> wrote:

> Thank you Justin. That should work great.
>
> Jonathan
>
> On Sep 22, 2014, at 8:05 PM, Justin M Wozniak <wozniak at mcs.anl.gov<mailto:wozniak at mcs.anl.gov>> wrote:
>
>> Hi
>>   You can do this based on the instructions for C binary data:
>>
>> http://swift-lang.org/Swift-T/leaf.html#_complete_example_3_c_function_with_binary_data
>>
>> 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).
>>
>>   Justin
>>
>> On 9/22/2014 6:32 PM, Ozik, Jonathan wrote:
>>> Hello all,
>>>
>>> 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?
>>>
>>> Any thoughts would be appreciated,
>>>
>>> Jonathan
>>>
>>>
>>>
>>> _______________________________________________
>>> ExM-user mailing list
>>> ExM-user at lists.mcs.anl.gov<mailto:ExM-user at lists.mcs.anl.gov>
>>> https://lists.mcs.anl.gov/mailman/listinfo/exm-user
>>
>> --
>> Justin M Wozniak
>>
>
> _______________________________________________
> ExM-user mailing list
> ExM-user at lists.mcs.anl.gov<mailto:ExM-user at lists.mcs.anl.gov>
> https://lists.mcs.anl.gov/mailman/listinfo/exm-user

_______________________________________________
ExM-user mailing list
ExM-user at lists.mcs.anl.gov<mailto:ExM-user at lists.mcs.anl.gov>
https://lists.mcs.anl.gov/mailman/listinfo/exm-user


_______________________________________________
ExM-user mailing list
ExM-user at lists.mcs.anl.gov<mailto:ExM-user at lists.mcs.anl.gov>
https://lists.mcs.anl.gov/mailman/listinfo/exm-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/exm-user/attachments/20140923/b063666c/attachment.html>


More information about the ExM-user mailing list