Previous Next Contents

22  Interprocess communication toolbox

"Scilab description"

22.1   AdCommunications advanced communication toolbox for parallel programming




DESCRIPTION :

This the beta version of the Advanced Communications Toolbox (ACT).

This toolbox is based on existing libraries, such as

PVM - Parallel Vitual Machine

PBLAS - Message Passing Library dedicated to Matrix

ScaLapack - Parallel linear algebra Library

ACT manage remote executions of softwares and allow efficient exchanges of messages between those softwares. It offers the possibility to exploit numerous machines on a network, as a virtual computer, by creating a distributed group of independent softwares.




See Also : Example X



22.2   Example just to test the environment




DESCRIPTION :

We are the knights who say ni!



22.3   pvm communications with other applications using Parallel Virutal Machine




DESCRIPTION :

PVM is a software system that enables a collection of heterogeneous computers to be used as a coherent and flexible concurrent computational resource.

The individual computers may be shared- or local-memory multiprocessors, vector supercomputers, specialized graphics engines, or scalar workstations, that may be interconnected by a variety of networks, such as ethernet, FDDI.

Daemon programs (pvmd3) provide communication and process control between computers (see PVM manpage and manual for more details).

Most important functions of the PVM communication library are included in Scilab.




WARNING :

PVM must be installed in your envriromnent before using it in Scilab. PVM scilab have been developped using the version 3.3.7 of the PVM library.




AUTHORS :

