Dear Mark,
Yes, unfortunately parallel search is broken in Mozart 1.4.0. Below
is a copy of my first mail on this matter, you may check out the
archive for more related messages.
Best
Torsten
On 18 Aug 2008, at 23:23, Torsten Anders wrote:
Hi,
Did anyone of your used parallel search with Mozart 1.4.0? It appears
there is a problem terminating processes forked by the parallel
search. To make matters more complicated, this problem seems to
happen only sometimes.
I am starting a parallel search from within the OPI. When I "halt"
the OPI (C-. h) then sometimes forked processes keep running -- and
potentially go on consuming all computational resources of the
machine. Also the Search.parallel method close() does not reliably
terminate forked processes.
See below for a small example. As I said, the problem only occurs
sometimes, unfortunately. Sometimes both forked processes are
terminated (so everything is fine), sometimes one, and sometimes both
keep running. With version 1.3.2 I never had this problem (I ran the
example many times with version 1.3.2, still I cannot prove that the
did not exist in that version...).
Also, with version 1.3.2 the forked processes are showed almost
exclusively as user CPU consumption. With 1.4.0, however, a
considerable amount (> 50%) is shown as system CPU consumption, but
this happens only if the processes cannot be terminated. In these
cases, this system CPU consumption already occurs before any attempt
to terminate the search.
So, it looks like parallel search is broken in Mozart 1.4.0. Any idea
how to address this?
Thank you!
Best
Torsten
PS: I did all the tests on MacOS 10.4.11.
--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de
%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Parallel search problem, complex enough to keep running for a
while :)
%% Forks two processes on localhost
declare
%% All-interval series length: larger L result in more complex CSPs
L = 36
functor ScriptFunctor
import FD
export Script
define
proc {Script Sol}
Xs Dxs
in
Sol = Xs
{AllIntervalSeries L Dxs Xs}
end
%% CSP
proc {AllIntervalSeries L ?Dxs ?Xs}
Xs = {FD.list L 0#L-1}
Dxs = {FD.list L-1 1#L-1}
for I in 1..L-1
do
X1 = {Nth Xs I}
X2 = {Nth Xs I+1}
Dx = {Nth Dxs I}
in
{InversionalEquivalentInterval X1 X2 L Dx}
end
{FD.distinctD Xs}
{FD.distinctD Dxs}
%%
{FD.distribute ff Xs}
end
%% Aux
proc {InversionalEquivalentInterval Pitch1 Pitch2 L Interval}
Aux = {FD.decl}
in
Aux =: Pitch2-Pitch1+L
{FD.modI Aux L Interval}
end
end
SearchEngine = {New Search.parallel init(localhost:2)}
{Browse {SearchEngine one(ScriptFunctor $)}}
{SearchEngine close}
On 5 Mar 2009, at 17:44, mark richardson wrote:
Hi,
I have been experimenting with parallel search using the program
below.
Using 1.3.2, the program works fine but I've had problems running the
same program in 1.4.0
Running the program with 1 or 2 forked processes for search works
fine.
However, when trying it with 3 or more processes, at least one of the
processes does not initialise (you get no id value in the
inspector) and
Oz times out with a failure to take ticket error.
Also, and this is very strange, in some of the attempts, when the
error
showed up in the emulator buffer and I scrolled up to look at the
terminal output, where you would expect the error message containing
details about the ticket that has not been taken, there were a large
number of ^H (control-H) characters in red between the characters 'ti'
and 'cket'.
I might guess that the first error could be caused by the speed at
which
Oz attempts to create the three processes in sequence?
But the second error has absolutely confounded me - I have no idea
where
the ^H sequences are coming from.
Just to reiterate, the program works perfectly in 1.3.2 for all the
values I have tried.
Any ideas???
Regards
Mark
declare M E Xs
functor Fractions
import FD
export Script
define
proc {Script Root}
sol(a:A b:B c:C d:D e:E f:F g:G h:H i:I) = Root
BC = {FD.decl}
EF = {FD.decl}
HI = {FD.decl}
in
Root ::: 1#9
{FD.distinct Root}
BC =: 10*B + C
EF =: 10*E + F
HI =: 10*H + I
A*EF*HI + D*BC*HI + G*BC*EF =: BC*EF*HI
{FD.distribute ff Root}
end
end
[M]={Module.apply [Fractions]}
E={New Search.parallel init('mark-laptop':3#sh)}
{Inspect E}
{E trace(true)}
Xs={E all(Fractions $)}
{Browse Xs}
--
Mark Richardson
Final year undergraduate
University of Teesside
______________________________________________________________________
___________
mozart-users mailing list mozart-
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users