Apply patch to allow users to change path of lock file (#4649)
See - https://github.com/Microsoft/CNTK/issues/62
This commit is contained in:
parent
182554520f
commit
f6e2320ef0
20
var/spack/repos/builtin/packages/cntk/lock-file.patch
Normal file
20
var/spack/repos/builtin/packages/cntk/lock-file.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff --git a/Source/Common/CrossProcessMutex.h b/Source/Common/CrossProcessMutex.h
|
||||
index 2f3ce70..f0fcd42 100644
|
||||
--- a/Source/Common/CrossProcessMutex.h
|
||||
+++ b/Source/Common/CrossProcessMutex.h
|
||||
@@ -127,9 +127,13 @@ class CrossProcessMutex
|
||||
|
||||
public:
|
||||
CrossProcessMutex(const std::string& name)
|
||||
- : m_fd(-1),
|
||||
- m_fileName("/var/lock/" + name)
|
||||
+ : m_fd(-1)
|
||||
{
|
||||
+ const char * const envLockDir = getenv("CNTK_LOCK_DIR");
|
||||
+ if (envLockDir != NULL)
|
||||
+ m_fileName = envLockDir + ('/' + name);
|
||||
+ else
|
||||
+ m_fileName = "/var/lock/" + name;
|
||||
}
|
||||
|
||||
// Acquires the mutex. If 'wait' is true and mutex is acquired by someone else then
|
@ -64,6 +64,8 @@ class Cntk(Package):
|
||||
patch('build.patch')
|
||||
# Patch to fix BLAS inconsistency between CNTK and KaldiReader
|
||||
patch('kaldireader-openblas.patch')
|
||||
# Patch to change behaviour of lock file - https://github.com/Microsoft/CNTK/issues/62
|
||||
patch('lock-file.patch')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
args = []
|
||||
|
Loading…
Reference in New Issue
Block a user