Hi,
One more question below, but first, .....

Thanks Torsten, it did confuse me for a short while, especially because the OPI was convinced it was in the line above?????????
But I found it eventually.

And thanks Raphael, I have it working now although it doesn't seem to help with excessively large numbers. (Although I don't get the virtual memory exhausted message any more, just a very,very slow system :) ). I have a suspicion though that this may be due to the nature of the search tree, not the parallel search itself. At the moment I'm just trying to test it with problem sizes that a single search doesn't cope with.

I just have one more question if someone would be kind enough.......

I presume there is some activity that must be performed on a remote machine to set up Mozart to accept incoming work requests. I've read around the website (although I've probably missed the full explanation) and have seen the computation server info. Is this the type of thing that needs to be executed on a remote machine?

Also, I only use version 1.3.2, because 1.4.0 doesn't (or didn't) work on the odd Vista machine I'm sometimes forced to use but mainly because Ubuntu's Debian repository only has 1.3.2 and I'm too lazy to compile from source! :)

Regards
Mark


Torsten Anders wrote:
Dear Mark,

Just in case: there is a little typo in Raphael's code, a missing parenthesis
Xs={E one({Queens 20} $}

This should read Xs={E one({Queens 20} $)} I can confirm that this example works on Mozart 1.3.2, but please remember that problems for parallel search have been reported for Mozart 1.4.0.

Best,
Torsten

--
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





On 31 Oct 2008, at 11:23, Raphael Collet wrote:

Dear Mark,

The functor that you give to the search engine must export the script of the problem. Here you export a function that creates the script! You should remove the function from your functor, and keep the procedure only:

declare
functor Queensdist
import FD
export Script
define
   proc {Script Row}
      L1N=...
      ...
   end
end

You can even write a function that returns a functor. This makes it possible to generate a script functor for a given size N of the problem (no more hardcoded):

declare
fun {Queens N}
   functor
   import FD
   export Script
   define
      proc {Script Row}
         L1N={MakeTuple c N}
         LM1N={MakeTuple c N}
      in
         {FD.tuple queens N 1#N Row}
         for I in 1..N do
            L1N.I=I LM1N.I=~I
         end
         {FD.distinct Row}
         {FD.distinctOffset Row LM1N}
         {FD.distinctOffset Row L1N}
         {FD.distribute generic(value:mid) Row}
      end
   end
end

E={New Search.parallel init(localhost: 2)}
Xs={E one({Queens 20} $}          % solves Queens for N=20
{Browse Xs}

Cheers,
raph

On Thu, Oct 30, 2008 at 11:50 PM, mark richardson <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi,
    I'm still learning about the FD aspect of Mozart-Oz (amongst
    other things) and I've been toying with using parallel search
    with the n-queens script from the documentation, but with little
    success. This is the code I'm using:

    declare Queensdist E Xs M Host
    functor Queensdist
    import FD
    export Script
    define
     fun {Script}
        proc {$ Row}
       L1N ={MakeTuple c 200}
       LM1N={MakeTuple c 200}
        in
       {FD.tuple queens 200 1#200 Row}
       {For 1 200 1 proc {$ I}
                 L1N.I=I LM1N.I=~I
              end}
       {FD.distinct Row}
       {FD.distinctOffset Row LM1N}
       {FD.distinctOffset Row L1N}
       {FD.distribute generic(value:mid) Row}
        end
     end
    end

    [M]={Module.apply [Queensdist]}
    E={New Search.parallel init(localhost:2)}

    Xs={E one(Queensdist $)}

    {Browse Xs}

    Browsing Xs just gives me [<P/1>]. Can anyone offer any suggestions?

    I'm not certain about the use of localhost as this isn't my host
    name, but the actual hostname doesn't seem to be accepted at all
    and the documentation says that localhost refers to the host that
    spawned the oz process.

    Before this version, I had kept the parametrised version which
    worked on it's own with a {Browse {SearchOne {M.script 200}}} but
    I amended the script to have a fixed value of 200 instead.
    Needless to say, the script won't work either way now???
    So, can this script still be parametrised like the original
    n-queens script and if so how?

    Regards
    Mark

-- Mark Richardson
    Final year undergraduate
    University of Teesside
    
_________________________________________________________________________________
mozart-users mailing list [email protected] <mailto:[email protected]>
    http://www.mozart-oz.org/mailman/listinfo/mozart-users


<ATT00001.txt>

------------------------------------------------------------------------

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users


--
Mark Richardson
Final year undergraduate
University of Teesside
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to