From: gisle@struts.ii.uib.no (Gisle Sælensminde)
Subject: Re: Multiple partitions with GNAT 3.12p
Date: 2000/11/15
Date: 2000-11-15T19:02:29+00:00 [thread overview]
Message-ID: <slrn915ne5.hf7.gisle@struts.ii.uib.no> (raw)
In-Reply-To: 3A12AA18.87990C24@CCI.de
In article <3A12AA18.87990C24@CCI.de>, Vincent Smeets wrote:
>Gisle S�lensminde wrote:
>>
>> I presume you mean compilation unit, and not partition, that means
>> something else in Ada95 terminology (Distributed programming)
>
>No, I mean partitions (from appendix E, Distributed programming).
I'm so sorry.
I made the "hello world" of GLADE, It have a procedure that multiply
its input by three, and returns it, using
a remote call interface. You must specify the pragma for this.
I used the following program:
package A is
pragma remote_call_interface;
function F(I : Integer) return Integer;
end A;
package body A is
function F(I : Integer) return integer is
begin
return 3*I;
end F;
end A;
with A;
with Ada.Text_IO;
procedure B is
begin
Ada.Text_IO.Put_line(A.F(3)'img);
end B;
To make a distributed app, I must make a config file, and run gnat on it.
This file is called b_conf.cfg. "gekko" and "anakonda" are computers on my
local net. The configuartion as used here requere a .rhost file which is
a security risk. You can configure it to use ssh or start the partitions
manually.
configuration Bconf is
pragma Starter (Ada);
pragma Boot_Location ("tcp", "gekko:5557");
B_Part : Partition;
for B_Part'Host use "gekko";
A_Part : Partition := (A);
for A_Part'Host use "anakonda";
procedure B is in B_Part;
end Bconf;
Runing gnatdist I get:
gisle@gekko:218> gnatdist bconf.cfg
gnatdist: checking configuration consistency
------------------------------
---- Configuration report ----
------------------------------
Configuration :
Name : bconf
Main : b
Starter : Ada code
Protocol : tcp://gekko:5557
Partition b_part
Main : b
Host : gekko
Units :
- b (normal)
Partition a_part
Host : anakonda
Units :
- a (rci)
-------------------------------
gnatdist: a caller stubs is up to date
gnatdist: a receiver stubs is up to date
gnatdist: building partition b_part
gnatdist: building partition a_part
gnatdist: generating starter b
Time: 0:49.88 real 3.010 user 2.060 sys 10.1%
gisle@gekko:219> b
9
gisle@gekko:220>
--
Gisle S�lensminde ( gisle@ii.uib.no )
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going
to land, and it could be dangerous sitting under them as they fly
overhead. (from RFC 1925)
next prev parent reply other threads:[~2000-11-15 0:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-15 0:00 Multiple partitions with GNAT 3.12p Vincent Smeets
2000-11-15 0:00 ` Gisle Sælensminde
2000-11-15 0:00 ` Vincent Smeets
2000-11-15 0:00 ` Gisle Sælensminde [this message]
2000-11-16 6:03 ` Vincent Smeets
2000-11-17 0:00 ` Robert Dewar
2000-11-15 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox