Hello Vijay,

Thank you for your helpful answer.

I profiled the X10 C++ back-end as you suggested, and found that the GC is heavy.

However, I also notice that for both parallel and sequential Fib, as cores used to compute increases,
the time taken by following functions increase.

__lll_lock_wait

_L_lock_102

_L_unlock_56

__lll_unlock_wake


What are they? Are they related to the user-space scheduler?

The result of performance evaluation shows that, computing with 8-core has best performance. With more than 8 cores, it seems that the benefit of multi-cores is trade off by the overhead of lock/unlock.

I attached the Fib program I used to test and one profile result. Please check them out.
I hope the fib program can run with linear scalability. Is it possible?

Thank you very much.

Regards,
-Tetsu

On 07/24/2010 01:56 AM, Vijay Saraswat wrote:
Also, it would be good to see your Fib code, Tetsu.

Again: the main principle is, avoid creating throwaway objects if u want good perf in C++. (Java is much better at dealing with this.)

Olivier Tardieu wrote:
Hi,

With Fib, memory allocation & garbage collection dominate the execution
time.
The runtime creates objects internally for each async in your code.
You probably also create a Fib object for each computation step.

The performance of the JVM GC in this context is much better than the one
of the C++ backend.

You can verify this by profiling the generated binary.
I routinely do this using google performance tools.

Bottom line, the very fine granularity of asyncs in Fib cannot give you
good scalability with the current runtime.
You need to have *enough* sequential computation in each async, e.g.,
compute Fib(n) sequentially for n<=MIN for some constant MIN.

Regards,

Olivier
------------------------------------------------------------------------------
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



import x10.io.Console;

public class Fib {

    var r:int;
    var f:Boolean;

    public def this(x:int, flag:Boolean) {
        r = x;
        f = flag;
    }

    public def run() {
        if (r < 2) return;
    val f1 = new Fib(r-1, f);
        val f2 = new Fib(r-2, f);
if ( r > 12) {
        finish {
            async f1.run();
            f2.run();
        }
} else {
    f1.run();
    f2.run();
}
        r = f1.r + f2.r;
    }

    public static def main(args:Rail[String]!) {
    Console.OUT.println("# places = " + Place.MAX_PLACES); 
        val n = (args.length > 0) ? int.parse(args(0)) : 10;
        val flag = (args.length > 1) ? Boolean.parse(args(1)) : true;
        val f = new Fib(n, flag);
        f.run();
        Console.OUT.println("Fib("+n+") = "+f.r);
    }
}
------------------------------------------------------------------------------
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