Class: CNTK::DistributedCommunicator

Inherits:
Object
  • Object
show all
Defined in:
ext/cntk/cntk_wrap.cxx

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.finalize(*args) ⇒ Object



63626
63627
63628
63629
63630
63631
63632
63633
63634
63635
63636
63637
63638
63639
63640
63641
63642
63643
63644
63645
63646
63647
63648
63649
63650
63651
# File 'ext/cntk/cntk_wrap.cxx', line 63626

SWIGINTERN VALUE
_wrap_DistributedCommunicator_finalize(int argc, VALUE *argv, VALUE self) {
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      CNTK::DistributedCommunicator::Finalize(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

Instance Method Details

#aggregate(*args) ⇒ Object



63527
63528
63529
63530
63531
63532
63533
63534
63535
63536
63537
63538
63539
63540
63541
63542
63543
63544
63545
63546
63547
63548
63549
63550
63551
63552
63553
63554
63555
63556
63557
63558
63559
63560
63561
63562
63563
63564
63565
63566
63567
63568
63569
63570
63571
63572
63573
63574
63575
63576
63577
63578
63579
63580
63581
63582
63583
63584
63585
63586
63587
63588
63589
63590
63591
63592
63593
63594
63595
63596
63597
63598
63599
63600
63601
63602
63603
63604
63605
63606
63607
63608
63609
63610
63611
63612
63613
63614
63615
63616
# File 'ext/cntk/cntk_wrap.cxx', line 63527

SWIGINTERN VALUE
_wrap_DistributedCommunicator_aggregate(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > *arg2 = 0 ;
  std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > *arg3 = 0 ;
  std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator > *smartarg1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  int res4 = SWIG_OLDOBJ ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator *","Aggregate", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    std::vector< std::shared_ptr< CNTK::NDArrayView >,std::allocator< std::shared_ptr< CNTK::NDArrayView > > > *ptr = (std::vector< std::shared_ptr< CNTK::NDArrayView >,std::allocator< std::shared_ptr< CNTK::NDArrayView > > > *)0;
    res2 = swig::asptr(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &","Aggregate", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &","Aggregate", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__vectorT_std__shared_ptrT_CNTK__NDArrayView_t_std__allocatorT_std__shared_ptrT_CNTK__NDArrayView_t_t_t,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > &","Aggregate", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > &","Aggregate", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > * >(argp3);
  {
    std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *ptr = (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *)0;
    res4 = swig::asptr(argv[2], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","Aggregate", 4, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","Aggregate", 4, argv[2])); 
    }
    arg4 = ptr;
  }
  {
    try {
      (arg1)->Aggregate((std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &)*arg2,*arg3,(std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &)*arg4); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}

#aggregate_in_place(*args) ⇒ Object



63446
63447
63448
63449
63450
63451
63452
63453
63454
63455
63456
63457
63458
63459
63460
63461
63462
63463
63464
63465
63466
63467
63468
63469
63470
63471
63472
63473
63474
63475
63476
63477
63478
63479
63480
63481
63482
63483
63484
63485
63486
63487
63488
63489
63490
63491
63492
63493
63494
63495
63496
63497
63498
63499
63500
63501
63502
63503
63504
63505
63506
63507
63508
63509
63510
63511
63512
63513
63514
63515
63516
63517
63518
63519
63520
63521
63522
63523
63524
# File 'ext/cntk/cntk_wrap.cxx', line 63446

SWIGINTERN VALUE
_wrap_DistributedCommunicator_aggregate_in_place(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > *arg2 = 0 ;
  std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator > *smartarg1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator *","AggregateInPlace", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    std::vector< std::shared_ptr< CNTK::NDArrayView >,std::allocator< std::shared_ptr< CNTK::NDArrayView > > > *ptr = (std::vector< std::shared_ptr< CNTK::NDArrayView >,std::allocator< std::shared_ptr< CNTK::NDArrayView > > > *)0;
    res2 = swig::asptr(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &","AggregateInPlace", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &","AggregateInPlace", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *ptr = (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *)0;
    res3 = swig::asptr(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","AggregateInPlace", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","AggregateInPlace", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      (arg1)->AggregateInPlace((std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &)*arg2,(std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &)*arg3); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}

#barrier(*args) ⇒ Object



63654
63655
63656
63657
63658
63659
63660
63661
63662
63663
63664
63665
63666
63667
63668
63669
63670
63671
63672
63673
63674
63675
63676
63677
63678
63679
63680
63681
63682
63683
63684
63685
63686
63687
63688
63689
63690
63691
63692
63693
63694
63695
63696
63697
63698
63699
63700
63701
63702
# File 'ext/cntk/cntk_wrap.cxx', line 63654

SWIGINTERN VALUE
_wrap_DistributedCommunicator_barrier(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator > *smartarg1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator *","Barrier", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    try {
      (arg1)->Barrier(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#concatenate(*args, self) ⇒ Object



63295
63296
63297
63298
63299
63300
63301
63302
63303
63304
63305
63306
63307
63308
63309
63310
63311
63312
63313
63314
63315
63316
63317
63318
63319
63320
63321
63322
63323
63324
63325
63326
63327
63328
63329
63330
63331
63332
63333
63334
63335
63336
63337
63338
63339
63340
63341
63342
63343
63344
63345
63346
63347
63348
63349
63350
63351
63352
63353
63354
63355
# File 'ext/cntk/cntk_wrap.cxx', line 63295

SWIGINTERN VALUE _wrap_DistributedCommunicator_concatenate(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 4) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = swig::asptr(argv[1], (std::vector< std::shared_ptr< CNTK::Value >,std::allocator< std::shared_ptr< CNTK::Value > > >**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorT_std__shared_ptrT_CNTK__Value_t_std__allocatorT_std__shared_ptrT_CNTK__Value_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          int res = swig::asptr(argv[3], (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > >**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_DistributedCommunicator_concatenate__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = swig::asptr(argv[1], (std::vector< std::shared_ptr< CNTK::NDArrayView >,std::allocator< std::shared_ptr< CNTK::NDArrayView > > >**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorT_std__shared_ptrT_CNTK__NDArrayView_t_std__allocatorT_std__shared_ptrT_CNTK__NDArrayView_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          int res = swig::asptr(argv[3], (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > >**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_DistributedCommunicator_concatenate__SWIG_1(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "DistributedCommunicator.concatenate", 
    "    void DistributedCommunicator.concatenate(std::vector< CNTK::ValuePtr,std::allocator< CNTK::ValuePtr > > const &values, std::vector< CNTK::ValuePtr,std::allocator< CNTK::ValuePtr > > &outputValues, std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &sendToWorkers)\n"
    "    void DistributedCommunicator.concatenate(std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > const &input, std::vector< CNTK::NDArrayViewPtr,std::allocator< CNTK::NDArrayViewPtr > > &output, std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &sendToWorkers)\n");
  
  return Qnil;
}

#current_worker(*args) ⇒ Object



62985
62986
62987
62988
62989
62990
62991
62992
62993
62994
62995
62996
62997
62998
62999
63000
63001
63002
63003
63004
63005
63006
63007
63008
63009
63010
63011
63012
63013
63014
63015
63016
63017
63018
63019
63020
63021
63022
63023
63024
63025
63026
63027
63028
63029
63030
63031
63032
63033
63034
63035
63036
# File 'ext/cntk/cntk_wrap.cxx', line 62985

SWIGINTERN VALUE
_wrap_DistributedCommunicator_current_worker(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator const > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator const > *smartarg1 = 0 ;
  CNTK::DistributedWorkerDescriptor *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator const *","CurrentWorker", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    try {
      result = (CNTK::DistributedWorkerDescriptor *) &((CNTK::DistributedCommunicator const *)arg1)->CurrentWorker(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CNTK__DistributedWorkerDescriptor, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}

#gather(*args) ⇒ Object



63358
63359
63360
63361
63362
63363
63364
63365
63366
63367
63368
63369
63370
63371
63372
63373
63374
63375
63376
63377
63378
63379
63380
63381
63382
63383
63384
63385
63386
63387
63388
63389
63390
63391
63392
63393
63394
63395
63396
63397
63398
63399
63400
63401
63402
63403
63404
63405
63406
63407
63408
63409
63410
63411
63412
63413
63414
63415
63416
63417
63418
63419
63420
63421
63422
63423
63424
63425
63426
63427
63428
63429
63430
63431
63432
63433
63434
63435
63436
63437
63438
63439
63440
63441
63442
63443
# File 'ext/cntk/cntk_wrap.cxx', line 63358

SWIGINTERN VALUE
_wrap_DistributedCommunicator_gather(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  CNTK::Dictionary *arg2 = 0 ;
  std::vector< CNTK::DictionaryPtr,std::allocator< CNTK::DictionaryPtr > > *arg3 = 0 ;
  std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator > *smartarg1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  int res4 = SWIG_OLDOBJ ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator *","Gather", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_CNTK__Dictionary,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "CNTK::Dictionary const &","Gather", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "CNTK::Dictionary const &","Gather", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< CNTK::Dictionary * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__vectorT_std__shared_ptrT_CNTK__Dictionary_t_std__allocatorT_std__shared_ptrT_CNTK__Dictionary_t_t_t,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< CNTK::DictionaryPtr,std::allocator< CNTK::DictionaryPtr > > &","Gather", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CNTK::DictionaryPtr,std::allocator< CNTK::DictionaryPtr > > &","Gather", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< std::vector< CNTK::DictionaryPtr,std::allocator< CNTK::DictionaryPtr > > * >(argp3);
  {
    std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *ptr = (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *)0;
    res4 = swig::asptr(argv[2], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","Gather", 4, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","Gather", 4, argv[2])); 
    }
    arg4 = ptr;
  }
  {
    try {
      (arg1)->Gather((CNTK::Dictionary const &)*arg2,*arg3,(std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &)*arg4); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}

#sub_group(*args) ⇒ Object



63039
63040
63041
63042
63043
63044
63045
63046
63047
63048
63049
63050
63051
63052
63053
63054
63055
63056
63057
63058
63059
63060
63061
63062
63063
63064
63065
63066
63067
63068
63069
63070
63071
63072
63073
63074
63075
63076
63077
63078
63079
63080
63081
63082
63083
63084
63085
63086
63087
63088
63089
63090
63091
63092
63093
63094
63095
63096
63097
63098
63099
63100
63101
63102
63103
63104
63105
63106
63107
63108
# File 'ext/cntk/cntk_wrap.cxx', line 63039

SWIGINTERN VALUE
_wrap_DistributedCommunicator_sub_group(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator const > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator const > *smartarg1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  CNTK::DistributedCommunicatorPtr result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator const *","SubGroup", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *ptr = (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *)0;
    res2 = swig::asptr(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","SubGroup", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &","SubGroup", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((CNTK::DistributedCommunicator const *)arg1)->SubGroup((std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > const &)*arg2); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  {
    std::shared_ptr<  CNTK::DistributedCommunicator > *smartresult = result ? new std::shared_ptr<  CNTK::DistributedCommunicator >(result) : 0;
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(smartresult), SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, SWIG_POINTER_OWN);
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}

#workers(*args) ⇒ Object



62931
62932
62933
62934
62935
62936
62937
62938
62939
62940
62941
62942
62943
62944
62945
62946
62947
62948
62949
62950
62951
62952
62953
62954
62955
62956
62957
62958
62959
62960
62961
62962
62963
62964
62965
62966
62967
62968
62969
62970
62971
62972
62973
62974
62975
62976
62977
62978
62979
62980
62981
62982
# File 'ext/cntk/cntk_wrap.cxx', line 62931

SWIGINTERN VALUE
_wrap_DistributedCommunicator_workers(int argc, VALUE *argv, VALUE self) {
  CNTK::DistributedCommunicator *arg1 = (CNTK::DistributedCommunicator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::DistributedCommunicator const > tempshared1 ;
  std::shared_ptr< CNTK::DistributedCommunicator const > *smartarg1 = 0 ;
  std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__DistributedCommunicator_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::DistributedCommunicator const *","Workers", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      delete reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr< const CNTK::DistributedCommunicator > * >(argp1);
      arg1 = const_cast< CNTK::DistributedCommunicator * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    try {
      result = (std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > *) &((CNTK::DistributedCommunicator const *)arg1)->Workers(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  vresult = swig::from(static_cast< std::unordered_set< CNTK::DistributedWorkerDescriptor,std::hash< CNTK::DistributedWorkerDescriptor >,std::equal_to< CNTK::DistributedWorkerDescriptor >,std::allocator< CNTK::DistributedWorkerDescriptor > > >(*result));
  return vresult;
fail:
  return Qnil;
}