From af52a3cf57ed44abde5d26eed4ae5d9ecbf44a3f Mon Sep 17 00:00:00 2001 From: Qiwei Ye Date: Sat, 12 Nov 2016 13:20:31 +0800 Subject: [PATCH] adding warring for Windows build --- CNTK.Cpp.props | 4 ++++ Source/SGDLib/SGD.cpp | 6 +++--- Source/SGDLib/SGD.h | 2 +- Source/SGDLib/SGDLib.vcxproj | 5 ++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CNTK.Cpp.props b/CNTK.Cpp.props index a3f8ab4e0..d17879489 100644 --- a/CNTK.Cpp.props +++ b/CNTK.Cpp.props @@ -42,6 +42,10 @@ false true + + false + true + diff --git a/Source/SGDLib/SGD.cpp b/Source/SGDLib/SGD.cpp index 71893a2b9..06c3fd6f8 100644 --- a/Source/SGDLib/SGD.cpp +++ b/Source/SGDLib/SGD.cpp @@ -425,7 +425,7 @@ void SGD::TrainOrAdaptModel(int startEpoch, ComputationNetworkPtr net, { // Synchronize all ranks before proceeding to ensure that // rank 0 has finished writing the previous model file - BarrierWorkers(); + SynchronizeWorkers(); // (re-)initialize 1-bit SGD if (GetParallelizationMethod() == ParallelizationMethod::dataParallelSGD && @@ -728,7 +728,7 @@ void SGD::TrainOrAdaptModel(int startEpoch, ComputationNetworkPtr net, // Synchronize all ranks before proceeding to ensure that // nobody tries reading the checkpoint file at the same time // as rank 0 deleting it below - BarrierWorkers(); + SynchronizeWorkers(); // Persist model and check-point info if ((m_mpi == nullptr) || m_mpi->IsMainNode()) @@ -797,7 +797,7 @@ void SGD::TrainOrAdaptModel(int startEpoch, ComputationNetworkPtr net, // Synchronize all ranks before proceeding to ensure that // rank 0 has finished writing the model file // TODO[DataASGD]: should othet other rank waiting in async-mode - BarrierWorkers(); + SynchronizeWorkers(); // progress tracing for compute cluster management ProgressTracing::TraceProgressPercentage(m_maxEpochs, 0.0, true); diff --git a/Source/SGDLib/SGD.h b/Source/SGDLib/SGD.h index ead9bf3da..5a5284fa8 100644 --- a/Source/SGDLib/SGD.h +++ b/Source/SGDLib/SGD.h @@ -597,7 +597,7 @@ private: return UsingGradientAggregation(epochNumber) || UsingModelAggregation(epochNumber) || UsingAsyncGradientAggregation(epochNumber); } - void BarrierWorkers() + void SynchronizeWorkers() { if (m_mpi != nullptr && GetParallelizationMethod() != ParallelizationMethod::dataParallelASGD) { diff --git a/Source/SGDLib/SGDLib.vcxproj b/Source/SGDLib/SGDLib.vcxproj index 0ffb7c9ed..ede2bfac3 100644 --- a/Source/SGDLib/SGDLib.vcxproj +++ b/Source/SGDLib/SGDLib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -149,4 +149,7 @@ + + + \ No newline at end of file