Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
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
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X9 [33X[0;0YService functions[133X[101X234[1X9.1 [33X[0;0YPinging [5XSCSCP[105X[101X[1X servers[133X[101X56[1X9.1-1 PingSCSCPservice[101X78[29X[2XPingSCSCPservice[102X( [3Xhostname[103X, [3Xportnumber[103X ) [32X function9[6XReturns:[106X [33X[0;10Y[9Xtrue[109X or [9Xfail[109X[133X1011[33X[0;0YThis function returns [9Xtrue[109X if the client can establish connection with the12SCSCP server at [3Xhostname[103X:[3Xportnumber[103X. Otherwise, it returns [9Xfail[109X.[133X1314[4X[32X Example [32X[104X15[4X[28X[128X[104X16[4X[25Xgap>[125X [27XPingSCSCPservice("localhost",26133);[127X[104X17[4X[28Xtrue[128X[104X18[4X[25Xgap>[125X [27XPingSCSCPservice("localhost",26140); [127X[104X19[4X[28XError: rec([128X[104X20[4X[28X message := "Connection refused",[128X[104X21[4X[28X number := 61 )[128X[104X22[4X[28Xfail[128X[104X23[4X[28X[128X[104X24[4X[32X[104X2526[1X9.1-2 PingStatistic[101X2728[29X[2XPingStatistic[102X( [3Xhostname[103X, [3Xportnumber[103X, [3Xn[103X ) [32X function29[6XReturns:[106X [33X[0;10Ynothing[133X3031[33X[0;0YThe function is similar to the UNIX [10Xping[110X. It tries [3Xn[103X times to establish32connection with the SCSCP server at [3Xhostname[103X:[3Xportnumber[103X, and then displays33statistical information.[133X3435[4X[32X Example [32X[104X36[4X[28X[128X[104X37[4X[25Xgap>[125X [27XPingStatistic("localhost",26133,1000);[127X[104X38[4X[28X1000 packets transmitted, 1000 received, 0% packet loss, time 208ms[128X[104X39[4X[28Xmin/avg/max = [ 0, 26/125, 6 ][128X[104X40[4X[28X[128X[104X41[4X[32X[104X424344[1X9.2 [33X[0;0YInfo classes for [5XSCSCP[105X[101X[1X[133X[101X4546[1X9.2-1 InfoSCSCP[101X4748[29X[2XInfoSCSCP[102X[32X info class4950[33X[0;0Y[2XInfoSCSCP[102X is a special Info class for the [5XSCSCP[105X package. The amount of51information to be displayed can be specified by the user by setting52InfoLevel for this class from 0 to 4, and the default value of InfoLevel for53the package is specified in the file [11Xscscp/config.g[111X. The higher the level54is, the more information will be displayed. To change the InfoLevel to [10Xk[110X,55use the command [10XSetInfoLevel(InfoSCSCP, k)[110X. In the following examples we56demonstrate various degrees of output details using Info messages.[133X5758[33X[0;0YDefault Info level:[133X5960[4X[32X Example [32X[104X61[4X[28X[128X[104X62[4X[25Xgap>[125X [27XSetInfoLevel(InfoSCSCP,2); [127X[104X63[4X[25Xgap>[125X [27XEvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); [127X[104X64[4X[28X#I Creating a socket ...[128X[104X65[4X[28X#I Connecting to a remote socket via TCP/IP ...[128X[104X66[4X[28X#I Got connection initiation message[128X[104X67[4X[28X#I <?scscp service_name="GAP" service_version="4.dev" service_id="localhost:2\[128X[104X68[4X[28X6133:286" scscp_versions="1.0 1.1 1.2 1.3" ?>[128X[104X69[4X[28X#I Requesting version 1.3 from the server ...[128X[104X70[4X[28X#I Server confirmed version 1.3 to the client ...[128X[104X71[4X[28X#I Request sent ...[128X[104X72[4X[28X#I Waiting for reply ...[128X[104X73[4X[28X#I <?scscp start ?>[128X[104X74[4X[28X#I <?scscp end ?>[128X[104X75[4X[28X#I Got back: object 3628800 with attributes [128X[104X76[4X[28X[ [ "call_id", "localhost:26133:286:JL6KRQeh" ] ][128X[104X77[4X[28Xrec( attributes := [ [ "call_id", "localhost:26133:286:JL6KRQeh" ] ], [128X[104X78[4X[28X object := 3628800 )[128X[104X79[4X[28X[128X[104X80[4X[32X[104X8182[33X[0;0YMinimal Info level:[133X8384[4X[32X Example [32X[104X85[4X[28X[128X[104X86[4X[25Xgap>[125X [27XSetInfoLevel(InfoSCSCP,0); [127X[104X87[4X[25Xgap>[125X [27XEvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133);[127X[104X88[4X[28Xrec( attributes := [ [ "call_id", "localhost:26133:286:jzjsp6th" ] ], [128X[104X89[4X[28X object := 3628800 )[128X[104X90[4X[28X[128X[104X91[4X[32X[104X9293[33X[0;0YVerbose Info level:[133X9495[4X[32X Example [32X[104X96[4X[28X[128X[104X97[4X[25Xgap>[125X [27XSetInfoLevel(InfoSCSCP,3);[127X[104X98[4X[25Xgap>[125X [27XEvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133);[127X[104X99[4X[28X#I Creating a socket ...[128X[104X100[4X[28X#I Connecting to a remote socket via TCP/IP ...[128X[104X101[4X[28X#I Got connection initiation message[128X[104X102[4X[28X#I <?scscp service_name="GAP" service_version="4.dev" service_id="localhost:2\[128X[104X103[4X[28X6133:286" scscp_versions="1.0 1.1 1.2 1.3" ?>[128X[104X104[4X[28X#I Requesting version 1.3 from the server ...[128X[104X105[4X[28X#I Server confirmed version 1.3 to the client ...[128X[104X106[4X[28X#I Composing procedure_call message: [128X[104X107[4X[28X<?scscp start ?>[128X[104X108[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X109[4X[28X <OMATTR>[128X[104X110[4X[28X <OMATP>[128X[104X111[4X[28X <OMS cd="scscp1" name="call_id"/>[128X[104X112[4X[28X <OMSTR>localhost:26133:286:Jok6cQAf</OMSTR>[128X[104X113[4X[28X <OMS cd="scscp1" name="option_return_object"/>[128X[104X114[4X[28X <OMSTR></OMSTR>[128X[104X115[4X[28X </OMATP>[128X[104X116[4X[28X <OMA>[128X[104X117[4X[28X <OMS cd="scscp1" name="procedure_call"/>[128X[104X118[4X[28X <OMA>[128X[104X119[4X[28X <OMS cd="scscp_transient_1" name="WS_Factorial"/>[128X[104X120[4X[28X <OMI>10</OMI>[128X[104X121[4X[28X </OMA>[128X[104X122[4X[28X </OMA>[128X[104X123[4X[28X </OMATTR>[128X[104X124[4X[28X</OMOBJ>[128X[104X125[4X[28X<?scscp end ?>[128X[104X126[4X[28X#I Total length 396 characters [128X[104X127[4X[28X#I Request sent ...[128X[104X128[4X[28X#I Waiting for reply ...[128X[104X129[4X[28X#I <?scscp start ?>[128X[104X130[4X[28X#I Received message: [128X[104X131[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X132[4X[28X <OMATTR>[128X[104X133[4X[28X <OMATP>[128X[104X134[4X[28X <OMS cd="scscp1" name="call_id"/>[128X[104X135[4X[28X <OMSTR>localhost:26133:286:Jok6cQAf</OMSTR>[128X[104X136[4X[28X </OMATP>[128X[104X137[4X[28X <OMA>[128X[104X138[4X[28X <OMS cd="scscp1" name="procedure_completed"/>[128X[104X139[4X[28X <OMI>3628800</OMI>[128X[104X140[4X[28X </OMA>[128X[104X141[4X[28X </OMATTR>[128X[104X142[4X[28X</OMOBJ>[128X[104X143[4X[28X#I <?scscp end ?>[128X[104X144[4X[28X#I Got back: object 3628800 with attributes [128X[104X145[4X[28X[ [ "call_id", "localhost:26133:286:Jok6cQAf" ] ][128X[104X146[4X[28Xrec( attributes := [ [ "call_id", "localhost:26133:286:Jok6cQAf" ] ], [128X[104X147[4X[28X object := 3628800 )[128X[104X148[4X[25Xgap>[125X [27XSetInfoLevel(InfoSCSCP,0);[127X[104X149[4X[28X[128X[104X150[4X[32X[104X151152[1X9.2-2 InfoMasterWorker[101X153154[29X[2XInfoMasterWorker[102X[32X info class155156[33X[0;0Y[10XInfoMasterWorker[110X is a special Info class for the Master-Worker skeleton157[2XParListWithSCSCP[102X ([14X8.2-1[114X). The amount of information to be displayed can be158specified by the user by setting InfoLevel for this class from 0 to 5, and159the default value of InfoLevel for the package is specified in the file160[11Xscscp/config.g[111X. The higher the level is, the more information will be161displayed. To change the InfoLevel to [10Xk[110X, use the command162[10XSetInfoLevel(InfoMasterWorker, k)[110X. In the following examples we demonstrate163various degrees of output details using Info messages.[133X164165[33X[0;0YDefault Info level:[133X166167[4X[32X Example [32X[104X168[4X[28X[128X[104X169[4X[25Xgap>[125X [27XSetInfoLevel(InfoMasterWorker,2);[127X[104X170[4X[25Xgap>[125X [27XParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" );[127X[104X171[4X[28X#I 1/5:master --> localhost:26133[128X[104X172[4X[28X#I 2/5:master --> localhost:26134[128X[104X173[4X[28X#I 3/5:master --> localhost:26133[128X[104X174[4X[28X#I 4/5:master --> localhost:26134[128X[104X175[4X[28X#I 5/5:master --> localhost:26133[128X[104X176[4X[28X[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ][128X[104X177[4X[28X[128X[104X178[4X[32X[104X179180[33X[0;0YMinimal Info level:[133X181182[4X[32X Example [32X[104X183[4X[28X[128X[104X184[4X[25Xgap>[125X [27XSetInfoLevel(InfoSCSCP,0); [127X[104X185[4X[25Xgap>[125X [27XSetInfoLevel(InfoMasterWorker,0);[127X[104X186[4X[25Xgap>[125X [27XParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" );[127X[104X187[4X[28X[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ][128X[104X188[4X[28X[128X[104X189[4X[32X[104X190191[33X[0;0YVerbose Info level:[133X192193[4X[32X Example [32X[104X194[4X[28X[128X[104X195[4X[25Xgap>[125X [27XSetInfoLevel(InfoMasterWorker,5); [127X[104X196[4X[25Xgap>[125X [27XParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" );[127X[104X197[4X[28X#I 1/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 2 ] )[128X[104X198[4X[28X#I 2/5:master --> localhost:26134 : SymmetricGroup( [ 1 .. 3 ] )[128X[104X199[4X[28X#I localhost:26133 --> 1/5:master : [ 2, 1 ][128X[104X200[4X[28X#I 3/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 4 ] )[128X[104X201[4X[28X#I localhost:26134 --> 2/5:master : [ 6, 1 ][128X[104X202[4X[28X#I 4/5:master --> localhost:26134 : SymmetricGroup( [ 1 .. 5 ] )[128X[104X203[4X[28X#I localhost:26133 --> 3/5:master : [ 24, 12 ][128X[104X204[4X[28X#I 5/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 6 ] )[128X[104X205[4X[28X#I localhost:26134 --> 4/5:master : [ 120, 34 ][128X[104X206[4X[28X#I localhost:26133 --> 5/5:master : [ 720, 763 ][128X[104X207[4X[28X[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ][128X[104X208[4X[25Xgap>[125X [27XSetInfoLevel(InfoMasterWorker,2);[127X[104X209[4X[28X[128X[104X210[4X[32X[104X211212213[1X9.3 [33X[0;0YOther [5XSCSCP[105X[101X[1X Utilities[133X[101X214215[1X9.3-1 DateISO8601[101X216217[29X[2XDateISO8601[102X( ) [32X function218[6XReturns:[106X [33X[0;10Ystring[133X219220[33X[0;0YReturns the current date in the ISO-8601 YYYY-MM-DD format. This is an221internal function of the package which is used by the [5XSCSCP[105X server to222generate the transient content dictionary, accordingly to the definition of223the [5XOpenMath[105X symbol [10Xmeta.CDDate[110X.[133X224225[4X[32X Example [32X[104X226[4X[28X[128X[104X227[4X[25Xgap>[125X [27XDateISO8601();[127X[104X228[4X[28X"2017-02-05"[128X[104X229[4X[28X[128X[104X230[4X[32X[104X231232[1X9.3-2 CurrentTimestamp[101X233234[29X[2XCurrentTimestamp[102X( ) [32X function235[6XReturns:[106X [33X[0;10Ystring[133X236237[33X[0;0YReturns the result of the call to [11Xdate[111X. This is an internal function of the238package which is used to add the timestamp to the [5XSCSCP[105X service description.[133X239240[4X[32X Example [32X[104X241[4X[28X[128X[104X242[4X[25Xgap>[125X [27XCurrentTimestamp();[127X[104X243[4X[28X"Tue 30 Jan 2017 11:19:38 BST"[128X[104X244[4X[28X[128X[104X245[4X[32X[104X246247[1X9.3-3 Hostname[101X248249[29X[2XHostname[102X( ) [32X function250[6XReturns:[106X [33X[0;10Ystring[133X251252[33X[0;0YReturns the result of the call to [11Xhostname[111X. This function may be used in the253configuration file [11Xscscp/config.g[111X to specify that the default hostname which254will be used by the [5XSCSCP[105X server will be detected automatically using255[11Xhostname[111X.[133X256257[4X[32X Example [32X[104X258[4X[28X[128X[104X259[4X[25Xgap>[125X [27XHostname();[127X[104X260[4X[28X"scscp.gap-system.org"[128X[104X261[4X[28X[128X[104X262[4X[32X[104X263264[1X9.3-4 MemoryUsageByGAPinKbytes[101X265266[29X[2XMemoryUsageByGAPinKbytes[102X( ) [32X function267[6XReturns:[106X [33X[0;10Yinteger[133X268269[33X[0;0YReturns the current volume of the memory used by [5XGAP[105X in kylobytes. This is270equivalent to calling [11Xps -p <PID> -o vsz[111X, where [10X<PID>[110X is the process ID of271the [5XGAP[105X process. This is an internal function of the package which is used272by the [5XSCSCP[105X server to report its memory usage in the [10Xinfo_memory[110X attribute273when being called with the option [10Xdebuglevel=2[110X (see options in274[2XEvaluateBySCSCP[102X ([14X6.3-1[114X) and [2XNewProcess[102X ([14X6.2-2[114X)).[133X275276[4X[32X Example [32X[104X277[4X[28X[128X[104X278[4X[25Xgap>[125X [27XMemoryUsageByGAPinKbytes();[127X[104X279[4X[28X649848[128X[104X280[4X[28X[128X[104X281[4X[32X[104X282283[1X9.3-5 LastReceivedCallID[101X284285[29X[2XLastReceivedCallID[102X( ) [32X function286[6XReturns:[106X [33X[0;10Ystring[133X287288[33X[0;0YReturns the call ID contained in the most recently received message. It may289contain some useful debugging information; in particular, the call ID for290the [5XGAP[105X [5XSCSCP[105X client and server contains colon-separated server name, port291number, process ID and a random string.[133X292293[4X[32X Example [32X[104X294[4X[28X[128X[104X295[4X[25Xgap>[125X [27XLastReceivedCallID();[127X[104X296[4X[28X"scscp.gap-system.org:26133:77372:choDZBgA"[128X[104X297[4X[28X[128X[104X298[4X[32X[104X299300[1X9.3-6 IO_PickleToString[101X301302[29X[2XIO_PickleToString[102X( [3Xobj[103X ) [32X function303[6XReturns:[106X [33X[0;10Ystring containing "pickled" object[133X304305[33X[0;0YThis function "pickles" or "serialises" the object [3Xobj[103X using the operation306[2XIO_Pickle[102X ([14XIO: IO_Pickle[114X) from the [5XIO[105X package, and writes it to a string,307from which it could be later restored using [2XIO_UnpickleFromString[102X ([14X9.3-7[114X).308This provides a way to design [5XSCSCP[105X procedures which transmit [5XGAP[105X objects in309the "pickled" format as [5XOpenMath[105X strings, which may be useful for objects310which may be "pickled" by the [5XIO[105X package but can not be converted to311[5XOpenMath[105X or for which the "pickled" representation is more compact or can be312encoded/decoded much faster.[133X313314[33X[0;0YSee [2XIO_Pickle[102X ([14XIO: IO_Pickle[114X) and [2XIO_Unpickle[102X ([14XIO: IO_Unpickle[114X) for more315details.[133X316317[4X[32X Example [32X[104X318[4X[28X[128X[104X319[4X[25Xgap>[125X [27Xf := IO_PickleToString( GF( 125 ) );[127X[104X320[4X[28X"FFIEINTG\>15INTG\>13FAIL"[128X[104X321[4X[28X[128X[104X322[4X[32X[104X323324[1X9.3-7 IO_UnpickleFromString[101X325326[29X[2XIO_UnpickleFromString[102X( [3Xs[103X ) [32X function327[6XReturns:[106X [33X[0;10Y"unpickled" GAP object[133X328329[33X[0;0YThis function "unpickles" the string [3Xs[103X which was created using the function330[2XIO_PickleToString[102X ([14X9.3-6[114X), using the operation [2XIO_Unpickle[102X ([14XIO: IO_Unpickle[114X)331from the [5XIO[105X package. See [2XIO_PickleToString[102X ([14X9.3-6[114X) for more details and332suggestions about its usage.[133X333334[4X[32X Example [32X[104X335[4X[28X[128X[104X336[4X[25Xgap>[125X [27XIO_UnpickleFromString( f ); [127X[104X337[4X[28XGF(5^3)[128X[104X338[4X[25Xgap>[125X [27Xf = IO_UnpickleFromString( IO_PickleToString( f ) ); [127X[104X339[4X[28Xtrue[128X[104X340[4X[28X[128X[104X341[4X[32X[104X342343344345