Hi Masahiro,

This is interesting. Let me consider how we can support long rails with
managed X10.

Thanks,
-- Mikio



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

> Hi, Mikio,
>
> Thank you for the rapid reply. My colleague wrote LArray
> (https://github.com/xerial/larray) for avoiding the limitation of JVM,
> and I wonder if a similar approach can be integrated into the
> compiler. Since we do not (cannot) usually create dozens of such large
> arrays, I think something like LongRail[T] (T is a non-reference type)
> that will be translated into a call to a wrapper to LArray (or
> equivalent) would be very useful; it can be replaced with Rail[T] when
> translated to C++. Anyway, it is just a "nice-to-have" feature and I
> am really happy with the new version.
>
> BTW, I haven't actually tried a large array on Managed X10 because it
> didn't work on my environment although the previous version worked.
> The compiler worked, but when I tried to run it, I saw the error
> message shown below, but I do not often use Managed X10 nor Java so it
> is quite likely that this is just a problem of my Java configuration
> so I didn't report it.
>
> > ~/work/x10% x10 RandomFill
> Error: Cannot load main class for RandomFill with classpath
>
> .:/opt/x10/stdlib/x10.jar:/opt/x10/lib/commons-math3-3.2.jar:/opt/x10/lib/commons-logging-1.1.3.jar
>
> --
> 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
>
>
> On Wed, Oct 30, 2013 at 5:41 PM, Mikio Takeuchi
> <mikio.takeu...@gmail.com> wrote:
> > 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
> >
>
>
> ------------------------------------------------------------------------------
> 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