#ifndef __X10_UTIL_TEAM_H
#define __X10_UTIL_TEAM_H

#include <x10rt.h>


#define X10_LANG_ANY_H_NODEPS
#include <x10/lang/Any.h>
#undef X10_LANG_ANY_H_NODEPS
#define X10_LANG_ANY_H_NODEPS
#include <x10/lang/Any.h>
#undef X10_LANG_ANY_H_NODEPS
#define X10_LANG_INT_H_NODEPS
#include <x10/lang/Int.h>
#undef X10_LANG_INT_H_NODEPS
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace lang { 
class Place;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class IndexedMemoryChunk;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace lang { 
class FinishState;
} } 
namespace x10 { namespace lang { 
class Throwable;
} } 
namespace x10 { namespace lang { 
class RuntimeException;
} } 
namespace x10 { namespace compiler { 
class Finalization;
} } 
namespace x10 { namespace compiler { 
class Abort;
} } 
namespace x10 { namespace compiler { 
class CompilerFlags;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace compiler { 
class Native;
} } 
namespace x10 { namespace lang { 
class Byte;
} } 
namespace x10 { namespace lang { 
class UByte;
} } 
namespace x10 { namespace lang { 
class Short;
} } 
namespace x10 { namespace lang { 
class UShort;
} } 
namespace x10 { namespace lang { 
class UInt;
} } 
namespace x10 { namespace lang { 
class Long;
} } 
namespace x10 { namespace lang { 
class ULong;
} } 
namespace x10 { namespace lang { 
class Float;
} } 
namespace x10 { namespace lang { 
class Double;
} } 
namespace x10 { namespace util { 
class Team__DoubleIdx;
} } 
namespace x10 { namespace lang { 
class IllegalArgumentException;
} } 
namespace x10 { namespace lang { 
class String;
} } 
namespace x10 { namespace compiler { 
class NonEscaping;
} } 
namespace x10 { namespace util { 

class Team   {
    public:
    RTT_H_DECLS_STRUCT
    
    x10::util::Team* operator->() { return this; }
    
    static x10aux::itable_entry _itables[2];
    
    x10aux::itable_entry* _getITables() { return _itables; }
    
    static x10::lang::Any::itable<x10::util::Team > _itable_0;
    
    static x10aux::itable_entry _iboxitables[2];
    
    x10aux::itable_entry* _getIBoxITables() { return _iboxitables; }
    
    static x10::util::Team _alloc(){x10::util::Team t; return t; }
    
    static x10::util::Team FMGL(WORLD);
    
    static void FMGL(WORLD__do_init)();
    static void FMGL(WORLD__init)();
    static volatile x10aux::status FMGL(WORLD__status);
    static x10::util::Team FMGL(WORLD__get)();
    static x10aux::ref<x10::lang::Reference> FMGL(WORLD__deserialize)(x10aux::deserialization_buffer &buf);
    static const x10aux::serialization_id_t FMGL(WORLD__id);
    
    x10_int FMGL(id);
    
    x10_int id() {
        
        //#line 40 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->FMGL(id);
        
    }
    void _constructor(x10_int id) {
        
        //#line 42 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Empty_c
        ;
        
        //#line 42 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.AssignPropertyCall_c
        
        //#line 42 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(id) = id;
    }
    static x10::util::Team _make(x10_int id) {
        x10::util::Team this_; 
        this_->_constructor(id);
        return this_;
    }
    
    void _constructor(x10aux::ref<x10::array::Array<x10::lang::Place> > places);
    
    static x10::util::Team _make(x10aux::ref<x10::array::Array<x10::lang::Place> > places);
    
    void _constructor(x10::util::IndexedMemoryChunk<x10::lang::Place > places,
                      x10_int count);
    
    static x10::util::Team _make(x10::util::IndexedMemoryChunk<x10::lang::Place > places,
                                 x10_int count);
    
