Dear Raphael,
Thank you for your explanation! I now understand (hopefully) what the
problem is in principle. Nevertheless, I am stiff too dense to get my
dummy example running after your explanation. Should I import
ressources within the functor for the script or even within the
script itself?
Nevertheless, even if I define my class in a functor and then link/
apply this functor only within the script I get the error below, so
the class is seemingly still some unusable resources. What am I
missing? Also, why do I get the warning "Unable to reach the net,
using localhost instead" -- this machine certainly has network access.
Thank you!
Best
Torsten
PS: I am using Mozart 1.3.2 (for parallel search..)
declare
%% dummy functor with class
functor MyDataF
import
FD
export
MyClass
define
class MyClass
attr val
meth init(val:?Val<={FD.decl})
@val = Val
end
meth val($) @val end
end
end
Machines = init(localhost:2)
functor ScriptF
import
%% Any ressources except from the Oz base environment must be
treated explicitly for distribution: import any functor needed (FD,
MyData) within the functor/script
FD
export Script
define
%% dummy script
proc {Script Root}
[MyData] = {Module.apply [MyDataF]}
%%
X = {New MyData.myClass init}
Y = {New MyData.myClass init}
Z = {New MyData.myClass init(val: 7)}
in
Root = unit(X Y Z)
%% Avoid constraint equation syntax in distributed programs
{FD.sum [{X val($)} {Y val($)}] '=:' {Z val($)}}
{FD.less {X val($)} {Y val($)}}
%%
{FD.distribute ff [{X val($)} {Y val($)}]}
end
end
%% create search engine for two processes on localhost
SearchEngine = {New Search.parallel Machines}
Solution = {SearchEngine one(ScriptF $)}
*** Warning: Unable to reach the net, using localhost instead
*** Warning: Unable to reach the net, using localhost instead
*** Warning: Unable to reach the net, using localhost instead
%*************************** type error *************************
%**
%** Expected type: class
%** At argument: 1
%** In statement: {Object.newObject <Resource> _<optimized>}
%**
%** Call Stack:
%** procedure 'Apply' in file "/Users/ggutierrez/Work/mozart-1-3-2/
mozart/share/lib/init/ModuleAbstractions.oz", line 33, column 0, PC =
4411568
%**--------------------------------------------------------------
%****************** Error: remote module manager ****************
%**
%** remote(crashed <O: ManagerProxy> apply(<Chunk> 'export'(worker:<P/
1 PS>)))
%**
%** Call Stack:
%** procedure 'ManagerProxy,SyncSend/fast' in file "/Users/ggutierrez/
Work/mozart-1-3-2/mozart/share/lib/dp/Remote.oz", line 196, column 6,
PC = 25622816
%** procedure 'Process,plain/fast' in file "/Users/ggutierrez/Work/
mozart-1-3-2/mozart/share/lib/cp/par/ParProcess.oz", line 48, column
6, PC = 25511900
%** procedure 'MapT' in file "/usr/staff/raph/devel/trunk/mozart/
share/lib/base/Record.oz", line 76, column 3, PC = 4390288
%**--------------------------------------------------------------
--
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
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users