Hello Masahiro,

Thanks for the feedback from your experience of using our latest release of
X10.
As you mentioned, size exceeds Int.MAX_VALUE is not supported in Managed
X10. For users' safety, the runtime checks the size at allocation time and
throws IllegalArgumentException if it doesn't fit in int range. Have you
experienced that mechanism doesn't work?  I added the same note to the
limitations section of the release notes. Thanks.

Mikio Takeuchi
IBM Research - Tokyo



2013/10/30 Masahiro Kasahara <mk...@cb.k.u-tokyo.ac.jp>

> Hi,
>
> X10 ver 2.4.0 claims that arrays are now Long-based so that
> we can exploit large memory. I often use large arrays so I'm
> really happy to see this change.
>
> http://x10-lang.org/software/download-x10/latest-release.html
> > Taken together these two changes enable natural exploitation
> > of large memories via 64-bit addressing and Long-based indexing
> > of arrays and similar data structures.
>
> However, I wonder if it holds true for the Java backend.
> Below is a small example to illustrate the problem.
>
> ===start here
> import x10.util.Random;
>
> public class RandomFill {
>   static N = 1000 * 1000 * 1000 * 8;
>   public static def main(args: Rail[String]) {
>     val arr = new Rail[Long](N);
>     val r = new Random();
>     Console.OUT.println("Filling");
>     for(i in 0..(N - 1))
>       arr(i) = r.nextLong(); // Access to the large array (*)
>   }
> }
> ===end here
>
> Here, N is 8G, so could not be represented in 32 bits. It worked fine
> with the C++ backend. Also I checked the compiled code and everything
> seemed as expected. However, with Java backend, the compiled code
> looked like this (note: I edited it for readability):
>
> final long[] arr$value137 = ((long[])arr.value);
> (snip)
> final long i128 = i131;
> final long t127 = r.nextLong$O();
> arr$value137[(int)i128]=t127;
>
> Here we see that the index of the array is int. I know that JVM does
> not allow large arrays so it could not be fixed without significant
> engineering,
> but I believe it should be indicated somewhere.
>
> --
> Masahiro KASAHARA <mk...@cb.k.u-tokyo.ac.jp>
> Department of Computational Biology,
> Graduate School of Frontier Sciences, University of Tokyo
> CB09, 5-1-5, Kashiwanoha, Kashiwa City, Chiba Pref. 277-8583, JAPAN
> TEL : +81-4-7136-4110  FAX : +81-4-7136-4500
>
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
>
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&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