Hello!

Publication "Communication Optimizations for Distributed-Memory X10 Programs"
provides description "Scalar Replacement with Loop-Invariant Code Motion".
The code below shows "Scalar Replacement with Loop-Invariant Code Motion":

---------------------------------------------------------------------------------------------
    1 Scalar Replacement with Loop-Invariant Code Motion

    class T ...
    ...
    val A = Rail.make[T](r);
//  region r is a subset of region R
    for(point i in R) {
        val idx = f(i) % Places.MAX_PLACE;
        async (Place.places(idx)) g(A(idx));
    }
---------------------------------------------------------------------------------------------
(Code is inserted from publication "Communication Optimizations for Distributed-Memory X10 Programs")

I wrote sample like above code, it is not optimized:
---------------------------------------------------------------------------------------------
import x10.regionarray.*;

class HelloWorld {

  public static def func(x:Long) {
    var sum:Long = x;
  }
  public static def main(Rail[String]) {
    val r = Region.make(0..3999);
    val A = new Rail[Long](r.size(), here.id);

//    var start : Long = System.nanoTime();
//    finish {
      for (i:Point in r) {
        val idx = i(0) % Place.MAX_PLACES;
        at (Place.place(idx)) async func(A(idx));
      }
//    }
//    var stop : Long = System.nanoTime();
// Console.OUT.printf("Size of Rail %d: %g ms\n", r.size(), ((stop-start) as Double) / 1e6);
  }
}
---------------------------------------------------------------------------------------------
When i compile this program with option "OPTIMIZE_COMMUNICATIONS=true", "Scalar Replacement with Loop-Invariant Code Motion" was not apply.

Could you answer to me, why didn't apply "Scalar Replacement with Loop-Invariant Code Motion"?

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to