Merge pull request #99 from Microsoft/sherry_Version1

Sherry version1
This commit is contained in:
Fei Gao 2016-06-23 15:42:02 +08:00 коммит произвёл GitHub
Родитель 2932b293ca 7305766231
Коммит b943d5a1bc
6 изменённых файлов: 27 добавлений и 7 удалений

Просмотреть файл

@ -72,8 +72,8 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir);$(MSMPI_INC);$(ThirdPartyPath)\ZeroMQ 4.0.4\include;$(SolutionDir)/src;$(SolutionDir)/include;$(VC_IncludePath);$(WindowsSDK_IncludePath);D:\multiverso-next\lib</IncludePath>
<LibraryPath>$(MSMPI_LIB64);$(SolutionDir)/x64/$(Configuration);$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);D:\multiverso-next\lib</LibraryPath>
<IncludePath>$(ProjectDir);$(MSMPI_INC);$(ThirdPartyPath)\ZeroMQ 4.0.4\include;$(SolutionDir)/src;$(SolutionDir)/include;$(VC_IncludePath);$(WindowsSDK_IncludePath);D:\git_dictionary\multiverso-master_update\multiverso-master\include;</IncludePath>
<LibraryPath>$(MSMPI_LIB64);$(SolutionDir)/x64/$(Configuration);$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);D:\git_dictionary\multiverso-master_update\multiverso-master\x64\debug;</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_zmq|x64'">
<LinkIncremental>true</LinkIncremental>

Просмотреть файл

@ -25,6 +25,7 @@
#include <multiverso/updater/updater.h>
#include <multiverso/table_factory.h>
#include <gtest/gtest.h>
using namespace multiverso;

3
include/.gitignore поставляемый
Просмотреть файл

@ -25,4 +25,5 @@
# Executables
*.exe
*.out
*.app
*.app

Просмотреть файл

@ -1,10 +1,12 @@
#ifndef MULTIVERSO_MATRIX_TABLE_H_
#define MULTIVERSO_MATRIX_TABLE_H_
#include "multiverso/multiverso.h"
#include "multiverso/table_interface.h"
#include <vector>
#include <random>
namespace multiverso {
@ -71,6 +73,7 @@ public:
explicit MatrixServerTable(const MatrixTableOption<T>& option);
MatrixServerTable(integer_t num_row, integer_t num_col);
MatrixServerTable(integer_t num_row, integer_t num_col, float min_value, float max_value);
void ProcessAdd(const std::vector<Blob>& data) override;

Просмотреть файл

@ -84,8 +84,8 @@
<LibraryPath>$(MSMPI_LIB64);$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_zmq|x64'">
<IncludePath>$(ThirdPartyPath)\ZeroMQ 4.0.4\include;$(ProjectDir)\..\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<LibraryPath>$(ThirdPartyPath)\ZeroMQ 4.0.4\lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);D:\multiverso-next\lib;</LibraryPath>
<IncludePath>D:\ZeroMQ\include;$(ProjectDir)\..\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);D:\multiverso-next\lib;D:\ZeroMQ\lib;</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'">
<ClCompile>
@ -154,7 +154,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>MULTIVERSO_USE_MPI;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OpenMPSupport>true</OpenMPSupport>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -245,4 +245,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

Просмотреть файл

@ -283,6 +283,21 @@ MatrixServerTable<T>::MatrixServerTable(integer_t num_row, integer_t num_col) :
server_id_, size, num_col, num_row, num_col);
}
template <typename T>
MatrixServerTable<T>::MatrixServerTable(integer_t num_row, integer_t num_col, float min_value,float max_value) :
MatrixServerTable<T>::MatrixServerTable(num_row, num_col) {
if (typeid(T) == typeid(float)){
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_real_distribution<float> dis(min_value,max_value);
for (int i = 0; i<storage_.size(); i++)
{
storage_[i] = dis(gen);
}
}
}
template <typename T>
void MatrixServerTable<T>::ProcessAdd(const std::vector<Blob>& data) {
CHECK(data.size() == 2 || data.size() == 3);