diff --git a/.gitignore b/.gitignore index 88a5cee..4103189 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ doc/*.six doc/*.tex doc/*.toc doc/*.txt +doc/_*.xml diff --git a/PackageInfo.g b/PackageInfo.g index da07959..4362ad9 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -12,11 +12,6 @@ Subtitle := "Symbolic Computation Software Composability Protocol in GAP", Version := "2.4.4", Date := "27/08/2025", # dd/mm/yyyy format License := "GPL-2.0-or-later", -## <#GAPDoc Label="PKGVERSIONDATA"> -## -## -## -## <#/GAPDoc> SourceRepository := rec( Type := "git", @@ -101,6 +96,29 @@ Dependencies := rec( AvailabilityTest := ReturnTrue, TestFile := "tst/offline.tst", -Keywords := [ "SCSCP", "software composability", "interface", - "parallel computing", "OpenMath" ] +Keywords := [ "SCSCP", "software composability", "interface", + "parallel computing", "OpenMath" ], + +AutoDoc := rec( + entities := rec( + IO := "IO", + OpenMath := "OpenMath", + scscp1 := "scscp1", + scscp2 := "scscp2", + ANUPQ := "ANUPQ", + EdenTV := "EdenTV", + VERSION := ~.Version, + RELEASEYEAR := ~.Date{[7..10]}, + RELEASEDATE := function(date) + local day, month, year, allMonths; + day := Int(date{[1,2]}); + month := Int(date{[4,5]}); + year := Int(date{[7..10]}); + allMonths := [ "January", "February", "March", "April", "May", "June", "July", + "August", "September", "October", "November", "December"]; + return Concatenation(String(day)," ", allMonths[month], " ", String(year)); + end(~.Date), + ), +), + )); diff --git a/doc/manual.xml b/doc/manual.xml index 1172e78..04e75c3 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -2,16 +2,9 @@ -IO"> - OpenMath"> - scscp1"> - scscp2"> - ANUPQ"> - EdenTV"> - SCSCP"> - <#Include Label="PKGVERSIONDATA"> - ] > + +] > diff --git a/makedoc.g b/makedoc.g index e945637..1ae84b7 100644 --- a/makedoc.g +++ b/makedoc.g @@ -1,105 +1,26 @@ -########################################################################### -## -#W makedoc.g The SCSCP package Olexandr Konovalov -#W Steve Linton -## -########################################################################### - -ExtractMyManualExamples:=function( pkgname, main, files ) -local path, tst, i, s, basename, name, output, ch, a, location, pos, comment; -path:=Directory( - Concatenation(PackageInfo(pkgname)[1].InstallationPath, "/doc") ); -Print("Extracting manual examples for ", pkgname, " package ...\n" ); -tst:=ExtractExamples( path, main, files, "Chapter" ); -Print(Length(tst), " chapters detected\n"); -for i in [ 1 .. Length(tst) ] do - Print( "Chapter ", i, " : \c" ); - if Length( tst[i] ) > 0 then - s := String(i); - if Length(s)=1 then - # works for <100 chapters - s:=Concatenation("0",s); - fi; - basename:=Concatenation( LowercaseString(pkgname), s, ".tst" ); - name := Filename( - Directory( - Concatenation( PackageInfo(pkgname)[1].InstallationPath, - "/tst" ) ), basename ); - output := OutputTextFile( name, false ); # to empty the file first - SetPrintFormattingStatus( output, false ); # to avoid line breaks - ch := tst[i]; - AppendTo(output, "# ", pkgname, ", chapter ",i,"\n"); - AppendTo(output, "#\n", - "# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!\n", - "#\n", - "# This file has been autogenerated with GAP. It contains examples\n", - "# extracted from the documentation. Each example is preceded by the\n", - "# comment which points to the location of its source.\n", - "#\n"); - AppendTo(output, "gap> START_TEST( \"", basename, "\");\n\n"); - for a in ch do - location := a[2][1]; - pos := PositionSublist(location,Concatenation(pkgname,"/")); - if pos <> fail then - comment := location{[ pos+Length(pkgname)+1 .. Length(location) ]}; - else - pos := PositionSublist(location,".//"); - comment := location{[ pos+3 .. Length(location) ]}; - fi; - AppendTo(output, "# ", comment, ":", a[2][2], "-", a[2][3], "\n", StripBeginEnd(a[1], "\n"), "\n\n"); - od; - AppendTo(output, "#\ngap> STOP_TEST(\"", basename, "\", 1 );\n"); - Print("extracted ", Length(ch), " examples \n"); - else - Print("no examples \n" ); - fi; -od; -end; - -########################################################################### - -SCSCPMANUALFILES:=[ -"../PackageInfo.g", -"../lib/connect.gd", -"../lib/openmath.gd", -"../lib/process.gd", -"../lib/remote.gd", -"../lib/scscp.gd", -"../lib/utils.g", -"../lib/xstream.gd", -"../par/parlist.g", -"../tracing/tracing.g", -]; - -########################################################################### - -MakeGAPDocDoc( "doc", # path to the directory containing the main file - "manual", # the name of the main file (without extension) - # list of (probably source code) files relative - # to path which contain pieces of documentation - # which must be included in the document - SCSCPMANUALFILES, - "scscp", # the name of the book used by GAP's online help - "../../..",# optional: relative path to the main GAP root - # directory to produce HTML files with relative - # paths to external books. - "MathJax" # optional: use "MathJax", "Tth" and/or "MathML" - # to produce additional variants of HTML files - );; - -# Copy the *.css and *.js files from the styles directory of the GAPDoc -# package into the directory containing the package manual. -CopyHTMLStyleFiles( "doc" ); - -# Create the manual.lab file which is needed if the main manuals or another -# package is referring to your package -GAPDocManualLab( "scscp" );; - -ExtractMyManualExamples( "scscp", "manual.xml", SCSCPMANUALFILES ); - -QUIT; - -########################################################################### -## -#E -## +# +# This file is a script which compiles the package manual. +# +if fail = LoadPackage("AutoDoc", "2022.07.10") then + Error("AutoDoc version 2022.07.10 or newer is required."); +fi; + +AutoDoc(rec( + autodoc := true, + extract_examples := true, + gapdoc := rec( + main := "manual.xml", + files := [ + "lib/connect.gd", + "lib/openmath.gd", + "lib/process.gd", + "lib/remote.gd", + "lib/scscp.gd", + "lib/utils.g", + "lib/xstream.gd", + "par/parlist.g", + "tracing/tracing.g", + ], + ), + scaffold := rec( MainPage := false, TitlePage := false ), +)); diff --git a/tst/scscp01.tst b/tst/scscp01.tst new file mode 100644 index 0000000..e996279 --- /dev/null +++ b/tst/scscp01.tst @@ -0,0 +1,140 @@ +# SCSCP, chapter 4 +# +# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! +# +# This file has been generated by AutoDoc. It contains examples extracted from +# the package documentation. Each example is preceded by a comment which gives +# the name of a GAPDoc XML file and a line range from which the example were +# taken. Note that the XML file in turn may have been generated by AutoDoc +# from some other input. +# +gap> START_TEST("scscp01.tst"); + +# doc/../lib/scscp.gd:492-500 + +gap> s := InputOutputTCPStream("localhost",26133); +< input/output TCP stream to localhost:26133 > +gap> StartSCSCPsession(s); +"localhost:26133:5541" +gap> CloseStream( s ); + + +# doc/../lib/openmath.gd:120-159 + +gap> t:="";; stream:=OutputTextString(t,true);; +gap> 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"] ] ) );; +gap> Print(t); + + + + + + user007 + + 1000 + + 1024 + + 2048 + + 1 + + + + + + + + 5 + + + + + + + +# doc/../lib/openmath.gd:44-77 + +gap> InstallSCSCPprocedure("WS_Factorial", Factorial ); +gap> InstallSCSCPprocedure("GroupIdentificationService", IdGroup ); +gap> InstallSCSCPprocedure("GroupByIdNumber", SmallGroup ); +gap> InstallSCSCPprocedure( "Length", Length, 1, 1 ); +gap> test:=Filename( Directory( Concatenation( +> GAPInfo.PackagesInfo.("scscp")[1].InstallationPath,"/tst/" ) ), +> "omdemo.om" );; +gap> stream:=InputTextFile(test);; +gap> OMGetObjectWithAttributes(stream); +rec( + attributes := [ [ "option_return_object", "" ], [ "call_id", "5rc6rtG62" ] ] + , object := 6 ) +gap> OMGetObjectWithAttributes(stream); +rec( attributes := [ ], object := 1 ) +gap> OMGetObjectWithAttributes(stream); +rec( attributes := [ ], object := 120 ) +gap> OMGetObjectWithAttributes(stream); +rec( + attributes := [ [ "call_id", "alexk_9053" ], [ "option_runtime", 300000 ], + [ "option_min_memory", 40964 ], [ "option_max_memory", 134217728 ], + [ "option_debuglevel", 2 ], [ "option_return_object", "" ] ], + object := [ 24, 12 ] ) +gap> OMGetObjectWithAttributes(stream); +rec( + attributes := [ [ "call_id", "alexk_9053" ], [ "option_return_cookie", "" ] + ], object := ) +gap> OMGetObjectWithAttributes(stream); +rec( attributes := [ [ "call_id", "alexk_9053" ], [ "info_runtime", 1234 ], + [ "info_memory", 134217728 ] ], object := [ 24, 12 ] ) +gap> CloseStream( stream ); + + +# doc/../lib/openmath.gd:184-207 + +gap> t:="";; stream:=OutputTextString(t,true);; +gap> OMPutProcedureCompleted( stream, +> rec(object:=120, +> attributes:=[ [ "call_id", "user007" ] ] ) ); +true +gap> Print(t); + + + + + + user007 + + + + 120 + + + + + + +# doc/openmath.xml:50-68 +gap> stream:=InputOutputTCPStream( "localhost", 26133 ); +< input/output TCP stream to localhost:26133 > +gap> sid := StartSCSCPsession( stream ); +"localhost:26133:5541" +gap> res:=[]; +[ ] +gap> for i in [1..10] do +> OMPutProcedureCall( stream, "WS_Factorial", +> rec( object := [ i ], +> attributes := [ [ "call_id", +> Concatenation( sid, ":", RandomString(8) ) ] ] ) ); +> SCSCPwait( stream ); +> res[i]:=OMGetObjectWithAttributes( stream ).object; +> od; +gap> CloseStream(stream); +gap> res; +[ 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800 ] + +# +gap> STOP_TEST("scscp01.tst", 1); diff --git a/tst/scscp02.tst b/tst/scscp02.tst new file mode 100644 index 0000000..3d62f26 --- /dev/null +++ b/tst/scscp02.tst @@ -0,0 +1,79 @@ +# SCSCP, chapter 5 +# +# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! +# +# This file has been generated by AutoDoc. It contains examples extracted from +# the package documentation. Each example is preceded by a comment which gives +# the name of a GAPDoc XML file and a line range from which the example were +# taken. Note that the XML file in turn may have been generated by AutoDoc +# from some other input. +# +gap> START_TEST("scscp02.tst"); + +# doc/../lib/scscp.gd:727-735 + +gap> GetServiceDescription( "localhost", 26133 ); +rec( + description := "Started with the configuration file scscp/example/myserver.g\ + on Thu 16 Feb 2017 16:03:56 GMT", service_name := "GAP SCSCP service", + version := "GAP 4.8.6 + SCSCP 2.2.1" ) + + +# doc/../lib/scscp.gd:685-704 + +gap> GetAllowedHeads("localhost",26133); +rec( scscp_transient_1 := [ "AClosestVectorCombinationsMatFFEVecFFE", + "Determinant", "GroupIdentificationService", + "IO_UnpickleStringAndPickleItBack", "IdGroup512ByCode", "Identity", + "IsPrimeInt", "Length", "MathieuGroup", "MatrixGroup", + "NormalizedUnitCFcommutator", "NormalizedUnitCFpower", + "NrConjugacyClasses", "NrSmallGroups", "NumberCFGroups", + "NumberCFSolvableGroups", "PointImages", "QuillenSeriesByIdGroup", + "ResetMinimumDistanceService", "SCSCPStartTracing", "SCSCPStopTracing", + "Size", "SylowSubgroup", "WS_AlternatingGroup", "WS_AutomorphismGroup", + "WS_ConwayPolynomial", "WS_Factorial", "WS_FactorsCFRAC", + "WS_FactorsECM", "WS_FactorsMPQS", "WS_FactorsPminus1", + "WS_FactorsPplus1", "WS_FactorsTD", "WS_IdGroup", "WS_LatticeSubgroups", + "WS_Mult", "WS_MultMatrix", "WS_Phi", "WS_PrimitiveGroup", + "WS_SmallGroup", "WS_SymmetricGroup", "WS_TransitiveGroup", "addition" + ] ) + + +# doc/../lib/scscp.gd:854-863 + +gap> IsAllowedHead( "permgp1", "group", "localhost", 26133 ); +true +gap> IsAllowedHead( "setname1", "Q", "localhost", 26133 ); +true +gap> IsAllowedHead( "setname1", "R", "localhost", 26133 ); +false + + +# doc/../lib/scscp.gd:806-823 + +gap> GetTransientCD( "scscp_transient_1", "localhost", 26133 ); +rec( CDDate := "2017-02-08", + CDDefinitions := + [ rec( Description := "Size is currently undocumented.", Name := "Size" ), + rec( Description := "Length is currently undocumented.", + Name := "Length" ), + rec( Description := "NrConjugacyClasses is currently undocumented.", + Name := "NrConjugacyClasses" ), +... + rec( Description := "MatrixGroup is currently undocumented.", + Name := "MatrixGroup" ) ], CDName := "scscp_transient_1", + CDReviewDate := "2017-02-08", CDRevision := "0", CDStatus := "private", + CDVersion := "0", + Description := "This is a transient CD for the GAP SCSCP service" ) + + +# doc/../lib/scscp.gd:768-775 + +gap> GetSignature("scscp_transient_1","WS_Factorial","localhost",26133); +rec( maxarg := 1, minarg := 1, + symbol := rec( cd := "scscp_transient_1", name := "WS_Factorial" ), + symbolargs := rec( cd := "scscp2", name := "symbol_set_all" ) ) + + +# +gap> STOP_TEST("scscp02.tst", 1); diff --git a/tst/scscp03.tst b/tst/scscp03.tst new file mode 100644 index 0000000..27b7b3c --- /dev/null +++ b/tst/scscp03.tst @@ -0,0 +1,214 @@ +# SCSCP, chapter 6 +# +# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! +# +# This file has been generated by AutoDoc. It contains examples extracted from +# the package documentation. Each example is preceded by a comment which gives +# the name of a GAPDoc XML file and a line range from which the example were +# taken. Note that the XML file in turn may have been generated by AutoDoc +# from some other input. +# +gap> START_TEST("scscp03.tst"); + +# doc/../lib/connect.gd:47-61 + +gap> SetInfoLevel( InfoSCSCP, 2 ); +gap> s:=NewSCSCPconnection("localhost",26133); +#I Creating a socket ... +#I Connecting to a remote socket via TCP/IP ... +#I Got connection initiation message +#I +#I Requesting version 1.3 from the server ... +#I Server confirmed version 1.3 to the client ... +< connection to localhost:26133 session_id=localhost:26133:52918 > +gap> CloseSCSCPconnection(s); + + +# doc/../lib/connect.gd:85-92 + +gap> SetInfoLevel( InfoSCSCP, 0 ); +gap> s:=NewSCSCPconnection("localhost",26133); +< connection to localhost:26133 session_id=localhost:26133:52918 > +gap> CloseSCSCPconnection(s); + + +# doc/../lib/process.gd:142-150 + +gap> s := NewProcess( "WS_Factorial", [10], "localhost", 26133 ); +< process at localhost:26133 pid=52918 > +gap> x := CompleteProcess(s); +rec( attributes := [ [ "call_id", "localhost:26133:52918:TPNiMjCT" ] ], + object := 3628800 ) + + +# doc/../lib/scscp.gd:541-554 + +gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); +rec( attributes := [ [ "call_id", "localhost:26133:2442:6hMEN40d" ] ], + object := 3628800 ) +gap> SetInfoLevel(InfoSCSCP,0); +gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133 : output:="cookie" ); +rec( attributes := [ [ "call_id", "localhost:26133:2442:jNQG6rml" ] ], + object := < remote object scscp://localhost:26133/TEMPVarSCSCP5KZIeiKD > ) +gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133 : output:="nothing" ); +rec( attributes := [ [ "call_id", "localhost:26133:2442:9QHQrCjv" ] ], + object := "procedure completed" ) + + +# doc/client.xml:60-71 +gap> G:=SymmetricGroup(4); +Sym( [ 1 .. 4 ] ) +gap> gens:=GeneratorsOfGroup(G); +[ (1,2,3,4), (1,2) ] +gap> EvaluateBySCSCP( "GroupIdentificationService", [ gens ], +> "localhost", 26133 : debuglevel:=3 ); +rec( attributes := [ [ "call_id", "localhost:26133:2442:xOilXtnw" ], + [ "info_runtime", 4 ], [ "info_memory", 2596114432 ], + [ "info_message", "Memory usage for the result is 48 bytes" ] ], + object := [ 24, 12 ] ) + +# doc/client.xml:75-87 +gap> IdGroupWS := function( G ) +> local H, result; +> if not IsPermGroup(G) then +> H:= Image( IsomorphismPermGroup( G ) ); +> else +> H := G; +> fi; +> result := EvaluateBySCSCP ( "GroupIdentificationService", +> [ GeneratorsOfGroup(H) ], "localhost", 26133 ); +> return result.object; +> end;; + +# doc/client.xml:91-96 +gap> G:=DihedralGroup(64); + +gap> IdGroupWS(G); +[ 64, 52 ] + +# doc/client.xml:109-112 +gap> x := [ Z(3)^0, Z(3), 0*Z(3) ]; +[ Z(3)^0, Z(3), 0*Z(3) ] + +# doc/client.xml:114-147 +gap> OMPrint( x ); + + + + + + + + 3 + + 0 + + + + + + 3 + + 1 + + + + + + 3 + + 0 + + + +gap> Length( OMString(x) ); +507 + +# doc/client.xml:282-318 +gap> stream:=InputOutputTCPStream( "localhost", 26133 ); +< input/output TCP stream to localhost:26133 > +gap> StartSCSCPsession(stream); +"localhost:26133:6184" +gap> OMPutProcedureCall( stream, "store_session", +> rec( object := [ SymmetricGroup(3) ], +> attributes := [ [ "call_id", "1" ], +> ["option_return_cookie"] ] ) ); +true +gap> SCSCPwait( stream ); +gap> G:=OMGetObjectWithAttributes( stream ).object; +< remote object scscp://localhost:26133/TEMPVarSCSCPo3Bc8J75 > +gap> OMPutProcedureCall( stream, "PointImages", +> rec( object := [ G, 1 ], +> attributes := [ [ "call_id", "2" ] ] ) ); +true +gap> SCSCPwait( stream ); +gap> OMGetObjectWithAttributes( stream ); +rec( attributes := [ [ "call_id", "2" ] ], object := [ 2 ] ) +gap> OMPutProcedureCall( stream, "PointImages", +> rec( object := [ G, 2 ], +> attributes := [ [ "call_id", "3" ] ] ) ); +true +gap> SCSCPwait( stream ); +gap> OMGetObjectWithAttributes( stream ); +rec( attributes := [ [ "call_id", "3" ] ], object := [ 1, 3 ] ) +gap> OMPutProcedureCall( stream, "retrieve", +> rec( object := [ G ], +> attributes := [ [ "call_id", "4" ] ] ) ); +true +gap> SCSCPwait( stream ); +gap> OMGetObjectWithAttributes( stream ); +rec( attributes := [ [ "call_id", "4" ] ], + object := Group([ (1,2,3), (1,2) ]) ) +gap> CloseStream(stream); + +# doc/../lib/remote.gd:74-79 + +gap> s:=StoreAsRemoteObject( SymmetricGroup(3), "localhost", 26133 ); +< remote object scscp://localhost:26133/TEMPVarSCSCPLvIUUtL3 > + + +# doc/client.xml:344-351 +gap> s![1]; +"TEMPVarSCSCPLvIUUtL3" +gap> s![2]; +"localhost" +gap> s![3]; +26133 + +# doc/client.xml:357-362 +gap> OMPrint(s); + + + + +# doc/client.xml:367-371 +gap> EvaluateBySCSCP("WS_IdGroup",[s],"localhost",26133); +rec( attributes := [ [ "call_id", "localhost:26133:52918:Viq6EWBP" ] ], + object := [ 6, 1 ] ) + +# doc/../lib/remote.gd:105-110 + +gap> RetrieveRemoteObject(s); +Group([ (1,2,3), (1,2) ]) + + +# doc/../lib/remote.gd:134-139 + +gap> UnbindRemoteObject(s); +true + + +# doc/client.xml:381-386 +gap> s:=StoreAsRemoteObject( SymmetricGroup(3), "localhost", 26133 ); +< remote object scscp://localhost:26133/TEMPVarSCSCPNqc8Bkan > +gap> EvaluateBySCSCP( "WS_IdGroup", [ s ], "localhost", 26134 ); +rec( object := [ 6, 1 ], attributes := [ [ "call_id", "localhost:26134:7414" ] ] ) + +# doc/client.xml:390-394 +gap> EvaluateBySCSCP("WS_IdGroup",[s],"localhost",26133 : output:="cookie" ); +rec( attributes := [ [ "call_id", "localhost:26133:52918:mRU6w471" ] ], + object := < remote object scscp://localhost:26133/TEMPVarSCSCPS9SVe9PZ > ) + +# +gap> STOP_TEST("scscp03.tst", 1); diff --git a/tst/scscp04.tst b/tst/scscp04.tst index 75ff5a7..cf1a3ce 100644 --- a/tst/scscp04.tst +++ b/tst/scscp04.tst @@ -1,130 +1,42 @@ -# scscp, chapter 4 +# SCSCP, chapter 7 # # DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! # -# This file has been autogenerated with GAP. It contains examples -# extracted from the documentation. Each example is preceded by the -# comment which points to the location of its source. +# This file has been generated by AutoDoc. It contains examples extracted from +# the package documentation. Each example is preceded by a comment which gives +# the name of a GAPDoc XML file and a line range from which the example were +# taken. Note that the XML file in turn may have been generated by AutoDoc +# from some other input. # -gap> START_TEST( "scscp04.tst"); +gap> START_TEST("scscp04.tst"); -# doc/../lib/scscp.gd:492-500 -gap> s := InputOutputTCPStream("localhost",26133); -< input/output TCP stream to localhost:26133 > -gap> StartSCSCPsession(s); -"localhost:26133:5541" -gap> CloseStream( s ); - -# doc/../lib/openmath.gd:120-159 -gap> t:="";; stream:=OutputTextString(t,true);; -gap> 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"] ] ) );; -gap> Print(t); - - - - - - user007 - - 1000 - - 1024 - - 2048 - - 1 - - - - - - - - 5 - - - - - - -# doc/../lib/openmath.gd:44-77 -gap> InstallSCSCPprocedure("WS_Factorial", Factorial ); -gap> InstallSCSCPprocedure("GroupIdentificationService", IdGroup ); -gap> InstallSCSCPprocedure("GroupByIdNumber", SmallGroup ); -gap> InstallSCSCPprocedure( "Length", Length, 1, 1 ); -gap> test:=Filename( Directory( Concatenation( -> GAPInfo.PackagesInfo.("scscp")[1].InstallationPath,"/tst/" ) ), -> "omdemo.om" );; -gap> stream:=InputTextFile(test);; -gap> OMGetObjectWithAttributes(stream); -rec( - attributes := [ [ "option_return_object", "" ], [ "call_id", "5rc6rtG62" ] ] - , object := 6 ) -gap> OMGetObjectWithAttributes(stream); -rec( attributes := [ ], object := 1 ) -gap> OMGetObjectWithAttributes(stream); -rec( attributes := [ ], object := 120 ) -gap> OMGetObjectWithAttributes(stream); -rec( - attributes := [ [ "call_id", "alexk_9053" ], [ "option_runtime", 300000 ], - [ "option_min_memory", 40964 ], [ "option_max_memory", 134217728 ], - [ "option_debuglevel", 2 ], [ "option_return_object", "" ] ], - object := [ 24, 12 ] ) -gap> OMGetObjectWithAttributes(stream); -rec( - attributes := [ [ "call_id", "alexk_9053" ], [ "option_return_cookie", "" ] - ], object := ) -gap> OMGetObjectWithAttributes(stream); -rec( attributes := [ [ "call_id", "alexk_9053" ], [ "info_runtime", 1234 ], - [ "info_memory", 134217728 ] ], object := [ 24, 12 ] ) -gap> CloseStream( stream ); - -# doc/../lib/openmath.gd:184-207 -gap> t:="";; stream:=OutputTextString(t,true);; -gap> OMPutProcedureCompleted( stream, -> rec(object:=120, -> attributes:=[ [ "call_id", "user007" ] ] ) ); +# doc/examples.xml:67-78 +gap> LoadPackage("anupq", false); true -gap> Print(t); - - - - - - user007 - - - - 120 - - - - +gap> G := DihedralGroup( 512 ); + +gap> F := PqStandardPresentation( G ); + +gap> H := PcGroupFpGroup( F ); + +gap> IdStandardPresented512Group( H ); +[ 512, 2042 ] + +# doc/examples.xml:125-136 +gap> IdGroup512 := function( G ) +> local code, result; +> if Size( G ) <> 512 then +> Error( "G must be a group of order 512 \n" ); +> fi; +> code := CodePcGroup( G ); +> result := EvaluateBySCSCP( "IdGroup512ByCode", [ code ], +> "localhost", 26133 ); +> return result.object; +> end;; -# doc/openmath.xml:50-70 -gap> stream:=InputOutputTCPStream( "localhost", 26133 ); -< input/output TCP stream to localhost:26133 > -gap> sid := StartSCSCPsession( stream ); -"localhost:26133:5541" -gap> res:=[]; -[ ] -gap> for i in [1..10] do -> OMPutProcedureCall( stream, "WS_Factorial", -> rec( object := [ i ], -> attributes := [ [ "call_id", -> Concatenation( sid, ":", RandomString(8) ) ] ] ) ); -> SCSCPwait( stream ); -> res[i]:=OMGetObjectWithAttributes( stream ).object; -> od; -gap> CloseStream(stream); -gap> res; -[ 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800 ] +# doc/examples.xml:142-145 +gap> IdGroup512(DihedralGroup(512)); +[ 512, 2042 ] # -gap> STOP_TEST("scscp04.tst", 1 ); +gap> STOP_TEST("scscp04.tst", 1); diff --git a/tst/scscp05.tst b/tst/scscp05.tst index 6d43c1a..0fe9363 100644 --- a/tst/scscp05.tst +++ b/tst/scscp05.tst @@ -1,67 +1,99 @@ -# scscp, chapter 5 +# SCSCP, chapter 8 # # DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! # -# This file has been autogenerated with GAP. It contains examples -# extracted from the documentation. Each example is preceded by the -# comment which points to the location of its source. +# This file has been generated by AutoDoc. It contains examples extracted from +# the package documentation. Each example is preceded by a comment which gives +# the name of a GAPDoc XML file and a line range from which the example were +# taken. Note that the XML file in turn may have been generated by AutoDoc +# from some other input. # -gap> START_TEST( "scscp05.tst"); - -# doc/../lib/scscp.gd:727-735 -gap> GetServiceDescription( "localhost", 26133 ); -rec( - description := "Started with the configuration file scscp/example/myserver.g\ - on Thu 16 Feb 2017 16:03:56 GMT", service_name := "GAP SCSCP service", - version := "GAP 4.8.6 + SCSCP 2.2.1" ) - -# doc/../lib/scscp.gd:685-704 -gap> GetAllowedHeads("localhost",26133); -rec( scscp_transient_1 := [ "AClosestVectorCombinationsMatFFEVecFFE", - "Determinant", "GroupIdentificationService", - "IO_UnpickleStringAndPickleItBack", "IdGroup512ByCode", "Identity", - "IsPrimeInt", "Length", "MathieuGroup", "MatrixGroup", - "NormalizedUnitCFcommutator", "NormalizedUnitCFpower", - "NrConjugacyClasses", "NrSmallGroups", "NumberCFGroups", - "NumberCFSolvableGroups", "PointImages", "QuillenSeriesByIdGroup", - "ResetMinimumDistanceService", "SCSCPStartTracing", "SCSCPStopTracing", - "Size", "SylowSubgroup", "WS_AlternatingGroup", "WS_AutomorphismGroup", - "WS_ConwayPolynomial", "WS_Factorial", "WS_FactorsCFRAC", - "WS_FactorsECM", "WS_FactorsMPQS", "WS_FactorsPminus1", - "WS_FactorsPplus1", "WS_FactorsTD", "WS_IdGroup", "WS_LatticeSubgroups", - "WS_Mult", "WS_MultMatrix", "WS_Phi", "WS_PrimitiveGroup", - "WS_SmallGroup", "WS_SymmetricGroup", "WS_TransitiveGroup", "addition" - ] ) - -# doc/../lib/scscp.gd:854-863 -gap> IsAllowedHead( "permgp1", "group", "localhost", 26133 ); -true -gap> IsAllowedHead( "setname1", "Q", "localhost", 26133 ); +gap> START_TEST("scscp05.tst"); + +# doc/../lib/process.gd:203-215 + +gap> a:=NewProcess( "WS_Factorial", [10], "localhost", 26133 ); +< process at localhost:26133 pid=2064 > +gap> b:=NewProcess( "WS_Factorial", [20], "localhost", 26134 ); +< process at localhost:26134 pid=1975 > +gap> SynchronizeProcesses(a,b); +[ rec( attributes := [ [ "call_id", "localhost:26133:2064:yCWBGYFO" ] ], + object := 3628800 ), + rec( attributes := [ [ "call_id", "localhost:26134:1975:yAAWvGTL" ] ], + object := 2432902008176640000 ) ] + + +# doc/../lib/process.gd:240-250 + +gap> a:=NewProcess( "WS_Factorial", [10], "localhost", 26133 ); +< process at localhost:26133 pid=2064 > +gap> b:=NewProcess( "WS_Factorial", [20], "localhost", 26134 ); +< process at localhost:26134 pid=1975 > +gap> FirstProcess(a,b); +rec( attributes := [ [ "call_id", "localhost:26133:2064:mdb8RaO2" ] ], + object := 3628800 ) + + +# doc/../lib/scscp.gd:587-594 + +gap> ParQuickWithSCSCP( [ "WS_FactorsECM", "WS_FactorsMPQS" ], [ 2^150+1 ] ); +rec( attributes := [ [ "call_id", "localhost:26133:53877:GQX8MhC8" ] ], + object := [ [ 5, 5, 5, 13, 41, 61, 101, 1201, 1321, 63901 ], + [ 2175126601, 15767865236223301 ] ] ) + + +# doc/../lib/process.gd:282-292 + +gap> a:=NewProcess( "IsPrimeInt", [2^15013-1], "localhost", 26134 ); +< process at localhost:26134 pid=42554 > +gap> b:=NewProcess( "IsPrimeInt", [2^521-1], "localhost", 26133 ); +< process at localhost:26133 pid=42448 > +gap> FirstTrueProcess(a,b); +[ , rec( attributes := [ [ "call_id", "localhost:26133:42448:Lz1DL0ON" ] ], + object := true ) ] + + +# doc/../lib/process.gd:294-306 + +gap> a:=NewProcess( "IsPrimeInt", [2^520-1], "localhost", 26133 ); +< process at localhost:26133 pid=42448 > +gap> b:=NewProcess( "IsPrimeInt", [2^15013-1], "localhost", 26134 ); +< process at localhost:26134 pid=42554 > +gap> FirstTrueProcess(a,b); +[ rec( attributes := [ [ "call_id", "localhost:26133:42448:nvsk8PQp" ] ], + object := false ), + rec( attributes := [ [ "call_id", "localhost:26134:42554:JnEYuXL8" ] ], + object := false ) ] + + +# doc/../lib/scscp.gd:632-647 + +gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); +#I master -> [ "localhost", 26133 ] : SymmetricGroup( [ 1 .. 2 ] ) +#I master -> [ "localhost", 26134 ] : SymmetricGroup( [ 1 .. 3 ] ) +#I [ "localhost", 26133 ] --> master : [ 2, 1 ] +#I master -> [ "localhost", 26133 ] : SymmetricGroup( [ 1 .. 4 ] ) +#I [ "localhost", 26134 ] --> master : [ 6, 1 ] +#I master -> [ "localhost", 26134 ] : SymmetricGroup( [ 1 .. 5 ] ) +#I [ "localhost", 26133 ] --> master : [ 24, 12 ] +#I master -> [ "localhost", 26133 ] : SymmetricGroup( [ 1 .. 6 ] ) +#I [ "localhost", 26133 ] --> master : [ 720, 763 ] +#I [ "localhost", 26134 ] --> master : [ 120, 34 ] +[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] + + +# doc/parallel.xml:168-180 +gap> ReadPackage("scscp", "example/karatsuba.g"); true -gap> IsAllowedHead( "setname1", "R", "localhost", 26133 ); -false - -# doc/../lib/scscp.gd:806-823 -gap> GetTransientCD( "scscp_transient_1", "localhost", 26133 ); -rec( CDDate := "2017-02-08", - CDDefinitions := - [ rec( Description := "Size is currently undocumented.", Name := "Size" ), - rec( Description := "Length is currently undocumented.", - Name := "Length" ), - rec( Description := "NrConjugacyClasses is currently undocumented.", - Name := "NrConjugacyClasses" ), -... - rec( Description := "MatrixGroup is currently undocumented.", - Name := "MatrixGroup" ) ], CDName := "scscp_transient_1", - CDReviewDate := "2017-02-08", CDRevision := "0", CDStatus := "private", - CDVersion := "0", - Description := "This is a transient CD for the GAP SCSCP service" ) - -# doc/../lib/scscp.gd:768-775 -gap> GetSignature("scscp_transient_1","WS_Factorial","localhost",26133); -rec( maxarg := 1, minarg := 1, - symbol := rec( cd := "scscp_transient_1", name := "WS_Factorial" ), - symbolargs := rec( cd := "scscp2", name := "symbol_set_all" ) ) +gap> fam:=FamilyObj(1);; +gap> f:=LaurentPolynomialByCoefficients( fam, +> List([1..32000],i->Random(Integers)), 0, 1 );; +gap> g:=LaurentPolynomialByCoefficients( fam, +> List([1..32000],i->Random(Integers)), 0, 1 );; +gap> t2:=KaratsubaPolynomialMultiplication(f,g);;time; +5892 +gap> t3:=KaratsubaPolynomialMultiplicationWS(f,g);;time; +2974 # -gap> STOP_TEST("scscp05.tst", 1 ); +gap> STOP_TEST("scscp05.tst", 1); diff --git a/tst/scscp06.tst b/tst/scscp06.tst index 884e4ff..0dc86ba 100644 --- a/tst/scscp06.tst +++ b/tst/scscp06.tst @@ -1,198 +1,169 @@ -# scscp, chapter 6 +# SCSCP, chapter 9 # # DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! # -# This file has been autogenerated with GAP. It contains examples -# extracted from the documentation. Each example is preceded by the -# comment which points to the location of its source. +# This file has been generated by AutoDoc. It contains examples extracted from +# the package documentation. Each example is preceded by a comment which gives +# the name of a GAPDoc XML file and a line range from which the example were +# taken. Note that the XML file in turn may have been generated by AutoDoc +# from some other input. # -gap> START_TEST( "scscp06.tst"); +gap> START_TEST("scscp06.tst"); -# doc/../lib/connect.gd:47-61 -gap> SetInfoLevel( InfoSCSCP, 2 ); -gap> s:=NewSCSCPconnection("localhost",26133); +# doc/../lib/scscp.gd:429-439 + +gap> PingSCSCPservice("localhost",26133); +true +gap> PingSCSCPservice("localhost",26140); +Error: rec( + message := "Connection refused", + number := 61 ) +fail + + +# doc/../lib/scscp.gd:463-469 + +gap> PingStatistic("localhost",26133,1000); +1000 packets transmitted, 1000 received, 0% packet loss, time 208ms +min/avg/max = [ 0, 26/125, 6 ] + + +# doc/../lib/scscp.gd:33-53 + +gap> SetInfoLevel(InfoSCSCP,2); +gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); #I Creating a socket ... #I Connecting to a remote socket via TCP/IP ... #I Got connection initiation message #I +6133:286" scscp_versions="1.0 1.1 1.2 1.3" ?> #I Requesting version 1.3 from the server ... #I Server confirmed version 1.3 to the client ... -< connection to localhost:26133 session_id=localhost:26133:52918 > -gap> CloseSCSCPconnection(s); - -# doc/../lib/connect.gd:85-92 -gap> SetInfoLevel( InfoSCSCP, 0 ); -gap> s:=NewSCSCPconnection("localhost",26133); -< connection to localhost:26133 session_id=localhost:26133:52918 > -gap> CloseSCSCPconnection(s); - -# doc/../lib/process.gd:142-150 -gap> s := NewProcess( "WS_Factorial", [10], "localhost", 26133 ); -< process at localhost:26133 pid=52918 > -gap> x := CompleteProcess(s); -rec( attributes := [ [ "call_id", "localhost:26133:52918:TPNiMjCT" ] ], +#I Request sent ... +#I Waiting for reply ... +#I +#I +#I Got back: object 3628800 with attributes +[ [ "call_id", "localhost:26133:286:JL6KRQeh" ] ] +rec( attributes := [ [ "call_id", "localhost:26133:286:JL6KRQeh" ] ], object := 3628800 ) -# doc/../lib/scscp.gd:541-554 + +# doc/../lib/scscp.gd:56-63 + +gap> SetInfoLevel(InfoSCSCP,0); gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); -rec( attributes := [ [ "call_id", "localhost:26133:2442:6hMEN40d" ] ], +rec( attributes := [ [ "call_id", "localhost:26133:286:jzjsp6th" ] ], object := 3628800 ) -gap> SetInfoLevel(InfoSCSCP,0); -gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133 : output:="cookie" ); -rec( attributes := [ [ "call_id", "localhost:26133:2442:jNQG6rml" ] ], - object := < remote object scscp://localhost:26133/TEMPVarSCSCP5KZIeiKD > ) -gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133 : output:="nothing" ); -rec( attributes := [ [ "call_id", "localhost:26133:2442:9QHQrCjv" ] ], - object := "procedure completed" ) - -# doc/client.xml:60-73 -gap> G:=SymmetricGroup(4); -Sym( [ 1 .. 4 ] ) -gap> gens:=GeneratorsOfGroup(G); -[ (1,2,3,4), (1,2) ] -gap> EvaluateBySCSCP( "GroupIdentificationService", [ gens ], -> "localhost", 26133 : debuglevel:=3 ); -rec( attributes := [ [ "call_id", "localhost:26133:2442:xOilXtnw" ], - [ "info_runtime", 4 ], [ "info_memory", 2596114432 ], - [ "info_message", "Memory usage for the result is 48 bytes" ] ], - object := [ 24, 12 ] ) - -# doc/client.xml:77-91 -gap> IdGroupWS := function( G ) -> local H, result; -> if not IsPermGroup(G) then -> H:= Image( IsomorphismPermGroup( G ) ); -> else -> H := G; -> fi; -> result := EvaluateBySCSCP ( "GroupIdentificationService", -> [ GeneratorsOfGroup(H) ], "localhost", 26133 ); -> return result.object; -> end;; - -# doc/client.xml:95-102 -gap> G:=DihedralGroup(64); - -gap> IdGroupWS(G); -[ 64, 52 ] - -# doc/client.xml:115-120 -gap> x := [ Z(3)^0, Z(3), 0*Z(3) ]; -[ Z(3)^0, Z(3), 0*Z(3) ] - -# doc/client.xml:122-157 -gap> OMPrint( x ); + + +# doc/../lib/scscp.gd:66-121 + +gap> SetInfoLevel(InfoSCSCP,3); +gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); +#I Creating a socket ... +#I Connecting to a remote socket via TCP/IP ... +#I Got connection initiation message +#I +#I Requesting version 1.3 from the server ... +#I Server confirmed version 1.3 to the client ... +#I Composing procedure_call message: + - - - - - - - 3 - - 0 - + + + + localhost:26133:286:Jok6cQAf + + + - + - - 3 + + 10 - 1 + + + +#I Total length 396 characters +#I Request sent ... +#I Waiting for reply ... +#I +#I Received message: + + + + + localhost:26133:286:Jok6cQAf + - - - - 3 - - 0 + + 3628800 - - -gap> Length( OMString(x) ); -507 - -# doc/client.xml:295-333 -gap> stream:=InputOutputTCPStream( "localhost", 26133 ); -< input/output TCP stream to localhost:26133 > -gap> StartSCSCPsession(stream); -"localhost:26133:6184" -gap> OMPutProcedureCall( stream, "store_session", -> rec( object := [ SymmetricGroup(3) ], -> attributes := [ [ "call_id", "1" ], -> ["option_return_cookie"] ] ) ); -true -gap> SCSCPwait( stream ); -gap> G:=OMGetObjectWithAttributes( stream ).object; -< remote object scscp://localhost:26133/TEMPVarSCSCPo3Bc8J75 > -gap> OMPutProcedureCall( stream, "PointImages", -> rec( object := [ G, 1 ], -> attributes := [ [ "call_id", "2" ] ] ) ); -true -gap> SCSCPwait( stream ); -gap> OMGetObjectWithAttributes( stream ); -rec( attributes := [ [ "call_id", "2" ] ], object := [ 2 ] ) -gap> OMPutProcedureCall( stream, "PointImages", -> rec( object := [ G, 2 ], -> attributes := [ [ "call_id", "3" ] ] ) ); -true -gap> SCSCPwait( stream ); -gap> OMGetObjectWithAttributes( stream ); -rec( attributes := [ [ "call_id", "3" ] ], object := [ 1, 3 ] ) -gap> OMPutProcedureCall( stream, "retrieve", -> rec( object := [ G ], -> attributes := [ [ "call_id", "4" ] ] ) ); -true -gap> SCSCPwait( stream ); -gap> OMGetObjectWithAttributes( stream ); -rec( attributes := [ [ "call_id", "4" ] ], - object := Group([ (1,2,3), (1,2) ]) ) -gap> CloseStream(stream); - -# doc/../lib/remote.gd:74-79 -gap> s:=StoreAsRemoteObject( SymmetricGroup(3), "localhost", 26133 ); -< remote object scscp://localhost:26133/TEMPVarSCSCPLvIUUtL3 > - -# doc/client.xml:359-368 -gap> s![1]; -"TEMPVarSCSCPLvIUUtL3" -gap> s![2]; -"localhost" -gap> s![3]; -26133 - -# doc/client.xml:374-381 -gap> OMPrint(s); - - + +#I +#I Got back: object 3628800 with attributes +[ [ "call_id", "localhost:26133:286:Jok6cQAf" ] ] +rec( attributes := [ [ "call_id", "localhost:26133:286:Jok6cQAf" ] ], + object := 3628800 ) +gap> SetInfoLevel(InfoSCSCP,0); -# doc/client.xml:386-392 -gap> EvaluateBySCSCP("WS_IdGroup",[s],"localhost",26133); -rec( attributes := [ [ "call_id", "localhost:26133:52918:Viq6EWBP" ] ], - object := [ 6, 1 ] ) -# doc/../lib/remote.gd:105-110 -gap> RetrieveRemoteObject(s); -Group([ (1,2,3), (1,2) ]) +# doc/../lib/scscp.gd:149-160 -# doc/../lib/remote.gd:134-139 -gap> UnbindRemoteObject(s); -true +gap> SetInfoLevel(InfoMasterWorker,2); +gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); +#I 1/5:master --> localhost:26133 +#I 2/5:master --> localhost:26134 +#I 3/5:master --> localhost:26133 +#I 4/5:master --> localhost:26134 +#I 5/5:master --> localhost:26133 +[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] -# doc/client.xml:402-409 -gap> s:=StoreAsRemoteObject( SymmetricGroup(3), "localhost", 26133 ); -< remote object scscp://localhost:26133/TEMPVarSCSCPNqc8Bkan > -gap> EvaluateBySCSCP( "WS_IdGroup", [ s ], "localhost", 26134 ); -rec( object := [ 6, 1 ], attributes := [ [ "call_id", "localhost:26134:7414" ] ] ) -# doc/client.xml:413-419 -gap> EvaluateBySCSCP("WS_IdGroup",[s],"localhost",26133 : output:="cookie" ); -rec( attributes := [ [ "call_id", "localhost:26133:52918:mRU6w471" ] ], - object := < remote object scscp://localhost:26133/TEMPVarSCSCPS9SVe9PZ > ) +# doc/../lib/scscp.gd:163-170 + +gap> SetInfoLevel(InfoSCSCP,0); +gap> SetInfoLevel(InfoMasterWorker,0); +gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); +[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] + + +# doc/../lib/scscp.gd:173-190 + +gap> SetInfoLevel(InfoMasterWorker,5); +gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); +#I 1/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 2 ] ) +#I 2/5:master --> localhost:26134 : SymmetricGroup( [ 1 .. 3 ] ) +#I localhost:26133 --> 1/5:master : [ 2, 1 ] +#I 3/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 4 ] ) +#I localhost:26134 --> 2/5:master : [ 6, 1 ] +#I 4/5:master --> localhost:26134 : SymmetricGroup( [ 1 .. 5 ] ) +#I localhost:26133 --> 3/5:master : [ 24, 12 ] +#I 5/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 6 ] ) +#I localhost:26134 --> 4/5:master : [ 120, 34 ] +#I localhost:26133 --> 5/5:master : [ 720, 763 ] +[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] +gap> SetInfoLevel(InfoMasterWorker,2); + + +# doc/../lib/utils.g:202-207 + +gap> f := IO_PickleToString( GF( 125 ) ); +"FFIEINTG\>15INTG\>13FAIL" + + +# doc/../lib/utils.g:239-246 + +gap> IO_UnpickleFromString( f ); +GF(5^3) +gap> f = IO_UnpickleFromString( IO_PickleToString( f ) ); +true + # -gap> STOP_TEST("scscp06.tst", 1 ); +gap> STOP_TEST("scscp06.tst", 1); diff --git a/tst/scscp07.tst b/tst/scscp07.tst deleted file mode 100644 index 74f9b26..0000000 --- a/tst/scscp07.tst +++ /dev/null @@ -1,40 +0,0 @@ -# scscp, chapter 7 -# -# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! -# -# This file has been autogenerated with GAP. It contains examples -# extracted from the documentation. Each example is preceded by the -# comment which points to the location of its source. -# -gap> START_TEST( "scscp07.tst"); - -# doc/examples.xml:71-84 -gap> LoadPackage("anupq", false); -true -gap> G := DihedralGroup( 512 ); - -gap> F := PqStandardPresentation( G ); - -gap> H := PcGroupFpGroup( F ); - -gap> IdStandardPresented512Group( H ); -[ 512, 2042 ] - -# doc/examples.xml:135-148 -gap> IdGroup512 := function( G ) -> local code, result; -> if Size( G ) <> 512 then -> Error( "G must be a group of order 512 \n" ); -> fi; -> code := CodePcGroup( G ); -> result := EvaluateBySCSCP( "IdGroup512ByCode", [ code ], -> "localhost", 26133 ); -> return result.object; -> end;; - -# doc/examples.xml:154-159 -gap> IdGroup512(DihedralGroup(512)); -[ 512, 2042 ] - -# -gap> STOP_TEST("scscp07.tst", 1 ); diff --git a/tst/scscp08.tst b/tst/scscp08.tst deleted file mode 100644 index 284f95b..0000000 --- a/tst/scscp08.tst +++ /dev/null @@ -1,85 +0,0 @@ -# scscp, chapter 8 -# -# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! -# -# This file has been autogenerated with GAP. It contains examples -# extracted from the documentation. Each example is preceded by the -# comment which points to the location of its source. -# -gap> START_TEST( "scscp08.tst"); - -# doc/../lib/process.gd:203-215 -gap> a:=NewProcess( "WS_Factorial", [10], "localhost", 26133 ); -< process at localhost:26133 pid=2064 > -gap> b:=NewProcess( "WS_Factorial", [20], "localhost", 26134 ); -< process at localhost:26134 pid=1975 > -gap> SynchronizeProcesses(a,b); -[ rec( attributes := [ [ "call_id", "localhost:26133:2064:yCWBGYFO" ] ], - object := 3628800 ), - rec( attributes := [ [ "call_id", "localhost:26134:1975:yAAWvGTL" ] ], - object := 2432902008176640000 ) ] - -# doc/../lib/process.gd:240-250 -gap> a:=NewProcess( "WS_Factorial", [10], "localhost", 26133 ); -< process at localhost:26133 pid=2064 > -gap> b:=NewProcess( "WS_Factorial", [20], "localhost", 26134 ); -< process at localhost:26134 pid=1975 > -gap> FirstProcess(a,b); -rec( attributes := [ [ "call_id", "localhost:26133:2064:mdb8RaO2" ] ], - object := 3628800 ) - -# doc/../lib/scscp.gd:587-594 -gap> ParQuickWithSCSCP( [ "WS_FactorsECM", "WS_FactorsMPQS" ], [ 2^150+1 ] ); -rec( attributes := [ [ "call_id", "localhost:26133:53877:GQX8MhC8" ] ], - object := [ [ 5, 5, 5, 13, 41, 61, 101, 1201, 1321, 63901 ], - [ 2175126601, 15767865236223301 ] ] ) - -# doc/../lib/process.gd:282-292 -gap> a:=NewProcess( "IsPrimeInt", [2^15013-1], "localhost", 26134 ); -< process at localhost:26134 pid=42554 > -gap> b:=NewProcess( "IsPrimeInt", [2^521-1], "localhost", 26133 ); -< process at localhost:26133 pid=42448 > -gap> FirstTrueProcess(a,b); -[ , rec( attributes := [ [ "call_id", "localhost:26133:42448:Lz1DL0ON" ] ], - object := true ) ] - -# doc/../lib/process.gd:294-306 -gap> a:=NewProcess( "IsPrimeInt", [2^520-1], "localhost", 26133 ); -< process at localhost:26133 pid=42448 > -gap> b:=NewProcess( "IsPrimeInt", [2^15013-1], "localhost", 26134 ); -< process at localhost:26134 pid=42554 > -gap> FirstTrueProcess(a,b); -[ rec( attributes := [ [ "call_id", "localhost:26133:42448:nvsk8PQp" ] ], - object := false ), - rec( attributes := [ [ "call_id", "localhost:26134:42554:JnEYuXL8" ] ], - object := false ) ] - -# doc/../lib/scscp.gd:632-647 -gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); -#I master -> [ "localhost", 26133 ] : SymmetricGroup( [ 1 .. 2 ] ) -#I master -> [ "localhost", 26134 ] : SymmetricGroup( [ 1 .. 3 ] ) -#I [ "localhost", 26133 ] --> master : [ 2, 1 ] -#I master -> [ "localhost", 26133 ] : SymmetricGroup( [ 1 .. 4 ] ) -#I [ "localhost", 26134 ] --> master : [ 6, 1 ] -#I master -> [ "localhost", 26134 ] : SymmetricGroup( [ 1 .. 5 ] ) -#I [ "localhost", 26133 ] --> master : [ 24, 12 ] -#I master -> [ "localhost", 26133 ] : SymmetricGroup( [ 1 .. 6 ] ) -#I [ "localhost", 26133 ] --> master : [ 720, 763 ] -#I [ "localhost", 26134 ] --> master : [ 120, 34 ] -[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] - -# doc/parallel.xml:176-190 -gap> ReadPackage("scscp", "example/karatsuba.g"); -true -gap> fam:=FamilyObj(1);; -gap> f:=LaurentPolynomialByCoefficients( fam, -> List([1..32000],i->Random(Integers)), 0, 1 );; -gap> g:=LaurentPolynomialByCoefficients( fam, -> List([1..32000],i->Random(Integers)), 0, 1 );; -gap> t2:=KaratsubaPolynomialMultiplication(f,g);;time; -5892 -gap> t3:=KaratsubaPolynomialMultiplicationWS(f,g);;time; -2974 - -# -gap> STOP_TEST("scscp08.tst", 1 ); diff --git a/tst/scscp09.tst b/tst/scscp09.tst deleted file mode 100644 index 5174ff2..0000000 --- a/tst/scscp09.tst +++ /dev/null @@ -1,147 +0,0 @@ -# scscp, chapter 9 -# -# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD! -# -# This file has been autogenerated with GAP. It contains examples -# extracted from the documentation. Each example is preceded by the -# comment which points to the location of its source. -# -gap> START_TEST( "scscp09.tst"); - -# doc/../lib/scscp.gd:429-439 -gap> PingSCSCPservice("localhost",26133); -true -gap> PingSCSCPservice("localhost",26140); -Error: rec( - message := "Connection refused", - number := 61 ) -fail - -# doc/../lib/scscp.gd:463-469 -gap> PingStatistic("localhost",26133,1000); -1000 packets transmitted, 1000 received, 0% packet loss, time 208ms -min/avg/max = [ 0, 26/125, 6 ] - -# doc/../lib/scscp.gd:33-53 -gap> SetInfoLevel(InfoSCSCP,2); -gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); -#I Creating a socket ... -#I Connecting to a remote socket via TCP/IP ... -#I Got connection initiation message -#I -#I Requesting version 1.3 from the server ... -#I Server confirmed version 1.3 to the client ... -#I Request sent ... -#I Waiting for reply ... -#I -#I -#I Got back: object 3628800 with attributes -[ [ "call_id", "localhost:26133:286:JL6KRQeh" ] ] -rec( attributes := [ [ "call_id", "localhost:26133:286:JL6KRQeh" ] ], - object := 3628800 ) - -# doc/../lib/scscp.gd:56-63 -gap> SetInfoLevel(InfoSCSCP,0); -gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); -rec( attributes := [ [ "call_id", "localhost:26133:286:jzjsp6th" ] ], - object := 3628800 ) - -# doc/../lib/scscp.gd:66-121 -gap> SetInfoLevel(InfoSCSCP,3); -gap> EvaluateBySCSCP( "WS_Factorial",[10],"localhost",26133); -#I Creating a socket ... -#I Connecting to a remote socket via TCP/IP ... -#I Got connection initiation message -#I -#I Requesting version 1.3 from the server ... -#I Server confirmed version 1.3 to the client ... -#I Composing procedure_call message: - - - - - - localhost:26133:286:Jok6cQAf - - - - - - - - 10 - - - - - -#I Total length 396 characters -#I Request sent ... -#I Waiting for reply ... -#I -#I Received message: - - - - - localhost:26133:286:Jok6cQAf - - - - 3628800 - - - -#I -#I Got back: object 3628800 with attributes -[ [ "call_id", "localhost:26133:286:Jok6cQAf" ] ] -rec( attributes := [ [ "call_id", "localhost:26133:286:Jok6cQAf" ] ], - object := 3628800 ) -gap> SetInfoLevel(InfoSCSCP,0); - -# doc/../lib/scscp.gd:149-160 -gap> SetInfoLevel(InfoMasterWorker,2); -gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); -#I 1/5:master --> localhost:26133 -#I 2/5:master --> localhost:26134 -#I 3/5:master --> localhost:26133 -#I 4/5:master --> localhost:26134 -#I 5/5:master --> localhost:26133 -[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] - -# doc/../lib/scscp.gd:163-170 -gap> SetInfoLevel(InfoSCSCP,0); -gap> SetInfoLevel(InfoMasterWorker,0); -gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); -[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] - -# doc/../lib/scscp.gd:173-190 -gap> SetInfoLevel(InfoMasterWorker,5); -gap> ParListWithSCSCP( List( [2..6], n -> SymmetricGroup(n)), "WS_IdGroup" ); -#I 1/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 2 ] ) -#I 2/5:master --> localhost:26134 : SymmetricGroup( [ 1 .. 3 ] ) -#I localhost:26133 --> 1/5:master : [ 2, 1 ] -#I 3/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 4 ] ) -#I localhost:26134 --> 2/5:master : [ 6, 1 ] -#I 4/5:master --> localhost:26134 : SymmetricGroup( [ 1 .. 5 ] ) -#I localhost:26133 --> 3/5:master : [ 24, 12 ] -#I 5/5:master --> localhost:26133 : SymmetricGroup( [ 1 .. 6 ] ) -#I localhost:26134 --> 4/5:master : [ 120, 34 ] -#I localhost:26133 --> 5/5:master : [ 720, 763 ] -[ [ 2, 1 ], [ 6, 1 ], [ 24, 12 ], [ 120, 34 ], [ 720, 763 ] ] -gap> SetInfoLevel(InfoMasterWorker,2); - -# doc/../lib/utils.g:202-207 -gap> f := IO_PickleToString( GF( 125 ) ); -"FFIEINTG\>15INTG\>13FAIL" - -# doc/../lib/utils.g:239-246 -gap> IO_UnpickleFromString( f ); -GF(5^3) -gap> f = IO_UnpickleFromString( IO_PickleToString( f ) ); -true - -# -gap> STOP_TEST("scscp09.tst", 1 ); diff --git a/tst/testall.g b/tst/testall.g index 7b6f81e..50d0b91 100644 --- a/tst/testall.g +++ b/tst/testall.g @@ -26,7 +26,7 @@ TestDirectory(DirectoriesPackageLibrary( "scscp", "tst" ), # Run test files which should have no diffs TestDirectory(DirectoriesPackageLibrary( "scscp", "tst" ), rec(exitGAP := true, - exclude := [ "scscp04.tst", "scscp05.tst", "scscp06.tst", "scscp07.tst", "scscp08.tst", "scscp09.tst" ], + exclude := [ "scscp01.tst", "scscp02.tst", "scscp03.tst", "scscp04.tst", "scscp05.tst", "scscp06.tst" ], testOptions := rec(compareFunction := "uptowhitespace") ) ); FORCE_QUIT_GAP(1); # if we ever get here, there was an error