    static void nativeMake(x10::util::IndexedMemoryChunk<x10::lang::Place > places,
                           x10_int count, x10::util::IndexedMemoryChunk<x10_int > result);
    x10_int size() {
        
        //#line 64 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return x10::util::Team::nativeSize((*this)->FMGL(id));
        
    }
    static x10_int nativeSize(x10_int id) {
        return (x10_int)x10rt_team_sz(id);
    }
    void barrier(x10_int role);
    static void nativeBarrier(x10_int id, x10_int role) {
        x10rt_barrier(id, role, x10aux::coll_handler, x10aux::coll_enter());
    }
    template<class TPMGL(T)> void scatter(x10_int role, x10_int root,
                                          x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                          x10_int src_off,
                                          x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                          x10_int dst_off,
                                          x10_int count);
    template<class TPMGL(T)> static void nativeScatter(x10_int id,
                                                       x10_int role,
                                                       x10_int root,
                                                       x10::util::IndexedMemoryChunk<TPMGL(T) > src,
                                                       x10_int src_off,
                                                       x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
                                                       x10_int dst_off,
                                                       x10_int count);
    template<class TPMGL(T)> void bcast(x10_int role, x10_int root,
                                        x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                        x10_int src_off, x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                        x10_int dst_off, x10_int count);
    template<class TPMGL(T)> static void nativeBcast(x10_int id,
                                                     x10_int role,
                                                     x10_int root,
                                                     x10::util::IndexedMemoryChunk<TPMGL(T) > src,
                                                     x10_int src_off,
                                                     x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
                                                     x10_int dst_off,
                                                     x10_int count);
    template<class TPMGL(T)> void alltoall(x10_int role, x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                           x10_int src_off,
                                           x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                           x10_int dst_off,
                                           x10_int count);
    template<class TPMGL(T)> static void nativeAlltoall(x10_int id,
                                                        x10_int role,
                                                        x10::util::IndexedMemoryChunk<TPMGL(T) > src,
                                                        x10_int src_off,
                                                        x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
                                                        x10_int dst_off,
                                                        x10_int count);
    static x10_int FMGL(ADD);
    
    static x10_int FMGL(ADD__get)();
    static x10_int FMGL(MUL);
    
    static x10_int FMGL(MUL__get)();
    static x10_int FMGL(AND);
    
    static x10_int FMGL(AND__get)();
    static x10_int FMGL(OR);
    
    static x10_int FMGL(OR__get)();
    static x10_int FMGL(XOR);
    
    static x10_int FMGL(XOR__get)();
    static x10_int FMGL(MAX);
    
    static x10_int FMGL(MAX__get)();
    static x10_int FMGL(MIN);
    
