On Monday 07 June 2010, Igor Peshansky wrote: > So, since reduce() expects a function with type (T,T)=>T, your closure > must have the type > "(Array[Double](1),Array[Double](1))=>Array[Double](1)". > Maybe that will placate the typechecker. > Igor >
Heureka ! The following closure compiles. v = v_dst.reduce( (x:Array[Double]{rank==1}, y:Array[Double]{rank==1}) =>ArrayD_add(x as Array[Double]{rail}, y as Array[Double]{rail&®ion==x.region}) as Array[Double]{rank==1}, v); But running this code, I am getting the error message below. Presumably my type casts are too bold. I am currently simplifying the code (which also should simplify the above closure). Nevertheless, is this supposed to work ? Should I file a bug for this ? <stderr rank="0">Uncaught exception at place 0: x10.lang.MultipleExceptions</stderr> <stderr rank="0">x10.lang.ClassCastException: x10.array.Array[x10.lang.Double] {self.region==x.region, x.region.rank==1, x.region.rect==true, x.region.zeroBased==true}</stderr> <stderr rank="0"> at x10::lang::Throwable::fillInStackTrace()</stderr> <stderr rank="0"> at x10aux::throwException(x10aux::ref<x10::lang::Throwable>)</stderr> <stderr rank="0"> at matmul__closure__15::apply(x10aux::ref<x10::array::Array<double> >, x10aux::ref<x10::array::Array<double> >)</stderr> <stderr rank="0"> at x10_array_DistArray__closure__15<x10aux::ref<x10::array::Array<double> > >::apply()</stderr> <stderr rank="0"> at x10_lang_Runtime__closure__11<x10aux::ref<x10::array::Array<double> > >::apply()</stderr> <stderr rank="0"> at x10::lang::Activity::run()</stderr> <stderr rank="0"> at x10_lang_Runtime__Worker__closure__0::apply()</stderr> <stderr rank="0"> at x10::lang::Runtime::runAtLocal(int, x10aux::ref<x10::lang::VoidFun_0_0>)</stderr> <stderr rank="0"> at x10::lang::Runtime__Worker::loop(x10aux::ref<x10::lang::Runtime__Latch>, bool)</stderr> <stderr rank="0"> at x10::lang::Runtime__Worker::join(x10aux::ref<x10::lang::Runtime__Latch>)</stderr> <stderr rank="0"> at x10aux::ref<x10::array::Array<double> > x10::lang::Runtime::evalAt<x10aux::ref<x10::array::Array<double> > >(x10::lang::Place, x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<double> > > >)</stderr> <stderr rank="0"> at x10_array_DistArray__closure__14<x10aux::ref<x10::array::Array<double> > >::apply()</stderr> <stderr rank="0"> at x10::lang::Activity::run()</stderr> <stderr rank="0"> at x10_lang_Runtime__Worker__closure__0::apply()</stderr> <stderr rank="0"> at x10::lang::Runtime::runAtLocal(int, x10aux::ref<x10::lang::VoidFun_0_0>)</stderr> <stderr rank="0"> at x10::lang::Runtime__Worker::loop(x10aux::ref<x10::lang::Runtime__Latch>, bool)</stderr> <stderr rank="0"> at x10::lang::Runtime__Worker::apply()</stderr> <stderr rank="0"> at x10_lang_Runtime__Pool__closure__0::apply()</stderr> <stderr rank="0"> at x10::lang::Thread::thread_start_routine(void*)</stderr> <stderr rank="0"> at GC_inner_start_routine</stderr> <stderr rank="0"> at GC_call_with_stack_base</stderr> <stderr rank="0"> at GC_start_routine</stderr> <stderr rank="0"> at /lib/tls/i686/cmov/libpthread.so.0 [0xbc980e]</stderr> <stderr rank="0"> at clone</stderr> <stderr rank="0">x10.lang.ClassCastException (home==1): x10.array.Array[x10.lang.Double]{self.region==x.region, x.region.rank==1, x.region.rect==true, x.region.zeroBased==true}</stderr> <stderr rank="0"> at x10::lang::Throwable::fillInStackTrace()</stderr> <stderr rank="0"> at x10aux::throwException(x10aux::ref<x10::lang::Throwable>)</stderr> <stderr rank="0"> at matmul__closure__15::apply(x10aux::ref<x10::array::Array<double> >, x10aux::ref<x10::array::Array<double> >)</stderr> <stderr rank="0"> at x10_array_DistArray__closure__15<x10aux::ref<x10::array::Array<double> > >::apply()</stderr> <stderr rank="0"> at x10_lang_Runtime__closure__11<x10aux::ref<x10::array::Array<double> > >::apply()</stderr> <stderr rank="0"> at x10::lang::Activity::run()</stderr> <stderr rank="0"> at x10_lang_Runtime__Worker__closure__0::apply()</stderr> <stderr rank="0"> at x10::lang::Runtime::runAtLocal(int, x10aux::ref<x10::lang::VoidFun_0_0>)</stderr> <stderr rank="0"> at x10::lang::Runtime__Worker::loop(x10aux::ref<x10::lang::Runtime__Latch>, bool)</stderr> <stderr rank="0"> at x10::lang::Runtime__Worker::apply()</stderr> <stderr rank="0"> at x10_lang_Runtime__Pool__closure__0::apply()</stderr> <stderr rank="0"> at x10::lang::Thread::thread_start_routine(void*)</stderr> <stderr rank="0"> at GC_inner_start_routine</stderr> <stderr rank="0"> at GC_call_with_stack_base</stderr> <stderr rank="0"> at GC_start_routine</stderr> <stderr rank="0"> at /lib/tls/i686/cmov/libpthread.so.0 [0xf9a80e]</stderr> <stderr rank="0"> at clone</stderr> -- Mit freundlichen Grüßen / Kind regards Dr. Christoph Pospiech High Performance & Parallel Computing Phone: +49-351 86269826 Mobile: +49-171-765 5871 E-Mail: christoph.pospi...@de.ibm.com ------------------------------------- IBM Deutschland GmbH Vorsitzender des Aufsichtsrats: Erich Clementi Geschäftsführung: Martin Jetter (Vorsitzender), Reinhard Reschke, Christoph Grandpierre, Klaus Lintelmann, Michael Diemer, Martina Koederitz Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB 14562 WEEE-Reg.-Nr. DE 99369940 ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users