File: demo.g

package info (click to toggle)
gap-scscp 2.2.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,696 kB
  • sloc: xml: 1,226; sh: 388; makefile: 19
file content (77 lines) | stat: -rw-r--r-- 3,113 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
###########################################################################
#
# This is a GAP demonstration file
# To run a demonstration enter the following:
# gap> LogTo(); # (if you are logging to a file)
# gap> ReadLib("demo.g");
# gap> Demonstration("demo.g");
# (probably you will need the full path in the last 
# command). Then you may press <Enter> to go to the 
# next step or press <q> to terminate demonstration
#
# -------------------------------------------------
#
port:=26133;
stream:=InputOutputTCPStream( "localhost", port );
ReadLine( stream );
WriteLine( stream, "<?scscp version=\"1.2\" ?>" );
ReadLine( stream );

WriteLine( stream, "<?scscp start ?>");
WriteLine( stream, "<OMOBJ><OMI>1</OMI></OMOBJ>");
WriteLine( stream, "<?scscp end ?>");

s:=OMGetObjectWithAttributes( stream );

WriteLine( stream, "<?scscp start ?>");
WriteLine( stream, "<OMOBJ><OMA><OMS cd=\"scscp1\" name=\"procedure_call\"/><OMSTR>WS_Factorial</OMSTR><OMI>5</OMI></OMA></OMOBJ>" );
WriteLine( stream, "<?scscp end ?>");

s:=OMGetObjectWithAttributes( stream );

WriteLine( stream, "<?scscp start ?>");
WriteLine( stream, "<OMOBJ><OMATTR><OMATP><OMS cd=\"scscp1\" name=\"call_id\"/><OMSTR>alexk_9053</OMSTR></OMATP><OMA><OMS cd=\"scscp1\" name=\"procedure_call\" /><OMSTR>WS_Factorial</OMSTR><OMI>1713</OMI></OMA></OMATTR></OMOBJ>" );
WriteLine( stream, "<?scscp end ?>");

s:=OMGetObjectWithAttributes( stream );

OMPutProcedureCall ( stream, "WS_Factorial", rec( object:= [5] ) );
s:=OMGetObjectWithAttributes( stream );
OMPutProcedureCall ( stream, "WS_Factorial", rec( object:=[ 120 ] ) );
s:=OMGetObjectWithAttributes( stream );
OMPutProcedureCall ( stream, "GroupIdentificationService", rec( object:=[ [(1,2),(1,2,3)] ] ) );
s:=OMGetObjectWithAttributes( stream );
OMPutProcedureCall( stream, 
    "WS_Factorial", 
    rec( object:= [ 5 ], 
         attributes:=[ [ "call_id", "user007" ],
                       ["option_runtime",1000],
                       ["option_min_memory",1024],
                       ["option_max_memory",2048],
                       ["option_debuglevel",1],
                       ["option_return_object"] ] ) );;
s:=OMGetObjectWithAttributes( stream );
OMPutProcedureCall( stream, 
    "GroupIdentificationService",
    rec( object:= [ [(2,3,1),(1,2,4,3)] ],
         attributes:=[ [ "call_id", "user007" ],
                       ["option_runtime",5000],
                       ["option_min_memory",2048],
                       ["option_max_memory",4096],
                       ["option_debuglevel",2],
                       ["option_return_object"] ] ) );;
s:=OMGetObjectWithAttributes( stream );
CloseStream( stream );

ReadPackage("scscp", "example/idperm.g");
IdGroupWS(SymmetricGroup(3));
IdGroupWS(SymmetricGroup(4));
IdGroupWS(SymmetricGroup(5));
IdGroupWS(SymmetricGroup(6));

s:=StoreAsRemoteObject( SymmetricGroup(3), "localhost", 26133 );
EvaluateBySCSCP("WS_IdGroup",[s],"localhost",26133);  
RetrieveRemoteObject(s);
UnbindRemoteObject(s);

ParQuickWithSCSCP( [ "WS_FactorsECM", "WS_FactorsMPQS" ], [ 2^150+1 ], [ "localhost", "localhost" ], [ 26133, 26134 ] );