El Viernes, 24 de enero de 2014 06:43:26 Aroon Sharma escribió:
> Hi everyone,
> 
> In reference to Rafael's proposed method of dynamically splitting up a
> communication call into multiple ones:
> 
> Just use a variable, for example, to use another offset at the source you
> can  use:
> 
>         var origin=100:int;
>         var lmin=5:int;
> 
> __primitive("array_get", src,
> arrSection.myElems._value.getUnshiftedDataIndex(origin-lmin)),
> 
> Then you can change the values of origin and lmin in different loops.
> 
> Also remember that in the first line you must also use the Unshifted version
> of  getdataindex :
> __primitive("array_get", dest, buf._value.getUnshiftedDataIndex(1)),
> 
> 
> How would this be extended if the block of data to be sent in a message was
> multidimensional? The method above seems to work fine for one dimensional
> blocks of data, but not for multidimensional. For example, if I wanted to
> communicate a 6 x 6 block into 2 6 x 3 blocks, my understanding would be to
> modify the "copy length" parameter to accommodate a 6 x 3 block. The
> "offset" for the second 6 x 3 block now would be 3*srcStride[1], where
> srcStride[1] is the distance in memory between two successive rows of the 6
> x 6 block. Does this method make sense? I have implemented this extension
> this way and I see that my program crashes when attempting to communicate
> memory from the second block, which leads me to believe that I have chosen
> an incorrect pointer to the second 6 x 3 block.

I think you are mixing number of elements with bytes, but this conversion is 
done internally, so you don't need to worry about bytes.

So you only need to multiply 3*6 to obtain the adress of the second subarray.

You can initialize the array to some given values, and then request to copy 
only one element, and check that it is the one it should. 
It is more difficult that your program crashes, as you are accessing only one 
element.

Also using verbosecomm perhaps can help, as it gives a lot of internal 
information.

Greets,

Rafael

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to