File: batch.dem

package info (click to toggle)
maxima 5.9.1-9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 32,272 kB
  • ctags: 14,123
  • sloc: lisp: 145,126; fortran: 14,031; tcl: 10,052; sh: 3,313; perl: 1,766; makefile: 1,748; ansic: 471; awk: 7
file content (28 lines) | stat: -rw-r--r-- 891 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
/* Demo of an easy way to run a background job. */

loadfile(batch,fasl,dsk,share2);

/* functions are DISOWN(), SLEEP(SEC,MIN,HOURS),
  and REMOTE%DEBUG(), which can be used to check the state of
  a running macsyma from a different macsyma. It is hard to demo
  this function in a Batch file though. */

/* First set up a WRITEFILE to store results */
WRITEFILE(SHARE2);
/* next, calling the function DISOWN will set TTYOFF to TRUE and
   DYNAMALLOC to TRUE and then disown the running macsyma.
   The BATCH will continue though with results still going to the
   WRITEFILE. */
DISOWN();  /* You might one to have your job start running later.
here I'll just sleep for 3 minutes. */ SLEEP(0,3);
/* Next do a computation */
f(x):=x^x;
for j:1 thru 5 do print (j,f(j));

/* Next close the writefile, naming it something useful. */

CLOSEFILE(BATCH,DEMCRF);

/* NEXT kill the job */

QUIT();