Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Background jobs with Mathematica 3.0 under Linux ?


  • To: mathgroup@smc.vnet.net
  • Subject: [mg10583] Re: Background jobs with Mathematica 3.0 under Linux ?
  • From: "P.J. Hinton" <paulh@wolfram.com>
  • Date: Tue, 20 Jan 1998 16:54:22 -0500
  • Organization: Wolfram Research, Inc.
  • References: <694ab6$ijs@smc.vnet.net> <69co8t$eo3@smc.vnet.net>

On 12 Jan 1998, P.J. Hinton wrote:

> On 8 Jan 1998, Axel Kowald wrote:
> 
> > I would like to use Mathematica 3.0 on our Linux system to run some of
> > my notebooks in the background. Normally, I would mark the cells I want
> > to be evaluated as initialization cells and then type a command line
> > like:
> > 
> > math -batchoutput  < test.nb &
> >
> > Unfortunately I keep getting the error message: "Cannot initialize Motif
> > window graphic".

> Notice that the entire notebook file now looks like a Mathematica
> expression.  On the good side, this enables you to manipulate notebooks
> within the kernel.  However, it makes it impossible to use notebooks as
> batch inputs.
> 
> QUALIFICATION: You could write a sophisticated program to scan through
> the Notebook[] expression (since it contains a list) and use
> MakeExpression[] on the contents of Input cells which have the option
> InitializationCell->True and then do the evaluation, but this is left
> as an exercise for the ambitious student :-). 

An alternative approach, that I neglected to mention in the previous
post, is to use the automatic package generation capabilities of the
front end.  To take advantage of this, you can do the following:

1) On the front end menu bar, click on Edit -> Preferences to bring up
the Option Inspector dialog box.

2) Enter the following text in the Lookup line of the Option Inspector
dialog box:

		AutoG

This expands the Notebook Option|FileOptions subsections to reveal an
option called AutoGeneratedPackage.  Change this value from its default
of Manual to Automatic.

3) Close the Option Inspector dialog box.

Now, when you attempt to save a notebook with initialization cells, the
front end will automatically create a companion file with the same base
filename but with a .m extension.  This package file contains the
contents of the initialization cells in InputForm, and it should be
suitable for batch input into the kernel. 

--
P.J. Hinton
Mathematica Programming Group           paulh@wolfram.com Wolfram
Research, Inc.                  http://www.wolfram.com/~paulh/
Disclaimer: Opinions expressed herein are those of the author alone.




  • Prev by Date: Need help plotting multiple NDSolve solutions
  • Next by Date: Re: Left and right quotes
  • Prev by thread: Re: Background jobs with Mathematica 3.0 under Linux ?
  • Next by thread: ListPlot