-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20/10/2012 19:32, Andreas Kloeckner wrote:
> PyCUDA creates a temporary folder for each compiler invocation in
> a process-safe manner. Only the resulting binary is stored in the
> shared cache directory you found. The structure of this cache for
> PyCUDA is really simple--a hash of the file being compiled, with
> ".cubin" appended. Theoretically, two processes could race each
> other in writing the cache file, or a process could find the
> half-done write done by another process. Despite lots of use in MPI
> processes that would trigger conflicts exactly like this, I haven't
> yet run into an issue.

Is the hash just based on the contents of the source module or does it
also include the compiler options?  I have a couple of heterogeneous
systems with SM 1.3 and SM 2.0 cards and would like to be able to run

  python test.py --sm13 &
  python test.py --sm20 &

where many of the kernels undergoing testing have exactly the same
source representation for both SM1.3 and SM2.0 cards.  Hence, if the
hash only includes the source this may cause an issue.

Would it be possible to initally create the .cubin file with a
process/thread dependent name and then move it into place (with its
final non-process dependent name).  As moves are---within
reason---usually atomic this may mitigate the issue of one process
rewriting a .cubin file while another process is reading it.

Regards, Freddie.

P.S. My line of inquiry is because I am having some intermittent
issues running my code on a cluster and /suspect/ it may be because of
this.  But before going any further I wanted to confirm that a race is
a theoretical possibility.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCC8KMACgkQ/J9EM/uoqVdP2ACgqCRSJkW5MJZl8EV4LgWl6eVB
ZsYAn22U3Me6dOeQwlHsmXcUAegXK+HH
=JOjY
-----END PGP SIGNATURE-----

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to