Hi Andreas,

Thanks very much for the reply.
It all makes a lot more sense now certainly.
But, I still can't get my code to work.
I have included the actual code-fragment below.


>> ===============About Remote execution=================
>>
>> I have an agent which has the following functionality:
>>
>> Takes:  (n, s1, s2)
>> Take an integer(n), read something off a channel (given by the ticket : s1)
>> do some work and post something to another channel (given by the   
>> ticket : s2)
>>
>
> Do you mean tickets in the Alice sense? I'm not sure I understand why
> you would want to identify channels with tickets.


I have a producer-consumer pattern;
A main site(process) does boot-strapping which creates 2 channels  
which reside on its site, one for the data for consumption and the  
other for results to be posted to. Both these channels are meant to  
serve as some form of a blackboard, i.e., a place where other agents  
can read data from or post data to.

Then depending on other parameters, a specified number of agents  
should be remotely invoked to read data off the channel-1, process it  
and post results to channel-2

Regarding the tickets bit:
I pack the structure that has a channel & its associated operations  
and offer it; Then i pickle the ticket and put it in a  
specific(hardwired) location.

These pickles get picked up by the worker-agent and they are unpickled  
to get the ticket; and then using a take operation, access to the  
channel is established.

Please let me know if you have any thoughts on doing this in a better way.

> I think what you are trying to do is transferring the doJob function to
> the remote sites and get back proxies from there. Is that correct? To do
> so, you have to create the proxies on the remote sites.

Exactly. Thats what I am trying to do.

Here is a code-fragment:
======================
val myAgentComp =
     comp
         import structure Remote:REMOTE from "x-alice:/lib/distribution/Remote"
     in
         val doJob : unit -> string
     with
         fun doJob1 () = "hello"
         val doJob = Remote.proxy doJob1
     end

val host1 = "hefty"
val s = spawn
let
structure s1 = unpack Remote.run (host1,myAgentComp) : (val doJob :  
unit -> string)
in
s1.doJob()
end
======================

This code fails with exception Remote(_val)

Here is what it says:
s;
val it : string = _failed{|Remote (_val)|}

> Note that myAgentComp creates a proxy each time it's run on a remote
> site. For that it has to import the Remote module on the respective
> site. The component contains the full code of doJob (which has to be

This is what the import announcement does, isn't it?

val myAgentComp =
     comp
         import structure Remote:REMOTE from "x-alice:/lib/distribution/Remote"
     in

Thanks,
Priya

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



_______________________________________________
alice-users mailing list
[email protected]
http://www.ps.uni-sb.de/mailman/listinfo/alice-users

Reply via email to