[IPOL discuss] possible bug in NL-means (ipol)

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Sun Oct 14 15:41:23 CEST 2012


Hi mauricio,

> In NL-means this happens in the filtered image (fpO) which is shared
> and updated by all the threads. The image is decomposed in overlapped
> patches that are denoised each of them separately, and then they are
> aggregated in the final image (fpO). The problem is that when the
> update of fpO  takes place, may happen that two overlapped patches
> running in different threads try to update the same memory address.

If I understand correctly that overlapping parts of the image are read
and modified simultaneously, and if the new values depend of the
original ones, then there is more than this race condition. OpenMP
provides no guarantee (by design) on the order of the threads. So if
two overlapping areas A and B are handled by two different threads,
there is no way to know in advance if A is processed before B or B
before A. This may differ across machines, compilers, and even between
runs with the same binary on the same machine.

Are the results of this code (without your "critical" patch) identical
when run on different machines and/or compilers?

-- 
Nicolas LIMARE - CMLA - ENS Cachan         http://limare.perso.math.cnrs.fr/
IPOL - image processing on line                          http://www.ipol.im/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://tools.ipol.im/mailman/archive/discuss/attachments/20121014/97b5e3d0/attachment.pgp>


More information about the discuss mailing list