PVM have been developped by A. L. Beguelin, J. J. Dongarra, G. A. Geist, W. C. Jiang, R. J. Manchek, B. K. Moore, V. S. Sunderam (see http://www.netlib.org/pvm3)




See Also : pvm_barrier X, pvm_mytid X, pvm_bcast X, pvm_parent X, pvm_config X, pvm_delhosts X, pvm_recv X, pvm_exit X, pvm_send X, pvm_getinst X, pvm_spawn X, pvm_gettid X, pvm_spawn_independent X, pvm_gsize X, pvm_tasks X, pvm_joingroup X, pvm_tidtohost X pvm_kill, pvm_lvgroup, pvm_start, pvm_halt



22.4   pvm_addhosts add hosts to the virtual machine.




CALLING SEQUENCE :

[infos] = pvm_addhosts(hosts)



PARAMETERS :




DESCRIPTION :

pvm_addhosts adds the computers named in hosts to the configuration of computers making up the virtual machine. The names should have the same syntax as lines of a pvmd hostfile (see man page for pvmd3): A hostname followed by options of the form xx=y.

The array infos can be checked to determine the status for each host. Values less than zero indicate an error, while positive values are TIDs of the new hosts.

The status of hosts can be requested by the application using pvm_config. If a host fails it will be automatically deleted from the configuration. Using pvm_addhosts a replacement host can be added by the application, however it is the responsibility of the application developer to make his application tolerant of host failure. Another use of this feature would be to add more hosts as they become available, for example on a weekend, or if the application dynamically determines it could use more computational power.




EXAMPLE :

info = pvm_addhosts(["isostar","loop"])



See Also : pvm_delhosts X, pvm_config X



22.5   pvm_barrier blocks the calling process until all processes

in a group have called it.


CALLING SEQUENCE :

[info] = pvm_barrier(group,count)



PARAMETERS :




DESCRIPTION :

pvm_barrier blocks the calling process until count members of the group have called pvm_barrier. The count argument is required because processes could be joining the given group after other processes have called pvm_barrier. Thus PVM doesn't know how many group members to wait for at any given instant. Although count can be set less, it is typically the total number of members of the group. So the logical function of the pvm_barrier call is to provide a group synchronization. During any given barrier call all participating group members must call barrier with the same count value. Once a given barrier has been successfully passed, pvm_barrier can be called again by the same group using the same group name.

If pvm_barrier is successful, info will be 0. If some error occurs then info will be
< 0.




EXAMPLE :

info = pvm_barrier( "worker", pvm_gsize("worker") )



See Also : pvm_joingroup X



22.6   pvm_bcast broacasts a message to all members of a group




CALLING SEQUENCE :

[info] = pvm_bcast(group, buff, msgtag)



PARAMETERS :




DESCRIPTION :

pvm_bcast broadcasts a message to all the members of group. In PVM 3.2 and later the broadcast message is not sent back to the sender. Any PVM task can call pvm_bcast(), it need not be a member of the group. The content of the message can be distinguished by msgtag. If pvm_bcast is successful, info will be 0. If some error occurs then info will be < 0.

pvm_bcast is asynchronous. Computation on the sending processor resumes as soon as the message is safely on its way to the receiving processors. This is in contrast to synchronous communication, during which computation on the sending processor halts until a matching receive is executed by all the receiving processors.

pvm_bcast first determines the tids of the group members by checking a group data base. A multicast is performed to these tids. If the group is changed during a broadcast the change will not be reflected in the broadcast. Multicasting is not supported by most multiprocessor vendors. Typically their native calls only support broadcasting to all the user's processes on a multiprocessor. Because of this omission, pvm_bcast may not be an efficient communication method on some multiprocessors.




EXAMPLE :

info = pvm_bcast( "worker",[12+%i,4,5;3,4+%i,5],10)



See Also : pvm_joingroup X



22.7   pvm_config sends a message




CALLING SEQUENCE :

res =  pvm_config()



PARAMETERS :




DESCRIPTION :

pvm_config returns information about the present virtual machine. The information returned is similar to that available from the console command conf.

The pvm_config
function returns information about the entire virtual machine in one call.

If pvm_config is successful, info will be 0. If some error occurs then info will be
< 0.




EXAMPLE :

res = pvm_config()



See Also : pvm_tasks X



22.8   pvm_delhosts deletes hosts from the virtual machine.




CALLING SEQUENCE :

infos = pvm_delhosts(hosts)



PARAMETERS :




DESCRIPTION :

pvm_delhosts deletes the computers of hosts from the existing configuration of computers making up the virtual machine. All PVM processes and the pvmd running on these computers are killed as the computer is deleted. The array infos can be checked to determine the status of each host. Values less than zero indicate an error, while zero values indicate a success.

If a host fails, the PVM system will continue to function and will automatically delete this host from the virtual machine. It is the responsibility of the application developer to make his application tolerant of host failure.




EXAMPLE :

info = pvm_delhosts(["isostar","loop"])



See Also : pvm_addhosts X



22.9   pvm_exit tells the local pvmd that this process is leaving PVM.




CALLING SEQUENCE :

[info] = pvm_exit()



PARAMETERS :




DESCRIPTION :

pvm_exit tells the local pvmd that this process is leaving PVM. This routine does not kill the process, which can continue to perform tasks just like any other serial process.

pvm_exit should be called by all PVM processes before they stop or exit for good. It must be called by processes that were not started with pvm_spawn.


EXAMPLE  :

pvm_exit()



See Also : pvm X



22.10   pvm_get_timer Gets the system's notion of the current time.




CALLING SEQUENCE :

[time] = pvm_get_timer()



PARAMETERS :




DESCRIPTION :

pvm_get_timer returns the time elapsed since the last call of pvm_get_timer or the last call of pvm_set_timer. The time is expressed in elapsed microseconds. The resolution of the system clock is hardware dependent; the time may be updated continuously or in clock ticks. timer will be > 0. If some error occurs then timer will be -1.




EXAMPLE :

B = rand(100,100);
A = rand(100,100);
pvm_set_timer();C=A*B;t=pvm_get_timer()



See Also : pvm_set_timer X



22.11   pvm_getinst returns the instance number in a group of a PVM process.




CALLING SEQUENCE :

[inum] = pvm_getinst(group, tid)



PARAMETERS :




DESCRIPTION :

pvm_getinst takes a group name group and a PVM task identifier tid and returns the unique instance number that corresponds to the input. It can be called by any task whether in the group or not. If pvm_getinst is successful, inum will be >= 0. If some error occurs then inum will be < 0.




EXAMPLE :

inum = pvm_getinst( "worker", pvm_mytid() )



See Also : pvm_joingroup X, pvm_gettid X



22.12   pvm_gettid returns the tid of the process identified by a

group name and instance number.


CALLING SEQUENCE :

[tid] = pvm_gettid(group, inum)



PARAMETERS :




DESCRIPTION :

pvm_gettid returns the tid of the PVM process identified by the group name group and the instance number inum. If pvm_gettid is successful, tid will be > 0. If some error occurs then tid will be < 0.




EXAMPLE :

tid = pvm_gettid("worker",0)



See Also : pvm_joingroup X, pvm_getinst X



22.13   pvm_gsize returns the number of members presently in the named group.




CALLING SEQUENCE :

[nb] = pvm_gsize(group)



PARAMETERS :




DESCRIPTION :

pvm_gsize returns the size of the group named group. If there is an error nb will be negative.

Since groups can change dynamically in PVM 3.0, this routine can only guarantee to return the instantaneous size of a given group.


EXAMPLE :

nb_worker = pvm_gsize( "worker" ) 



See Also : pvm_joingroup X



22.14   pvm_halt stops the PVM daemon




CALLING SEQUENCE :

[info] = pvm_halt()



PARAMETERS :




DESCRIPTION :

pvm_halt kills all PVM tasks, all the remote daemons, and the local daemon. If the master pvmd is killed manually it should be sent a SIGTERM signal to allow it to kill the remote pvmds and clean up various files. The pvmd can be killed in a manner that leaves the file /tmp/pvmd.uid behind on one or more hosts. Uid is the numeric user ID (from /etc/passwd) of the user. This will prevent PVM from restarting on that host. Deletion of this file will fix this problem: rm `( grep $user /etc/passwd || ypmatch $user passwd ) | awk -F: '{print "/tmp/pvmd."$3; exit}'`

For example:
-->pvm_halt()
 ans  =
 
    0.  
 
-->pvm_halt()
 ans  =
 
  - 14.  
Error -14 means: pvm_halt(): Can't contact local daemon


See Also : pvm_start X, pvm_addhosts X, pvm_config X



22.15   pvm_joingroup enrolls the calling process in a named group.




CALLING SEQUENCE :

[inum] = pvm_joingroup(group)



PARAMETERS :




DESCRIPTION :

pvm_joingroup enrolls the calling task in the group named group and returns the instance number inum of this task in this group. If there is an error inum will be negative.

Instance numbers start at 0 and count up. When using groups a (group, inum) pair uniquely identifies a PVM process. This is consistent with the PVM 2.4 naming schemes. If a task leaves a group by calling pvm_lvgroup and later rejoins the same group, the task is not guaranteed to get the same instance number. PVM attempts to reuse old instance numbers, so when a task joins a group it will get the lowest available instance number. A task can be a member of multiple groups simultaneously.




EXAMPLE :

inum =  pvm_joingroup( "worker" )



See Also : pvm_lvgroup X



22.16   pvm_kill Terminates a specified PVM process.




CALLING SEQUENCE :

[infos] = pvm_kill(tids)



PARAMETERS :




DESCRIPTION :

pvm_kill sends a terminate (SIGTERM) signal to the PVM process identified by tids. In the case of multiprocessors the terminate signal is replaced with a host dependent method for killing a process. If pvm_kill is successful,

The array infos can be checked to determine the status for each process. Values less than zero indicate an error, while zero values indicate a success.

pvm_kill is not designed to kill the calling process. To kill yourself in C call pvm_exit() followed by quit().




EXAMPLE :

info = pvm_kill(262153)



See Also : pvm_exit X



22.17   pvm_lvgroup Unenrolls the calling process from a named group.




CALLING SEQUENCE :

[info] = pvm_lvgroup(group)



PARAMETERS :




DESCRIPTION :

pvm_lvgroup unenrolls the calling process from the group named group. If there is an error info will be negative.

If a process leaves a group by calling either pvm_lvgroup or pvm_exit, and later rejoins the same group, the process may be assigned a new instance number. Old instance numbers are reassigned to processes calling pvm_joingroup.




EXAMPLE :

info = pvm_lvgroup( "worker" )



See Also : pvm_joingroup X



22.18   pvm_mytid returns the tid of the calling process.




CALLING SEQUENCE :

[tid] = pvm_mytid()



PARAMETERS :




DESCRIPTION :

pvm_mytid enrolls this process into PVM on its first call. It also generates a unique tid if this process was not created by pvm_spawn. pvm_mytid returns the tid of the calling process and can be called multiple times in an application.

Any PVM system call (not just pvm_mytid) will enroll a task in PVM if the task is not enrolled before the call.

The tid is a 32 bit positive integer created by the local pvmd. The 32 bits are divided into fields that encode various information about this process such as its location in the virtual machine (i.e. local pvmd address), the CPU number in the case where the process is on a multiprocessor, and a process ID field. This information is used by PVM and is not expected to be used by applications. Applications should not attempt to predict or interpret the tid with the exception of calling tidtohost()

If PVM has not been started before an application calls pvm_mytid the returned tid will be
< 0.




EXAMPLE :

tid = pvm_mytid()



See Also : pvm_tidtohost X, pvm_parent X



22.19   pvm_parent returns the tid of the process that spawned

the calling process.


CALLING SEQUENCE :

tid = pvm_parrent()



PARAMETERS :




DESCRIPTION :

pvm_parent returns the tid of the process that spawned the calling process. If the calling process was not created with pvm_spawn, then tid is set to PvmNoParent=-23




EXAMPLE :

tid = pvm_parent()



See Also : pvm_spawn X



22.20   pvm_recv receive a message.




CALLING SEQUENCE :

[buff, info] = pvm_recv(tid, msgtag)



PARAMETERS :




DESCRIPTION :

pvm_recv blocks the process until a message with label msgtag has arrived from tid. pvm_recv then places the message in buff.

A -1 in msgtag or tid matches anything. This allows the user the following options. If tid = -1 and msgtag is defined by the user, then pvm_recv will accept a message from any process which has a matching msgtag. If msgtag = -1 and tid is defined by the user, then pvm_recv will accept any message that is sent from process tid. If tid = -1 and msgtag = -1, then pvm_recv will accept any message from any process.

The PVM model guarantees the following about message order. If task 1 sends message A to task 2, then task 1 sends message B to task 2, message A will arrive at task 2 before message B. Moreover, if both messages arrive before task 2 does a receive, then a wildcard receive will always return message A.

info will be the status code returned by the routine. If some error occurs then info will be
< 0.

pvm_recv is blocking which means the routine waits until a message matching the user specified tid and msgtag values arrives at the local pvmd. If the message has already arrived then pvm_recv returns immediately with the message.

Once pvm_recv returns, the data in the message can be unpacked into the user's memory using the unpack routines.




EXAMPLE :

[b,info] = pvm_recv(pvm_parent(),100)
g = pvm_recv(pvm_parent(),200)



See Also : pvm_send X, pvm_bcast X



22.21   pvm_send immediately sends (or multicast) data.




CALLING SEQUENCE :

[info] = pvm_send(tids,buff,msgtag)



PARAMETERS :




DESCRIPTION :

pvm_send sends (or multicasts) a message to the PVM process identified in the tids array. Note that the message is not sent to the caller even if listed in the array of tids. msgtag is used to label the content of the message. If pvm_send is successful, info will be 0. If some error occurs then info will be < 0.

The pvm_send routine is asynchronous. Computation on the sending processor resumes as soon as the message is safely on its way to the receiving processor. This is in contrast to synchronous communication, during which computation on the sending processor halts until the matching receive is executed by the receiving processor.

If a multicast is performed, pvm_send first determines which other pvmds contain the specified tasks. Then passes the message to these pvmds which in turn distribute the message to their local tasks without further network traffic.

The PVM model guarantees the following about message order. If task 1 sends message A to task 2, then task 1 sends message B to task 2, message A will arrive at task 2 before message B. Moreover, if both messages arrive before task 2 does a receive, then a wildcard receive will always return message A.

Terminating a PVM task immediately after sending a message or messages from it may result in those messages being lost. To be sure, always call pvm_exit() before stopping.




EXAMPLE :

A = rand(5,5)*(1+%i);
deff('[x]=f(y)','x = 1/y')                       
info = pvm_send([262150, 262152], A(1:2:5,:), 100)      
pvm_send(262146,f,200)          



See Also : pvm_recv X, pvm_bcast X



22.22   pvm_set_timer Sets the system's notion of the current time.




CALLING SEQUENCE :

[info] = pvm_set_timer()



PARAMETERS :




DESCRIPTION :

pvm_set_timer initialized the timer. info will be 0. If some error occurs then info will be -1.




EXAMPLE :

pvm_set_timer()



See Also : pvm_get_timer X



22.23   pvm_spawn Starts new Scilab processes.




CALLING SEQUENCE :

[tids, numt] = pvm_spawn(task,  ntask, [where])



PARAMETERS :




DESCRIPTION :

pvm_spawn starts ntask copies of the scilab script task. On systems that support environment, spawn passes selected variables from parent environment to children tasks. If set, the envar PVM_EXPORT is passed. If PVM_EXPORT contains other names (separated by ':') they will be passed too. This is useful for e.g.:

        setenv DISPLAY myworkstation:0.0
        setenv MYSTERYVAR 13
        setenv PVM_EXPORT DISPLAY:MYSTERYVAR
The hosts on which the PVM processes are started are determined by the where arguments. On return the array tids contains the PVM task identifiers for each process started.

If pvm_spawn starts one or more tasks, numt will be the actual number of tasks started. If a system error occurs then numt will be
< 0. If numt is less than ntask then some executables have failed to start and the user should check the last ntask - numt locations in the tids array which will contain error codes (see below for meaning). The first numt tids in the array are always valid.

When the argument where is omitted a heuristic (round-robin assignment) is used to distribute the ntask processes across the virtual machine.

In the special case where a multiprocessor is specified by where, pvm_spawn will start all ntask copies on this single machine using the vendor's underlying routines.




EXAMPLE :

// create an exec file (script)
write(TMPDIR+'/foo.sce',['a=1';'plot2d()'])
// start a new Scilab on the same host to execute the script
[tids, numt] = pvm_spawn(TMPDIR+'/foo.sce',1)
pvm_kill(tids) //terminate the new scilab



See Also : pvm X, pvm_spawn_independent X



22.24   pvm_spawn_independent Starts new PVM processes.




CALLING SEQUENCE :

[tids, numt] = pvm_spawn_independent(task,  ntask, [where])



PARAMETERS :




DESCRIPTION :

pvm_spawn_independent starts ntask copies of the executable named task. On systems that support environment, spawn passes selected variables from parent environment to children tasks. If set, the envar PVM_EXPORT is passed. If PVM_EXPORT contains other names (separated by ':') they will be passed too. This is useful for e.g.:

        setenv DISPLAY myworkstation:0.0
        setenv MYSTERYVAR 13
        setenv PVM_EXPORT DISPLAY:MYSTERYVAR
The hosts on which the PVM processes are started are determined by the where arguments. On return the array tids contains the PVM task identifiers for each process started.

If pvm_spawn_independent starts one or more tasks, numt will be the actual number of tasks started. If a system error occurs then numt will be
< 0. If numt is less than ntask then some executables have failed to start and the user should check the last ntask - numt locations in the tids array which will contain error codes (see below for meaning). The first numt tids in the array are always valid.

When the argument where is omitted a heuristic (round-robin assignment) is used to distribute the ntask processes across the virtual machine.

In the special case where a multiprocessor is specified by where, pvm_spawn_independent will start all ntask copies on this single machine using the vendor's underlying routines.




EXAMPLE :

[tids, numt] = pvm_spawn_independent("a.out",2)



See Also : pvm X, pvm_spawn X



22.25   pvm_start Start the PVM daemon




CALLING SEQUENCE :

[info] = pvm_start()



PARAMETERS :




DESCRIPTION :

pvm_start starts the Pvmd3 which is a daemon process which coordinates unix hosts in a virtual machine. One pvmd3 must run on each host in the group. They provide the communication and process control functions needed by the user's PVM processes. The local and remote pvmds can also be started from the PVM console program pvm.

For example:
pvm_start()
 ans  =
 
    0. 
-->pvm_start()
 ans  =
 
  - 28.  
Error -28 means: pvm_start_pvmd(): Duplicate host


See Also : pvm_halt X, pvm_addhosts X, pvm_config X



22.26   pvm_tasks returns information about the tasks running

on the virtual machine.


CALLING SEQUENCE :

res  = pvm_tasks([where 0])



PARAMETERS :




DESCRIPTION :

pvm_tasks returns information about tasks presently running on the virtual machine. The information returned is the same as that available from the console command ps. The pvm_tasks function returns information about the entire virtual machine in one call.

If pvm_tasks is successful, info will be 0. If some error occurs then info will be
< 0.

for example:
-->res = pvm_tasks()
 res  =
 
       res(1)
 
!   262148.    262151.    262152. !
 
       res(2)
 
!   262147.    0.    262151. !
 
       res(3)
 
!   262144.    262144.    262144. !
 
       res(4)
 
!   6.    4.    6. !
 
       res(5)
 
!pvmgs    /home/ubeda/SCILAB/scilab-2.4/bin/scilex  !
 
       res(6)
 
    3.  
 
       res(7)
 
    0. 



See Also : pvm_config X, pvm_tidtohost X



22.27   pvm_tidtohost returns the host of the specified PVM process.




CALLING SEQUENCE :

[dtid] = pvm_tidtohost(tid)



PARAMETERS :




DESCRIPTION :

pvm_tidtohost returns the host id on which the process identified by tid is located.




EXAMPLE :

dtid = pvm_tidtohost(pvm_mytid())



See Also : pvm_config X, pvm_tasks X



22.28   pvmd3 PVM daemon




SYNOPSIS :

pvmd3 [ -options ] [ hostfile ] &


DESCRIPTION :

pvmd3 is a daemon process which coordinates hosts in a virtual machine. One pvmd must run on each host in the group. They provide the communication and process control functions needed by the user's PVM processes. The daemon can be started manually with a host file argument that will automatically start the remote pvmds. The local and remote pvmds can also be started from the PVM console program pvm.

The name of the daemon executable is pvmd3. It is usually started by a shell script, $PVM_ROOT/lib/pvmd.

Local daemon may also be started by the scilab instruction pvm_start() and remote daemons may also be started by the scilab function pvm_addhosts




OPTIONS :

The following options may be specified on the command line when starting the master pvmd or PVM console: The following options are used by the master pvmd when starting slaves and are only of interest to someone writing a hoster. Don't just go using them, now. Lines beginning with a splat ( # ), optionally preceded by whitespace, are ignored.

-1

A simple host file might look like:
# my first host file
thud
fred
wilma
barney
betty
This specifies the names of five hosts to be configured in the virtual machine.

The master pvmd for a group is started by hand on the localhost, and it starts slaves on each of the remaining hosts using the rsh or rexec command. The master host may appear on any line of the hostfile, but must have an entry.

The simple format above works fine if you have the same login name on all five machines and the name of the master host in your .rhosts files on the other four.

There are several host file options available:
Host options can be set without starting the hosts automatically. Information on host file lines beginning with `&' is stored, but the hosts are not started until added using pvm_addhosts().

Example hostfile:
# hostfile for testing on various platforms fonebone
refuge
# installed in /usr/local/here

sigi.cs
     dx=/usr/local/pvm3/lib/pvmd # borrowed accts, "guest", don't trust fonebone 



MANUAL STARTUP :

When adding a host with this option set you will see on the tty of the pvmd:
*** Manual startup ***
Login to "honk" and type:
$PVM_ROOT/lib/pvmd -S -d0 -nhonk 1 80a9ca95:0cb6 4096 2 80a95c43:0000 Type response:
after typing the given command on host honk, you should see a line like:
ddpro<2312> arch<ALPHA> ip<80a95c43:0a8e> mtu<4096>
type this line on the tty of the master pvmd. You should then see:
Thanks
and the two pvmds should be able to communicate.

Note you can't start the master using the console or background it when using this option.




STOPPING PVMD3 :

The preferred method of stopping all the pvmds is to give the halt command in the PVM console. This kills all pvm tasks, all the remote daemons, the local daemon, and finally the console itself. If the master pvmd is killed manually it should be sent a SIGTERM signal to allow it to kill the remote pvmds and clean up various files.

The pvmd can be killed in a manner that leaves the file /tmp/pvmd.uid behind on one or more hosts. Uid is the numeric user ID (from /etc/passwd) of the user. This will prevent PVM from restarting on that host. Deletion of this file will fix this problem:
rm `( grep $user /etc/passwd || ypmatch $user passwd ) | \\
        awk -F: `{print "/tmp/pvmd."$3; exit}'`

22.29   Communications communications with other applications using GeCi




DESCRIPTION :

This the beta version of the Communications Toolbox.

GeCi manages communications between Scilab and other applications (included Scilab itself) by using GeCi.

GeCI is an interactive communication manager created in order to manage remote executions of softwares and allow exchanges of messages between those softwares. It offers the possibility to exploit numerous machines on a network, as a virtual computer, by creating a distributed group of independent softwares.

In order to communicate, the other applications must have been prepared for, by including a communication library in them. The way to do this is described in the Communication Toolbox documentation.


See Also : CreateLink X, DestroyLink X, ExecAppli X, GetMsg X, SendMsg X, WaitMsg X



22.30   CreateLink creates a link between two applications




CALLING SEQUENCE :

CreateLink(appli1,appli2)



PARAMETERS :




DESCRIPTION :

CreateLink creates a link from appli1 to appli2. Note that this link is directed. This link being created, appli1 can send messages to appli2 and appli2 can receive messages from appli1.

If the name of appli1
or appli2 is "SELF", it corresponds to the name of the application where we execute CreateLink.

If the name of appli1
or appli2 is "XGeCI", it corresponds to the name of the first Scilab application started.


See Also : DestroyLink X, GetMsg X, SendMsg X



22.31   DestroyLink destroys the link between two applications




CALLING SEQUENCE :

DestroyLink(appli1,appli2)



PARAMETERS :




DESCRIPTION :

DestroyLink destroys the link from appli1 to appli2.

If the name of appli1
or appli2 is "SELF", it corresponds to the name of the application where we execute DestroyLink.

If the name of appli1
or appli2 is "XGeCI", it corresponds to the name of the first Scilab application started.


See Also : CreateLink X



22.32   ExecAppli executes an application




CALLING SEQUENCE :

ExecAppli(command,h,appli)



PARAMETERS :




DESCRIPTION :

ExecAppli executes the application described by command on the host h and gives it the name appli. Arguments of the application can be also given in the string command.

After executing ExecAppli
, it is necessary to create links with CreateLink to be able to send messages between applications.


EXAMPLE :

h=unix_g("hostname")
ExecAppli(SCI+"/bin/scilex",h,"Scilab2")
CreateLink("SELF","Scilab2")
ExecAppli(SCI+"/bin/scilex -ns",h,"Scilab3")



See Also : CreateLink X, ExecScilab X, ExeclScilab X



22.33   ExecScilab executes another local Scilab




CALLING SEQUENCE :

ExecScilab(appli)



PARAMETERS :




DESCRIPTION :

ExecScilab executes a new Scilab application on the same host.

After executing ExecScilab
, it is necessary to create links with CreateLink to be able to send messages to new Scilab.

Use ExecAppli
to execute a new Scilab application on a remote host.


See Also : CreateLink X, ExecAppli X, ExeclScilab X



22.34   ExeclScilab executes another linked local Scilab




CALLING SEQUENCE :

ExeclScilab(appli)



PARAMETERS :




DESCRIPTION :

ExecScilab executes a new Scilab application on the same host and creates links between them.

Use ExecAppli
to execute a new Scilab application on a remote host.


See Also : CreateLink X, ExecAppli X, ExecScilab X



22.35   GetMsg gets a pending message




CALLING SEQUENCE :

[type,msg,appli] = GetMsg()



PARAMETERS :




DESCRIPTION :

GetMsg gets, in an asynchronous way, a message sent by another application. The type of the message is string and the message itself is msg. The name of the application which has sent the message is appli,


See Also : SendMsg X, WaitMsg X



22.36   SendMsg sends a message




CALLING SEQUENCE :

SendMsg(type,msg)



PARAMETERS :




DESCRIPTION :

SendMsg sends a message to ALL applications linked to this application.


See Also : CreateLink X, SendMsg X, WaitMsg X



22.37   WaitMsg waits for a message




CALLING SEQUENCE :

[type,msg] = WaitMsg(appli)



PARAMETERS :




DESCRIPTION :

WaitMsg waits for a message sent by another application. As long as any message has not been sent, WaitMsg waits. This is a way to send and get messages in a synchronous way. The type of the message is string and the message itself is msg.

By default the name of the first application (the one executed by GeCi) is "XGeCI".


See Also : GetMsg X, SendMsg X


Previous Next Contents