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

Ozik, Jonathan jozik at anl.gov
Tue Sep 23 09:47:16 CDT 2014


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> 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> 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
>>> https://lists.mcs.anl.gov/mailman/listinfo/exm-user
>> 
>> -- 
>> Justin M Wozniak
>> 
> 
> _______________________________________________
> ExM-user mailing list
> ExM-user at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/exm-user



More information about the ExM-user mailing list