CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
1 Preface
3
4
The GAP package SCSCP implements the Symbolic Computation Software
5
Composability protocol [FHK+b]. This protocol specifies an OpenMath-based
6
remote procedure call framework, in which all messages (procedure calls and
7
returns of results of successful computation or error messages) are encoded
8
in OpenMath using content dictionaries scscp1 and scscp2 ([FHK+a], [FHK+c]).
9
Using the SCSCP package, GAP can communicate locally or remotely with any
10
other OpenMath-enabled SCSCP-compliant application which may be not only
11
another computer algebra system but also another instance of the GAP system
12
or even, for example, an external Java or C/C++ application via libraries
13
http://java.symcomp.org/ or http://www.imcce.fr/Equipes/ASD/trip/scscp/
14
providing an SCSCP API. Such communication will go into seamless manner for
15
the GAP user, since all conversions from GAP to OpenMath and vice versa will
16
be performed in the background. See the SCIEnce project homepage
17
http://www.symbolic-computing.org/ for the details about computer algebra
18
systems and other sotware supporting SCSCP
19
20
The SCSCP package for GAP has two main components:
21
22
 SCSCP server;
23
24
 SCSCP client.
25
26
There are several ways to start GAP SCSCP server:
27
28
 call RunSCSCPserver (5.2-1) from the GAP session specifying the server
29
name and the port number from the GAP session;
30
31
 start GAP as gap myserver.g, where myserver.g is the server
32
configuration file with the last command being the call of
33
RunSCSCPserver (5.2-1) (an example of such configuration file is given
34
in scscp/example/myserver.g );
35
36
 start GAP as a daemon using the script gapd.sh which is supplied in
37
the root directory of the package (for the description of all
38
available options see comments in gapd.sh).
39
40
During startup the server installs all procedures that it will provide and
41
loads their lookup mechanisms, and then begins to listen to the specified
42
port. The recommended port number is 26133 which has been assigned to SCSCP
43
by the Internet Assigned Numbers Authority (IANA) in November 2007, see
44
http://www.iana.org/assignments/port-numbers.
45
46
When the server accepts a connection from client, it starts the
47
"accept-evaluate-return" loop:
48
49
 accepts the "procedure_call"; message;
50
51
 performs lookup of the appropriate GAP function;
52
53
 evaluates the result (or produces a side-effect);
54
55
 returns the result in the "procedure_completed" message or returns an
56
error in the "procedure_terminated" message.
57
58
The server works in a "multi-user" mode. When one client is connected, the
59
server is busy for other clients. As soon as the computation is finished and
60
the client is disconnected, the server is waiting for the next connection,
61
and normally it never stops until it will be terminated by the service
62
provider. The server maintain a queue of five incoming connections (this
63
parameter can be easily modified), and on each iteration evaluates the next
64
request from the queue.
65
66
There is an SCSCP server accessible at scscp.gap-system.org, port 26133. It
67
is running under development versions of the GAP system and a selection of
68
currently distributed packages. The reader is encouraged to try to use
69
examples from the manual to access this service, replacing "localhost" by
70
its address, where appropriate. Please report to Alexander Konovalov if you
71
will discover any bugs or if the server seems not available.
72
73
The SCSCP client:
74
75
 establishes connection with the specified server at the specified
76
port;
77
78
 sends the "procedure_call" message to the server;
79
80
 waits for the result of the computation or returns to pick it up
81
later;
82
83
 fetches the response, extracting the result from the
84
"procedure_completed" message or entering the break loop in the case
85
of the "procedure_terminated" message.
86
87
On the top of this functionality we built a set of instructions for simple
88
parallel computations framework using the SCSCP protocol, which allows to
89
send several procedure calls in parallel and then collect all results or
90
pick up the first available result, and implements the master-worker
91
skeleton. These tools are presented in the Chapter 8.
92
93
The package also implements a new kind of GAP input-output streams, namely
94
input-output TCP streams (see Chapter 3), based on the functionality for
95
TCP/IP protocol usage provided by the GAP package IO. Such streams may
96
constitute an independent interest for adapting streams-using GAP code to
97
use streams across the network.
98
99
Finally, the manual describes how the communication by SCSCP goes between
100
several instances of the GAP system, but the same behaviour is expected from
101
any SCSCP-compliant application: the set of supported OpenMath symbols
102
clearly will be different, but the rules of communication are precisely
103
specified in the SCSCP specification [FHK+b]. See the homepage of the
104
SCIEnce project http://www.symbolic-computing.org/ for the information about
105
SCSCP-compliant computer algebra systems and other tools developed in the
106
project.
107
108
109