Saliya Ekanayake <esal...@gmail.com> wrote on 10/29/2012 09:32:10 PM:
>
> Hi Dave,
>
> Again on the KMeans sample. I am little unclear why the following
> two updates in lines 85 and 87 are not done atomically. These
> updates are done by async activities for each point.
>
>                         for (var d:Int=0 ; d<DIM ; ++d) {
>                             local_new_clusters()(closest*DIM+d) += points
(Point.make(p,d));
>                         }
>                         local_cluster_counts()(closest)++;
>

Hi,

        Sorry, this email got lost in my inbox.

        You are correct that this code was wrong; since it is launching an
async per point, not an async per place the updates should be inside an
atomic.  Thanks for reporting the bug....our sample programs really should
be correct!

        Needless to say, this code won't perform very well.  It should be
launching an async per Place and then within the body of the async
iterating over all the points that are mapped to that place.  This both
avoids the need for the atomic and more importantly greatly reduces the
communication & task initiation costs.

        The main purpose of this particular sample was to demonstrate the X10
debugger, so it was intentionally written to create many asyncs....it
shouldn't be used as an example of high performance X10 programming.

--dave
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to