Skip to content

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaga committed May 31, 2016
1 parent 5188260 commit 1e01cbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions Source/CNTK/CNTK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,11 @@ int wmainWithBS(int argc, wchar_t* argv[]) // called from wmain which is a wrapp

// parallel training
shared_ptr<Microsoft::MSR::CNTK::MPIWrapper> mpi;
auto ensureMPIWrapperCleanup = MakeScopeExit(&MPIWrapper::DeleteInstance);
bool paralleltrain = config(L"parallelTrain", false);
if (paralleltrain)
mpi = MPIWrapper::GetInstance(true /*create*/);

auto ensureMPIWrapperCleanup = MakeScopeExit(&MPIWrapper::DeleteInstance);

g_shareNodeValueMatrices = config(L"shareNodeValueMatrices", false);

TracingGPUMemoryAllocator::SetTraceLevel(config(L"traceGPUMemoryAllocations", 0));
Expand Down Expand Up @@ -572,12 +571,11 @@ int wmainOldCNTKConfig(int argc, wchar_t* argv[])

// paralleltrain training
shared_ptr<Microsoft::MSR::CNTK::MPIWrapper> mpi;
auto ensureMPIWrapperCleanup = MakeScopeExit(&MPIWrapper::DeleteInstance);
bool paralleltrain = config(L"parallelTrain", "false");
if (paralleltrain)
mpi = MPIWrapper::GetInstance(true /*create*/);

auto ensureMPIWrapperCleanup = MakeScopeExit(&MPIWrapper::DeleteInstance);

g_shareNodeValueMatrices = config(L"shareNodeValueMatrices", false);

TracingGPUMemoryAllocator::SetTraceLevel(config(L"traceGPUMemoryAllocations", 0));
Expand Down
10 changes: 5 additions & 5 deletions Source/Common/Include/MPIWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ class MPIWrapper : public std::enable_shared_from_this<MPIWrapper>
fprintf(stderr, "~MPIWrapper\n");
fflush(stderr);
// TODO: Check for error code and throw if !std::uncaught_exception()
// Do not finalize in event of an exception since calling MPI_Finalize without
// all pending communications being finished results in a hang
if (!std::uncaught_exception())
MPI_Finalize();

// Do not finalize in event of an exception since calling MPI_Finalize without
// all pending communications being finished results in a hang
if (!std::uncaught_exception())
MPI_Finalize();
}

private:
Expand Down

0 comments on commit 1e01cbe

Please sign in to comment.