    static x10_int FMGL(MIN__get)();
    template<class TPMGL(T)> void allreduce(x10_int role,
                                            x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                            x10_int src_off,
                                            x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                            x10_int dst_off,
                                            x10_int count,
                                            x10_int op);
    template<class TPMGL(T)> static void nativeAllreduce(
      x10_int id, x10_int role, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
      x10_int src_off, x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
      x10_int dst_off, x10_int count, x10_int op);
    x10_byte allreduce(x10_int role, x10_byte src, x10_int op) {
        
        //#line 214 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_byte >(role,
                                                    src, op);
        
    }
    x10_ubyte allreduce(x10_int role, x10_ubyte src, x10_int op) {
        
        //#line 216 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_ubyte >(role,
                                                     src,
                                                     op);
        
    }
    x10_short allreduce(x10_int role, x10_short src, x10_int op) {
        
        //#line 218 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_short >(role,
                                                     src,
                                                     op);
        
    }
    x10_ushort allreduce(x10_int role, x10_ushort src, x10_int op) {
        
        //#line 220 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_ushort >(role,
                                                      src,
                                                      op);
        
    }
    x10_uint allreduce(x10_int role, x10_uint src, x10_int op) {
        
        //#line 222 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_uint >(role,
                                                    src, op);
        
    }
    x10_int allreduce(x10_int role, x10_int src, x10_int op) {
        
        //#line 224 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_int >(role, src,
                                                   op);
        
    }
    x10_long allreduce(x10_int role, x10_long src, x10_int op) {
        
        //#line 226 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_long >(role,
                                                    src, op);
        
    }
    x10_ulong allreduce(x10_int role, x10_ulong src, x10_int op) {
        
        //#line 228 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_ulong >(role,
                                                     src,
                                                     op);
        
    }
    x10_float allreduce(x10_int role, x10_float src, x10_int op) {
        
        //#line 230 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_float >(role,
                                                     src,
                                                     op);
        
    }
    x10_double allreduce(x10_int role, x10_double src, x10_int op) {
        
        //#line 232 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->genericAllreduce<x10_double >(role,
                                                      src,
                                                      op);
        
    }
    template<class TPMGL(T)> TPMGL(T) genericAllreduce(x10_int role,
                                                       TPMGL(T) src,
                                                       x10_int op);
    template<class TPMGL(T)> static void nativeAllreduce(
      x10_int id, x10_int role, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
      x10::util::IndexedMemoryChunk<TPMGL(T) > dst, x10_int op);
    x10_int indexOfMax(x10_int role, x10_double v, x10_int idx);
    static void nativeIndexOfMax(x10_int id, x10_int role,
                                 x10::util::IndexedMemoryChunk<x10::util::Team__DoubleIdx > src,
                                 x10::util::IndexedMemoryChunk<x10::util::Team__DoubleIdx > dst);
    x10_int indexOfMin(x10_int role, x10_double v, x10_int idx);
    static void nativeIndexOfMin(x10_int id, x10_int role,
                                 x10::util::IndexedMemoryChunk<x10::util::Team__DoubleIdx > src,
                                 x10::util::IndexedMemoryChunk<x10::util::Team__DoubleIdx > dst);
    x10::util::Team split(x10_int role, x10_int color, x10_int new_role);
    static void nativeSplit(x10_int id, x10_int role, x10_int color,
                            x10_int new_role, x10::util::IndexedMemoryChunk<x10_int > result);
    void del(x10_int role);
    static void nativeDel(x10_int id, x10_int role) {
        x10rt_team_del(id, role, x10aux::coll_handler, x10aux::coll_enter());
    }
    x10aux::ref<x10::lang::String> toString();
    x10_boolean equals(x10::util::Team that) {
        
        //#line 316 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (x10aux::struct_equals(that->FMGL(id), (*this)->
                                                        FMGL(id)));
        
    }
    x10_boolean equals(x10aux::ref<x10::lang::Any> that);
    x10_int hashCode() {
        
        //#line 318 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this)->FMGL(id);
        
    }
    x10aux::ref<x10::lang::String> typeName();
    x10_boolean _struct_equals(x10aux::ref<x10::lang::Any> other);
    x10_boolean _struct_equals(x10::util::Team other) {
        
        //#line 28 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (x10aux::struct_equals((*this)->FMGL(id), other->
                                                           FMGL(id)));
        
    }
    x10::util::Team x10__util__Team____x10__util__Team__this(
      ) {
        
        //#line 28 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
        return (*this);
        
    }
    
    static void _serialize(x10::util::Team this_, x10aux::serialization_buffer& buf);
    
    static x10::util::Team _deserialize(x10aux::deserialization_buffer& buf) {
        x10::util::Team this_;
        this_->_deserialize_body(buf);
        return this_;
    }
    
    void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};

} } 
#endif // X10_UTIL_TEAM_H

namespace x10 { namespace util { 
class Team;
} } 

#ifndef X10_UTIL_TEAM_H_NODEPS
#define X10_UTIL_TEAM_H_NODEPS
#include <x10/lang/Any.h>
#include <x10/lang/Int.h>
#include <x10/array/Array.h>
#include <x10/lang/Place.h>
#include <x10/util/IndexedMemoryChunk.h>
#include <x10/lang/Runtime.h>
#include <x10/lang/FinishState.h>
#include <x10/lang/Throwable.h>
#include <x10/lang/RuntimeException.h>
#include <x10/compiler/Finalization.h>
#include <x10/compiler/Abort.h>
#include <x10/compiler/CompilerFlags.h>
#include <x10/lang/Boolean.h>
#include <x10/compiler/Native.h>
#include <x10/lang/Byte.h>
#include <x10/lang/UByte.h>
#include <x10/lang/Short.h>
#include <x10/lang/UShort.h>
#include <x10/lang/UInt.h>
#include <x10/lang/Long.h>
#include <x10/lang/ULong.h>
#include <x10/lang/Float.h>
#include <x10/lang/Double.h>
#include <x10/util/Team__DoubleIdx.h>
#include <x10/lang/IllegalArgumentException.h>
#include <x10/lang/String.h>
#include <x10/compiler/NonEscaping.h>
#ifndef X10_UTIL_TEAM_H_GENERICS
#define X10_UTIL_TEAM_H_GENERICS
inline x10::util::Team x10::util::Team::FMGL(WORLD__get)() {
    if (FMGL(WORLD__status) != x10aux::INITIALIZED) {
        FMGL(WORLD__init)();
    }
    return x10::util::Team::FMGL(WORLD);
}

