octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47478] parallel package: parcellfun() hangs w


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #47478] parallel package: parcellfun() hangs when used with @fft2()
Date: Sun, 20 Mar 2016 22:01:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.6.1

Follow-up Comment #3, bug #47478 (project octave):

>From my tests, what is hanging is the call to fft2 itself. And it only happens
if fft2 had been already called in the parent (before calling it with
parcellfun).

My current knowledge on threading implementations is not so great, so the next
should be taken with caution.

I think principally a multithreaded function can be called in parallel by
multiple processes, as in parcellfun, although there will probably be no
advantage in doing this. But there may be preconditions.

In the current case, I'd guess (without studying the threading implementation
in libfftw) that the call to the libfftw function 'int fftw_init_threads
(void)' must be performed in each process. But Octave, using static class
members, provides for calling this function only once in an Octave session.
The call takes place if some fft user function is called for the first time.
So if fft2 is called in the parent, the call to fftw_init_threads() is
performed in the parent and not in the children generated by parcellfun,
although it probably should be repeated there.

Conclusions:

1. parcellfun probably can't do anything about it, so the bug is probably not
in parcellfun.

2. It's probably not worth calling fft2 with parcellfun, even if it should
work. You _can_ test it, if you start Octave anew and call parcellfun without
calling fft2 before in the parent. Please do this and compare the time with
pure fft2 invocations.

3. If we want to deal with this issue (despite of 2.), one could try to write
some testcode which repeats the call to fftw_init_threads, call this
testfunction in parcellfun and see if it helps. But my prediction is that a
submitted patch to Octave which moves the call of fftw_init_threads out of the
one-time-initialization won't be considered for application.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47478>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]