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: 418346###########################################################################1##2#W todo.txt The SCSCP package Alexander Konovalov3#W Steve Linton4##5###########################################################################678###########################################################################91.Early development notes (in case of discrepancies, trust the manual)10###########################################################################1112The GAP package "SCSCP" has two main components:13141) GAP Server152) GAP Client1617Description:18191) GAP Server is started from the GAP session or during GAP startup.20During GAP Server startup it:21* loads all functions which has to be acessible as SCSCP services22* loads lookup mechanisms for them23* starts to listen specified port (default 26133, as registered by IANA)2425For example, the service provider can write a file "myservice.g" looking like:2627LoadPackage("scscp");28InstallSCSCPprocedure("factorial", Factorial, ["integer"],29"computes factorials of positive integers");30.....31InstallSCSCPprocedure("Simplify", OM-Simplify, ["raw-openmath"],32"does some special simplification of OpenMath objects");3334RunSCSCPserver( "servername", portnumber );3536After this to start the GAP server it remains to do3738gap myservice.g3940RunSCSCPserver:41* accepts connection from client via port 2613342* performs an exchange of connection initionation messages with the client43* sends, if requested, the meta-information about provided services44* starts read-evaluate-write loop:45- obtains OM message "procedure_call"46- performs lookup of the appropriate GAP function and checks all input,47with the message "procedure_terminated" if this step fails48- starts computation, during which it controls GAP and returns49"procedure_terminated" message if:50a) interrupt sygnal was obtained51b) system is out of resources (in multiuser mode the limits may be52specified by WS provider and the user may not have control over them,53in single-user they must be specified by the user within bounds54specified by WS provider)55c) computation was terminated by GAP:56- Error message with brk> loop (how can we catch this? are we57going two run an interface from GAP to GAP??? Can/should we58manage to do this within single copy of the system? This59must be possible, provided sygnal kernel and time-space60limits control will be implemented in the kernel)61- system crash (in this case the client detects broken connection,62and eventually we may want some way to start new GAP server process63automatically in this case, but anyway there is no point to try to64pick up the ongoing session)65- if none of this was happened, returns the result in the form of the66"procedure_completed" message and returns to the beginning of67read-evaluate-print loop6869In a multi-user mode it never stops until it will be terminated by the service70provider. Multi-user mode is intended to perform single quickly computed requests.71Thus, on each iteration SCSCP server accepts next request from the queue.7273In a single user mode for each client there is one copy of GAP. This can be74reduced to multi-user mode, if the client will be able to launch GAP SCSCP75wrapper which will create its personal SCSCP service (Can we do this???).76That SCSCP service will be stopped by the client's initiative or under some77other specified conditions to prevent forgotten jobs from infinite running.78793) GAP Client (to connect to SCSCP server):80* establishes connection with the SCSCP server via the specified port81* performs an exchange of connection initionation messages with the server82* requests, if necessary, the meta-information about provided services83* starts exchange loop:84- sends OM message "procedure_call"85- waits for the result of computation, and while waiting it must be able86to send the interrupt sygnal in case of timeout87- analyze the returned result and continues in case of "procedure_completed"88or leave the loop in case of "procedure_terminated"8990###########################################################################912.RELEASE HOW-TO92###########################################################################9394* replace version number in PackageInfo.g and doc/manual.xml9596* rebuild the manual9798* commit PackageInfo.g and doc/manual.xml99100* copy package to another location to wrap archives101102* remove SVN subdirectories103rm -r .svn/ */.svn/ */*/.svn/104105* replace paths from my local machine to something more neutral in gapd.sh106107* remove files: parscscp.g, todo.txt, example/private.g, example/rings.g,108tracing/glue.sh, and all from 'par' directory except parlist.g109110* remove possibly hidden files left e.g. '.DS_Store' left by Mac OS111112* remove lines for loading example/private.g file from example/myserver.g113114* remove getting IP address of the client, if it is not yet using IO package115116* wrap the archive with the right version number:117cd ..118tar cfvz scscp-1.2.0.tar.gz scscp/119tar cjvf scscp-1.2.0.tar.bz2 scscp/120121* copy archive, PackageInfo.g, README to web page:122scp scscp-* scscp/PackageInfo.g scscp/README.scscp [email protected]:~/public_html/scscp/123124* copy manual to the web page:125scp scscp/doc/*.html scscp/doc/*.css scscp/doc/*.pdf [email protected]:~/public_html/scscp/126127* check the PackageInfo.g, README, archive and the manual online:128http://www.cs.st-andrews.ac.uk/~alexk/scscp.htm129130* update the web-page: modify version and links.131132###########################################################################1333.TODO134###########################################################################135136* Think about authentication using private/public keys or another method137138* Parameter to regulate the queue length on the server139140* Allow to restrict the range of IP addresses from which it accepts request141142* CDs: matrix1, polynomial4, order1 (in openmath)143144* Is SCSCP version restored after session if it was altered?145146* Check more carefully examples and demo files, esp. upper/lowercasing etc.147148* Implement verification of arguments for procedures with non-trivial149signatures150151* Revise TerminateProcess, redo interrupts and check handling of other152processing instructions153154* Extend test files with more examples155156* Log servers activity in some GAP-readable format for analysing:157where incoming requests came from, when and when reply was sent?158Maybe we may even view them using EdenTV?159160* Automatically glue trace files and start EdenTV (path to it should161be in some config.file)162163* Automatic adjustments of the timeout (see Runtimes() record) in parlist.g164165* Par{Quick/List}WithSCSCP may accept option specifying the list of services166to use if not coinciding with SCSCPservers167168* TODO (suggested by SL): A useful trick which Google uses is that they169automatically restart the last 5% or so of the computations to finish,170without actually knowing whether the servers have died or not. That way171they also compensate for servers that are just running very slowly,172and they lose nothing, since there are always idle servers by that point.173174* Possible idea: if a list of procedure names is given, they are applied175recursively, e.g.176EvaluateBySCSCP( [ "WS_Factorial", "WS_Phi" ], [ 10 ], ... );177178* An idea we might consider in the future: change the structure of179OMsymRecord to cd.symbol.method, cd.symbol.role etc, then transient180CD record could me merged with OMsymRecord. Storing cd.symbol.role181may be useful, for example, GetAllowedHeads then will be able to182select only OMA.183184* INTERRUPTS:185186Once we tried to do CloseStream(process![1]), but closing stream too187early (for example, when server writes to it) causes server crash188because of the broken pipe :(189We need to send a proper Ctrl-C signal to the server, then it190will enter into a break loop and will send an error message from the191break loop to the client - this happens when you press Ctrl-C in the192server's window.193194Another possible scenarios:1951961) Multi-user service: the SCSCP server accepts A:1 incoming request and197starts another process B:2. The client communicates with B:2, and then198sends to A:1 request to interrupt the service B:2. Then A:1 performs199(in GAP) either "IO_kill(<pid>,15);" or Exec("kill -s SIGUSR2 <pid>");2002012) Single-user service: We start two parallel services, A:1 is the202production service, and B:1 is used to interrupt (and restart somehow?)203the service A:12042053) Remote user executes (in GAP) Exec("ssh <hostname> kill -s SIGUSR2 <pid>");"206(need have enough credentials to login into remote machine).207208(3) Works remotely. However, the user must be an owner of the process,209since only the super-user may send signals to other users' processes,210and there are other possible issues as well.211212(1) and (2) require some care of a register of users and their respective213pid so the request like214215<OMS cd="scscp1" name="interrupt_computation" />216<OMSTR>call_identifier</OMSTR>217218should lead to terminate that session for which the client is authorised.219This must be feasible.220221222