Hi there,

I have a problem while using (all)reduce. If X10_NPLACES is set to something greater than 1, the code hangs at team.reduce(...). With X10_NPLACES = 1, the program terminates. The same code with a Rail[Long] does execute and terminate as expected (see comments in code). I think the problem is due to the fact that Boolean does not implement Arithmetic. Is this behavior intended? If so, is there a way to get this code snippet to terminate (other than extending Boolean and implementing Arithmetic)?

Tested with the current SVN-version of X10 (Revision 29416), gcc 4.8.4 and Oracle Java 1.8.0 U45.

Thanks and cheers,
Marco   
import x10.util.Team;

public class Main
{
    public static def main(val args:Rail[String]) : void
    {
        val numPlaces:Long = Place.numPlaces();
        val reducer:Rail[Boolean] = new Rail[Boolean](numPlaces);
        // val reducer:Rail[Long] = new Rail[Long](numPlaces);
        val reducerGlobal = new GlobalRef[Rail[Boolean]](reducer);
        // val reducerGlobal = new GlobalRef[Rail[Long]](reducer);
        val alive:PlaceGroup = Place.places().filterDeadPlaces();
        val team:Team = new Team(Place.places());
        Console.OUT.println("Starting");

        val reduction:() => void
            = () =>
              {
                  var rail:Rail[Boolean];
                  // var rail:Rail[Long];

                  if (here == reducerGlobal.home)
                  {
                      rail = (reducerGlobal() as Rail[Boolean]);
                      // rail = (reducerGlobal() as Rail[Long]);
                  }
                  else
                  {
                      rail = new Rail[Boolean](numPlaces);
                      // rail = new Rail[Long](numPlaces);
                  }

                  rail(here.id) = true;
                  // rail(here.id) = 1;
                  Console.OUT.println(here + ": " + rail);

                  team.reduce(reducerGlobal.home
                              , rail
                              , 0
                              , rail
                              , 0
                              , numPlaces
                              , Team.ADD);
              };

        alive.broadcastFlat(reduction);
        Console.OUT.println(reducer);
    }
}
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to