#ifndef X10_UTIL_TEAM_H_scatter_1843
#define X10_UTIL_TEAM_H_scatter_1843
template<class TPMGL(T)> void x10::util::Team::scatter(x10_int role, x10_int root,
                                                       x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                                       x10_int src_off,
                                                       x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                                       x10_int dst_off,
                                                       x10_int count) {
    {
        
        //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var13 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable50635 =
              X10_NULL;
            
            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
            try {
                
                //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                        x10::util::Team::template nativeScatter<TPMGL(T) >(
                          (*this)->FMGL(id), role, root, x10aux::nullCheck(src)->x10::array::Array<TPMGL(T)>::raw(),
                          src_off, x10aux::nullCheck(dst)->x10::array::Array<TPMGL(T)>::raw(),
                          dst_off, count);
                    }
                }
                catch (x10aux::__ref& __ref__1844) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1844 = (x10aux::ref<x10::lang::Throwable>&)__ref__1844;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__13__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1844);
                        {
                            
                            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__13__);
                            
                            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1845) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1845 = (x10aux::ref<x10::lang::Throwable>&)__ref__1845;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal50636 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1845);
                    {
                        
                        //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable50635 = formal50636;
                    }
                } else
                throw;
            }
            
            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50635)))
            {
                
                //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable50635))
                {
                    
                    //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50635));
                }
                
            }
            
            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var13);
            }
            
            //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50635)))
            {
                
                //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable50635)))
                {
                    
                    //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50635));
                }
                
            }
            
        }
    }
}
#endif // X10_UTIL_TEAM_H_scatter_1843
#ifndef X10_UTIL_TEAM_H_nativeScatter_1846
#define X10_UTIL_TEAM_H_nativeScatter_1846
template<class TPMGL(T)> void x10::util::Team::nativeScatter(
  x10_int id, x10_int role, x10_int root, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
  x10_int src_off, x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
  x10_int dst_off, x10_int count) {
    x10rt_scatter(id, role, root, &src->raw()[src_off], &dst->raw()[dst_off], sizeof(TPMGL(T)), count, x10aux::coll_handler, x10aux::coll_enter());
}
#endif // X10_UTIL_TEAM_H_nativeScatter_1846
#ifndef X10_UTIL_TEAM_H_bcast_1847
#define X10_UTIL_TEAM_H_bcast_1847
template<class TPMGL(T)> void x10::util::Team::bcast(x10_int role,
                                                     x10_int root,
                                                     x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                                     x10_int src_off,
                                                     x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                                     x10_int dst_off,
                                                     x10_int count) {
    {
        
        //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var14 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable50638 =
              X10_NULL;
            
            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
            try {
                
                //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                        x10::util::Team::template nativeBcast<TPMGL(T) >(
                          (*this)->FMGL(id), role, root, x10aux::nullCheck(src)->x10::array::Array<TPMGL(T)>::raw(),
                          src_off, x10aux::nullCheck(dst)->x10::array::Array<TPMGL(T)>::raw(),
                          dst_off, count);
                    }
                }
                catch (x10aux::__ref& __ref__1848) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1848 = (x10aux::ref<x10::lang::Throwable>&)__ref__1848;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__14__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1848);
                        {
                            
                            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__14__);
                            
                            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1849) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1849 = (x10aux::ref<x10::lang::Throwable>&)__ref__1849;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal50639 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1849);
                    {
                        
                        //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable50638 = formal50639;
                    }
                } else
                throw;
            }
            
            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50638)))
            {
                
                //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable50638))
                {
                    
                    //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50638));
                }
                
            }
            
            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var14);
            }
            
            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50638)))
            {
                
                //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable50638)))
                {
                    
                    //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50638));
                }
                
            }
            
        }
    }
}
#endif // X10_UTIL_TEAM_H_bcast_1847
#ifndef X10_UTIL_TEAM_H_nativeBcast_1850
#define X10_UTIL_TEAM_H_nativeBcast_1850
template<class TPMGL(T)> void x10::util::Team::nativeBcast(
  x10_int id, x10_int role, x10_int root, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
  x10_int src_off, x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
  x10_int dst_off, x10_int count) {
    x10rt_bcast(id, role, root, &src->raw()[src_off], &dst->raw()[dst_off], sizeof(TPMGL(T)), count, x10aux::coll_handler, x10aux::coll_enter());
}
#endif // X10_UTIL_TEAM_H_nativeBcast_1850
#ifndef X10_UTIL_TEAM_H_alltoall_1851
#define X10_UTIL_TEAM_H_alltoall_1851
template<class TPMGL(T)> void x10::util::Team::alltoall(x10_int role,
                                                        x10aux::ref<x10::array::Array<TPMGL(T)> > src,
                                                        x10_int src_off,
                                                        x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
                                                        x10_int dst_off,
                                                        x10_int count) {
    {
        
        //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var15 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable50641 =
              X10_NULL;
            
            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
            try {
                
                //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                        x10::util::Team::template nativeAlltoall<TPMGL(T) >(
                          (*this)->FMGL(id), role, x10aux::nullCheck(src)->x10::array::Array<TPMGL(T)>::raw(),
                          src_off, x10aux::nullCheck(dst)->x10::array::Array<TPMGL(T)>::raw(),
                          dst_off, count);
                    }
                }
                catch (x10aux::__ref& __ref__1852) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1852 = (x10aux::ref<x10::lang::Throwable>&)__ref__1852;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__15__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1852);
                        {
                            
                            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__15__);
                            
                            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1853) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1853 = (x10aux::ref<x10::lang::Throwable>&)__ref__1853;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal50642 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1853);
                    {
                        
                        //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable50641 = formal50642;
                    }
                } else
                throw;
            }
            
            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50641)))
            {
                
                //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable50641))
                {
                    
                    //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50641));
                }
                
            }
            
            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var15);
            }
            
            //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50641)))
            {
                
                //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable50641)))
                {
                    
                    //#line 158 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50641));
                }
                
            }
            
        }
    }
}
#endif // X10_UTIL_TEAM_H_alltoall_1851
#ifndef X10_UTIL_TEAM_H_nativeAlltoall_1854
#define X10_UTIL_TEAM_H_nativeAlltoall_1854
template<class TPMGL(T)> void x10::util::Team::nativeAlltoall(
  x10_int id, x10_int role, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
  x10_int src_off, x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
  x10_int dst_off, x10_int count) {
    x10rt_alltoall(id, role, &src->raw()[src_off], &dst->raw()[dst_off], sizeof(TPMGL(T)), count, x10aux::coll_handler, x10aux::coll_enter());
}
#endif // X10_UTIL_TEAM_H_nativeAlltoall_1854
inline x10_int x10::util::Team::FMGL(ADD__get)() {
    return x10::util::Team::FMGL(ADD);
}

