MathGroup Archive 2009

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

Search the Archive

Re: running mathematica notebooks without interface

  • To: mathgroup at
  • Subject: [mg98889] Re: running mathematica notebooks without interface
  • From: Albert Retey <awnl at>
  • Date: Mon, 20 Apr 2009 19:14:53 -0400 (EDT)
  • References: <gs9emj$mvd$> <gsbvv7$5ki$> <gseoma$e2t$>


> This is a very good idea and it works.
> However I would like to use graphics command such as contourPlot and
> others, and this seems not to be possible using a .m package run
> without a frontend?
> maybe the UsingFrontEnd command may help?

actually that is what it is for, so yes, it may help...

> But it's quite undocumented!

It is part of JLink and an essential part of webmathematica, so you
should look in the documentation of these to learn more about it and why
it is there. Actually if everything is set up correctly, its usage is
trivial, since you only wrap it around parts of code which need the
frontend to work. The complicated part is the setup, which is described
in the JLink tutorial.

> It seems there is no way to run a .nb file without a front-end and
> save the output of the cells (including graphics) without having the
> actual frontend running...

it can be done with UseFrontEnd, but you need to be able to run a
graphical interface on the server, which is not per se possible on all
platforms when logging in via ssh. E.g. on a unix machine you need to
have X installed and an X server of some sort running, e.g. a vncserver.
For tips on how you can make UseFrontEnd work you need to give more
details about the server you are trying to access. On the other hand, if
you have the possibility to run something like e.g. vncserver on the
server, I would recommend using that to start the frontend on the server
in a vnc-session, start the evaluation and reconnect when the evaluation
of the notebook has finished.

> Someone suggested me to use the Kernel remotely, which could be an idea!
> However I have some troubles addressing the remote kernel since it is
> located in a private network and I usually reach it by a double ssh
> session (ssh user1@gateway and then ssh user2@server)
> Any quick trick to tell mathematica to load a remote kernel using ssh
> tunnel?

you could set up a tunnel which connects a free port on your local host
to port 22 on 'server' via 'gateway'.  This is independent from
mathematica, you can do the setup and testing without even touching
mathematica, and you can also tunnel any protocol for remote access like
e.g. vnc this way, too. Then when this works you would just need to
connect to 'localhost' on the new port which should make the
configuration of mathematica much simpler. You should read the
documentation of the ssh-flavour you are using to learn how to do that.
Maybe it would also be a good idea to ask your system administrators
what their suggestions are to access the server, since it was them who
hided the server, so probably they have a working solution already...



  • Prev by Date: Mathematica in conjunction with outside program; NMinimize fails. Symbolic v. numeric evaluation problem?
  • Next by Date: Re: Plot Axis Unit Conversions
  • Previous by thread: Re: running mathematica notebooks without interface
  • Next by thread: Re: Been doing real-time measurements with Mathematica! (Wii Balance