Skip to content

Instantly share code, notes, and snippets.

@wence-
Created April 28, 2014 10:41
Show Gist options
  • Select an option

  • Save wence-/11368113 to your computer and use it in GitHub Desktop.

Select an option

Save wence-/11368113 to your computer and use it in GitHub Desktop.
diff --git a/pyop2/compilation.py b/pyop2/compilation.py
index 0d27c23..92c90ba 100644
--- a/pyop2/compilation.py
+++ b/pyop2/compilation.py
@@ -85,6 +85,10 @@ class Compiler(object):
# atomically (avoiding races).
tmpname = os.path.join(cachedir, "%s.so.tmp" % basename)
+ if configuration['debug']:
+ basenames = MPI.comm.allgather(basename)
+ if not all(b == basename for b in basenames):
+ raise CompilationError('Hashes of generated code differ on different ranks')
try:
# Are we in the cache?
return ctypes.CDLL(soname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment