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

chmod should be a read-modify-write of global meta data #402

Open
adammoody opened this issue Oct 31, 2019 · 0 comments
Open

chmod should be a read-modify-write of global meta data #402

adammoody opened this issue Oct 31, 2019 · 0 comments

Comments

@adammoody
Copy link
Collaborator

The chmod wrapper updates the global file meta to record new permissions of the file. In case some other process has changed the global meta data, this probably should be a read-modify-write of the global meta data. The current process may have stale info, e.g.

// if the file has "rw-" bits set
if (rank == 0) {
  MPI_Barrier(COMM_WORLD)
  chmod(path, "-r")
} else if (rank == 1) {
  chmod(path, "+x")
  MPI_Barrier(COMM_WORLD)
}
// here it should now be "-wx"
// rank 1 adds "x", then rank 0 drops "r"

Without the read-modify-write, we'd get "-w-" because rank 0 wouldn't see the change by rank 1.

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

No branches or pull requests

1 participant