Dear George,
Here are answers to your questions.
George Rudolph wrote:
1. The statement "Your scripts do not need rewriting.
They must be wrapped into a functor definition."
seems misleading. You have to figure out what to wrap,
and what to import and export, and how...
A simple rule is to put in the functor all the code that is required to
run the script. The functor should also import all its dependencies,
like the modules FD, etc.
2. If I execute the Fractions functor in the OPI as written,
I get an error about "Fractions" not being a defined variable.
If I leave it off, I get some other error.
"functor Fractions" is similar to "fun {Hello}": you have to declare the
variable Fractions. A simple way is to put a 'declare' statement before
the functor definition:
declare
functor Fractions
...
end
3. Is there anything I have to pickle or configure, beyond
having Mozart installed (with typical env variables set)
on all machines in the cluster?
That's not clear from this section.
Mozart must be installed, and the machines must be reachable by rsh or
ssh. I recommend you put a public ssh key on the remote machines, such
that you don't have to type your password when you ssh on those machines.
About the code: as said above, use a 'declare' statement.
functor
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
E={New Search.parallel init(192.168.2.3:2)}
Ouch, you confuse the compiler here, because it parses 192.168 as a
floating point number! The machine name (or address) must be an atom,
so use single quotes around it:
E={New Search.parallel init('192.168.2.3':2)}
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users