Dear List,

   I'd like to add one more question please to the previous ones:

1) in the following code snippet:

finish for(shared var i:int=0; i<numOfPlaces; i++)
        {
           async
          {
             finish temp.copyFrom(0, at(matrixTasks.dist()(i))
{matrixTasks(i).getSubResult()}  ,0,temp.length());
             for(var j:int=0; j<taskDim; j++)
             {
                 atomic result(((i/sqrtPlace)*taskDim)+j) +=temp(j);
             }
          }
        }

the temp Rail is local at place 0, and matrixTasks is divided into unique
places (for example from 0..16 )
so I'm copying the values of the "subResult" Rail from these places to the
temp Rail,
then I sum up into the local "result" Rail but ofcourse I do it atomic,
because each and every element of Result could be
accessed from different places.

Now the result gets wrong when I'm dealing with large numbers of places and
large numbers of DATA, which means that
accessing the array elements is not locked  (when I remove the async)
everything is sequential, thus no contention, and thus the result is right.

so what is wrong? and what is the granularity of the lock (atomic) is it on
the array elements or the whole array?

Thank you all

On Wed, Jul 14, 2010 at 3:30 PM, mohammed elsaeedy <
mohammed.elsae...@kaust.edu.sa> wrote:

> Dear List,
>
>
>     Thank you for your support till now, but I have several questions again
> about communication between processes;
>
> 1) I was trying out something in my code :
>
> vector(0).copyTo(0, matrixTasks(1).getSubVector()  ,0,vector(0).length());
>
> obviously "vector(0)" and "getSubVector()" return a Rail type, so basically
> I'm just trying to copy the data in the rail
> that is resident at vector(0) (at place 0) to the Rail that is resident at
> the SubVector (at place 1) but I get an bad place exception
>
> so when I tried:
> vector(0).copyTo(0, at(Place.place(1)) {matrixTasks(1).getSubVector()}
> ,0,vector(0).length());
>
> it works pretty fine, no bad exceptions, so do I have to specify the place
> of the destination rail? and what happened under the hoods in the
> last code snippet?, because maybe it would be inefficient in terms of
> performance as I dont know whats really happening.
>
> 2) the "ateach" keyword, does it spawn a new activity in every iteration in
> the specified place?
>
> 3) if I were to use the "atomic" keyword, what is its granularity in terms
> of accessing an Array or Rail or whatever, is the whole Array
> locked or the indexed element only locked?
>
> 4) So basically, you told me that I'll have to implement the One-To-All
> broadcast and All-To-One reduction, but doesn't that mean
> that I have to know the structure of the underlying architecture, for
> example if I want to implement a hypercube broadcast I need to
> know which nodes are connected to each other and in which topology to
> implement an efficient broadcast. I don't think that X10
> provides this kind of information (its hidden from the programmer)
>
> Example:
>
> A--B--C
> |        |
> D--E--F
>
> so If I want to broadcast from A to all it could go on like this
>
> 1) A to F
> 2) A to D and F to C
> 3) C to B and D to E
>
>  so basically these nodes represent Places that I don't know how they are
> interconnected, because its hidden.
>
> to recap, my question is how to implement broadcast and reduction in X10
> efficiently??
>
>
> Thank you all,
> Regards,
> Mohammed, KAUST and TUM
>
>
>
> On Wed, Jul 14, 2010 at 1:17 PM, David P Grove <gro...@us.ibm.com> wrote:
>
>>
>>
>>
>> mohammed elsaeedy <mohammed.elsae...@kaust.edu.sa> wrote on 07/13/2010
>> 11:33:40 AM:
>>
>> >
>> > Thank you David and Igor for the clarifications, so that was for BG, but
>> > what if I want to deploy over a traditional cluster,
>> > how can I do that?
>> >
>>
>> Sorry, missed that part of the question.  If you want to deploy over a
>> traditional cluster, compile using x10c++.  You can then use your
>> cluster's
>> job management tool (loadleveler, mpirun, etc) to execute the resulting
>> executable over the cluster as if it were a mpi program.  For what it's
>> worth, I've used LoadLeveler on shaheenx to run X10 programs successfully
>> a
>> few months ago.  I've appended the config file I used for that for
>> reference (this was several months ago, so it might be out of date, but I
>> think the same ideas should still work).
>>
>> --dave
>>
>> #!/bin/sh
>> #
>> # @ account_no = <your account here>
>> # @ job_name = NQueensDistx10
>> # @ job_type = mpich
>> # @ output = $(job_name).out
>> # @ error = $(job_name).err
>> # @ environment = COPY_ALL;
>> # @ wall_clock_limit = 00:05:00
>> # @ notification = never
>> # @ node = 16
>> # @ tasks_per_node = 1
>> # @ class = default
>> # @ queue
>>
>> cd $HOME/x10-trunk/x10.dist/samples
>> echo "BOOTING"
>> mpdboot -f $LOADL_HOSTFILE
>> echo "LAUNCHING"
>> mpiexec -np 16 ./NQueensDist.mpi 12
>> echo "DONE"
>> mpdallexit
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> X10-users mailing list
>> X10-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/x10-users
>>
>
>
>
> --
> Thank you for your concern.
> Regards,
> Mohammed El Sayed
>



-- 
Thank you for your concern.
Regards,
Mohammed El Sayed
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to