Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make lock-file location in CrossProcessMutex.h configurable #62

Closed
frankseide opened this issue Jan 29, 2016 · 4 comments
Closed

make lock-file location in CrossProcessMutex.h configurable #62

frankseide opened this issue Jan 29, 2016 · 4 comments

Comments

@frankseide
Copy link
Contributor

CrossProcessMutex.h uses a file for a global lock inside /var/lock. That location cannot be universally be assumed to be writeable in all environments for all users. It should be changed to some place that is, or changeable through a config variable.

CrossProcessMutex(const std::string& name)
    : m_fd(-1),
      m_fileName("/var/lock/" + name)
{
}
@frankseide
Copy link
Contributor Author

We probably also want to change the lock file name to something without DBN.exe in the name, as that was meant to allow coexistence of CNTK on a single server with an old internal Windows-only tool that is no longer in use.

@nslay
Copy link

nslay commented Jun 5, 2016

How about using an environment variable?

CrossProcessMutex(const std::string& 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;
}

If you insist on a setting in the configuration file, that could simply use putenv to expose this variable to CrossProcessMutex.

EDIT:
I personally would like an environment variable since write-access local storage may depend on a job ID or similar. This would save me the trouble having to sed/awk the config file to update a setting. Instead I can export a variable. See for example:
https://hpc.nih.gov/docs/b2-userguide.html#local

@wolfma61
Copy link
Contributor

wolfma61 commented Jul 7, 2017

This should have stayed open - this is a PR in process

@timolohrenz
Copy link

timolohrenz commented May 7, 2019

even after the latest news, this would be a mandatory feature for all users which have no access to /var/lock.

As far as I can see, the solution with the environment variable never made its way into a release. Maybe reopen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants