add engine base

This commit is contained in:
tqchen
2015-01-19 19:11:15 -08:00
parent a98720ebc9
commit fe6366eb40
3 changed files with 24 additions and 3 deletions

View File

@@ -17,11 +17,15 @@
namespace rabit {
namespace engine {
// singleton sync manager
#ifndef RABIT_USE_BASE
#ifndef RABIT_USE_MOCK
AllreduceRobust manager;
#else
AllreduceMock manager;
#endif
#else
AllreduceBase manager;
#endif
/*! \brief intiialize the synchronization module */
void Init(int argc, char *argv[]) {

15
src/engine_base.cc Normal file
View File

@@ -0,0 +1,15 @@
/*!
* Copyright (c) 2014 by Contributors
* \file engine_mock.cc
* \brief this is an engine implementation that will
* insert failures in certain call point, to test if the engine is robust to failure
* \author Tianqi Chen
*/
// define use MOCK, os we will use mock Manager
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE
#define NOMINMAX
// switch engine to AllreduceMock
#define RABIT_USE_BASE
#include "./engine.cc"