inline x10_int x10::util::Team::FMGL(MUL__get)() {
    return x10::util::Team::FMGL(MUL);
}

inline x10_int x10::util::Team::FMGL(AND__get)() {
    return x10::util::Team::FMGL(AND);
}

inline x10_int x10::util::Team::FMGL(OR__get)() {
    return x10::util::Team::FMGL(OR);
}

inline x10_int x10::util::Team::FMGL(XOR__get)() {
    return x10::util::Team::FMGL(XOR);
}

inline x10_int x10::util::Team::FMGL(MAX__get)() {
    return x10::util::Team::FMGL(MAX);
}

inline x10_int x10::util::Team::FMGL(MIN__get)() {
    return x10::util::Team::FMGL(MIN);
}

#ifndef X10_UTIL_TEAM_H_allreduce_1855
#define X10_UTIL_TEAM_H_allreduce_1855
template<class TPMGL(T)> void x10::util::Team::allreduce(
  x10_int role, x10aux::ref<x10::array::Array<TPMGL(T)> > src,
  x10_int src_off, x10aux::ref<x10::array::Array<TPMGL(T)> > dst,
  x10_int dst_off, x10_int count, x10_int op) {
    {
        
        //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var16 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable50644 =
              X10_NULL;
            
            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
            try {
                
                //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                        x10::util::Team::template nativeAllreduce<TPMGL(T) >(
                          (*this)->FMGL(id), role, x10aux::nullCheck(src)->x10::array::Array<TPMGL(T)>::raw(),
                          src_off, x10aux::nullCheck(dst)->x10::array::Array<TPMGL(T)>::raw(),
                          dst_off, count, op);
                    }
                }
                catch (x10aux::__ref& __ref__1856) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1856 = (x10aux::ref<x10::lang::Throwable>&)__ref__1856;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__16__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1856);
                        {
                            
                            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__16__);
                            
                            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1857) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1857 = (x10aux::ref<x10::lang::Throwable>&)__ref__1857;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal50645 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1857);
                    {
                        
                        //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable50644 = formal50645;
                    }
                } else
                throw;
            }
            
            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50644)))
            {
                
                //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable50644))
                {
                    
                    //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50644));
                }
                
            }
            
            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var16);
            }
            
            //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50644)))
            {
                
                //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable50644)))
                {
                    
                    //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50644));
                }
                
            }
            
        }
    }
}
#endif // X10_UTIL_TEAM_H_allreduce_1855
#ifndef X10_UTIL_TEAM_H_nativeAllreduce_1858
#define X10_UTIL_TEAM_H_nativeAllreduce_1858
template<class TPMGL(T)> void x10::util::Team::nativeAllreduce(
  x10_int id, x10_int role, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
  x10_int src_off, x10::util::IndexedMemoryChunk<TPMGL(T) > dst,
  x10_int dst_off, x10_int count, x10_int op) {
    x10rt_allreduce(id, role, &src->raw()[src_off], &dst->raw()[dst_off], (x10rt_red_op_type)op, x10rt_get_red_type<TPMGL(T)>(), count, x10aux::coll_handler, x10aux::coll_enter());
}
#endif // X10_UTIL_TEAM_H_nativeAllreduce_1858
#ifndef X10_UTIL_TEAM_H_genericAllreduce_1869
#define X10_UTIL_TEAM_H_genericAllreduce_1869
template<class TPMGL(T)> TPMGL(T) x10::util::Team::genericAllreduce(
  x10_int role, TPMGL(T) src, x10_int op) {
    
    //#line 235 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
    x10::util::IndexedMemoryChunk<TPMGL(T) > chk = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(T) >(((x10_int)1), 8, false, false);
    
    //#line 236 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
    x10::util::IndexedMemoryChunk<TPMGL(T) > dst = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(T) >(((x10_int)1), 8, false, false);
    
    //#line 237 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
    (chk)->__set(((x10_int)0), src);
    {
        
        //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var17 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable50647 =
              X10_NULL;
            
            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
            try {
                
                //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                        x10::util::Team::template nativeAllreduce<TPMGL(T) >(
                          (*this)->FMGL(id), role, chk, dst,
                          op);
                    }
                }
                catch (x10aux::__ref& __ref__1870) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1870 = (x10aux::ref<x10::lang::Throwable>&)__ref__1870;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__17__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1870);
                        {
                            
                            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__17__);
                            
                            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1871) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1871 = (x10aux::ref<x10::lang::Throwable>&)__ref__1871;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal50648 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1871);
                    {
                        
                        //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable50647 = formal50648;
                    }
                } else
                throw;
            }
            
            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50647)))
            {
                
                //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable50647))
                {
                    
                    //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50647));
                }
                
            }
            
            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var17);
            }
            
            //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable50647)))
            {
                
                //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable50647)))
                {
                    
                    //#line 238 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable50647));
                }
                
            }
            
        }
    }
    
    //#line 239 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/Team.x10": x10.ast.X10Return_c
    return (dst)->__apply(((x10_int)0));
    
}
#endif // X10_UTIL_TEAM_H_genericAllreduce_1869
#ifndef X10_UTIL_TEAM_H_nativeAllreduce_1872
#define X10_UTIL_TEAM_H_nativeAllreduce_1872
template<class TPMGL(T)> void x10::util::Team::nativeAllreduce(
  x10_int id, x10_int role, x10::util::IndexedMemoryChunk<TPMGL(T) > src,
  x10::util::IndexedMemoryChunk<TPMGL(T) > dst, x10_int op) {
    x10rt_allreduce(id, role, src->raw(), dst->raw(), (x10rt_red_op_type)op, x10rt_get_red_type<TPMGL(T)>(), 1, x10aux::coll_handler, x10aux::coll_enter());
}
#endif // X10_UTIL_TEAM_H_nativeAllreduce_1872
#endif // X10_UTIL_TEAM_H_GENERICS
#endif // __X10_UTIL_TEAM_H_NODEPS
