Tag Info

Hot answers tagged

15

Mathematica by default uses its own ssh implementation. You can see it in the dialog of the remote kernel configuration dialog in the advanced options: `java` -jar `mathssh`. As far as I know, you can safely replace that with the local ssh command (most likely /usr/bin/ssh). You have to select the "Advanced Options" radiobutton to do that (if you first add ...


13

The best thing to do is to test whether you can make the connection manually: Start Mathematica on your local machine. On the toolbar, navigate to Evaluation ► Kernel Configuration Options. Add a new kernel and configure it. In the dialog, click on Add ... and a Kernel Configuration dialog appears. Enter an appropriate name for your remote kernel. Under ...


11

What you did with setting the "com.wolfram.jlink.libdir" property will work. Perhaps you didn't enter the correct path, or you used the wrong JLinkNativeLibrary.dll file (meaning you used the 32-bit one from JLink/SystemFiles/Libraries/Windows, instead of the 64-bit one from JLink/SystemFiles/Libraries/Windows-x86-64, or vice-versa). But you really ...


10

If you want to use port forwarding, you'll need to know that for every MathLink connection, two different ports are used. The full syntax for TCPIP link names looks like this: LinkCreate["8000@1.2.3.4,8001@1.2.3.4", LinkProtocol -> "TCPIP"] 8000 and 8001 are the port numbers while 1.2.3.4 is your IP address. You can pass only a single port number to ...


9

Yes, older kernels are compatible with newer front ends. I think this is why the Version5`Graphics`, Version6`Graphics` and Version7`Graphics` packages exist. (Simply to ensure compatibility of graphics. From a short look at .tr files once I got the impression these get loaded when older kernels are used.) Regarding managing to create a connection, the ...


9

As indicated in the documentation, one can access the Mathematica kernel from the command prompt using the command math in Unix/Linux and MathKernel from Mac OS X/ Windows. If the MathKernel command is not in your PATH variable, you can try one of several things: Enter the full pathname as part of the command Add MathKernel as a PATH variable using the ...


8

I've been successful connecting to my office Mac workstation using SSH port forwarding: ssh -R 31415:127.0.0.1:31415 -R 31416:127.0.0.1:31416 username@XXX.XXX.XXX.XXX "/Applications/Mathematica.app/Contents/MacOS/MathKernel -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName 31415@127.0.0.1,31416@127.0.0.1 -LinkHost 127.0.0.1" where ...


8

Instead of driving a remote kernel directly via MathLink, you should consider implementing this task with webMathematica: webMathematica 3 added support for queueing long running computations, which can also use compute kernels. you can connect to webMathematica's web frontend with a web browser to inspect the state of the running computation at any time. ...


7

Here's one approach, though it's hard to say without knowing the site and what additional information you want for the files. Import["http://kaurov.com", {"HTML", "Images"}] There are several other items you can ask for (including what elements you can ask for!) In[53]:= Import["http://kaurov.com", {"HTML", "Elements"}] Out[53]= {"Data", "FullData", ...


7

From the docs: LinkCreate["8000", LinkProtocol -> "TCPIP"] Further down that page is shown: This connects to the port on frog.wolfram.com. link = LinkConnect["2981@frog.wolfram.com,2982@frog.wolfram.com", LinkProtocol -> "TCPIP"]


7

Dale Roberts's solution works fine, but only when the remote machine can be seen directly from the Internet. After connection you can type Links[] and see {LinkObject["31415@127.0.0.1,31416@127.0.0.1", 3, 1], LinkObject["36946@109.1.2.3,51520@109.1.2.3", 56, 2], LinkObject["59488@109.1.2.3,54373@109.1.2.3", 57, 3]} It means that the main ...


6

Here is a stab at a basic mathlink solution. In the kernel that contains status information define this post function: post[e_] := Module[{link}, Quiet[ link = LinkConnect["status"]; If[LinkReadyQ[link], LinkRead[link]; LinkWrite[link, e]]; LinkClose[link] ]] If there is nothing to connect (there is no open "status" link on the system) then this ...


6

So here is the final solution i figured out after a while: Open up the kernel configuration menu, Select Advanced Options and use the following for "Arguments to MLOpen": -LinkMode Listen -LinkProtocol TCPIP -LinkName 31415@10.8.0.14,31416@10.8.0.14 -LinkOptions MLDontInteract Replace 10.8.0.14 with the IP address of your client Then as Launch Command ...


6

This is what I did (using mathematica 9.0.1; remote RHEL linux server for running kernels; local workstation windows 7 64bit): On the remote kernels-tab I added the hostname of the server. Then I checked the 'Use custom launch command' and added the following: plink -ssh -batch -l `3` `1` "math -mathlink -linkmode Connect `4` -linkname '`2`' -subkernel ...


6

You can download the Remote Development Kit here (scroll down a bit). It's a CDF file that shows this when opened: Click "INSTALL" to finish the installation. Now go to Palettes -> Remote Development Control Panel. Click Configure Pi Connection and enter the IP address of your Pi, as well as the default username. Click New Pi Notebook, enter an ...


5

From rather superficial looking at the docs, I think what you ask for should be possible and even relatively easy to implement, but I'd choose J/Link and Java over Mathlink, for the following reasons: Java runtime is very stable. If you let it manage your remote kernels on the remote machine, you get a chance to have a better error / exception / crash ...


5

After some fiddling I found a solution to directly access my local files from the remote kernel via SSH. If localuser is the user name on the machine that runs the front end on which are also the data you want to import from the remote kernel and 111.111.111.11 is the IP address of the same machine, you just need to type: Import["!ssh ...


5

On Unix you can install rlwrap (~/)> rlwrap math Mathematica 8.0 for Mac OS X x86 (64-bit) Copyright 1988-2011 Wolfram Research, Inc. In[1]:= 1+1 Out[1]= 2 it saves the commands, and you can use up-arrows to access previously typed commands.


5

Why MathLink or webMathematica? (both quite time-consuming once you do something nontrivial) Keep it simple: On Windows: Use Remote Desktop to connect to your server (where you started the FrontEnd, starting the parallel calculation). On Linux: Use TightVNC or NX or some such.


5

Your PBS specifications do not get sent to Mathematica. PBS doesn't control Mathematica. Your job is being run on a machine with 16 cores and Mathematica sees this, hence the result of $ProcessorCount. To limit Mathematica to a single core, add the following lines to your script SetSystemOptions["MKLThreads" -> 1] SetSystemOptions["ParallelOptions" ...


4

Unfortunately, I have only a Linux and a Mac combination here to try but maybe I can give some hints. First, you should setup your systems in your local network so you can use ssh without password. Then you should carefully study Preferences->Parallel->Remove Kernels->Custom launch command. This things is likely to need some adjustment. On my Linux machine ...


4

I've discovered (at least some of) the answer to this question. One needs to install the Wolfram lightweight grid manager on local AND remote computers. This seems a bit confusing as the title of the program that one sees during the installation, refers to this application as "Wolfram gridMathematica Server with Wolfram Lightweight Grid Manager". A bit ...


4

The formatting you're seeing on the command-line is caused as a result of settings the FE makes to the "stdout" stream. Internally, the FE calls this function: FE`SetResultForm[FE`form_] := SetOptions["stdout", FormatType -> FE`form]; with the argument for form being whatever the default output format should be. This setting doesn't get reset ...


3

I'll just show some screen shots of what it looks like when you run the Mathematica Kernel from within emacs in the Terminal on Mac OS X. This is the purely cursor-driven text terminal, no mouse support: Start emacs type EscxshellReturn type math start entering Mathematica commands, entering them with Shift-Return Do some calculations and backtrack with ...


3

This is not the desired solution, but it is what I ended up doing: I finally gave up on trying to access a remote math kernel under Windows 7 and used a Ubuntu 12.04 image in VMWare which worked as expected. Since the guy in the last link, who had the same problem 2 years ago, also couldn't make it work and eventually gave up I assume it's some kind of ...


3

You can either automatically save a *.m file created from your notebook automatically (Options Inspector -> Selected Notebook -> AutoGeneratePackage, make sure all cells are initialization cells) and run this. I suggest running it from inside a screen session which keeps the connection alive even after you disconnect. I can also recommend tmux for this if ...


3

you can try to add the dll to your path list. Window->Preferences->Java->Installed JREs. Then choose your current JRE(JDK) or the one you are using and click Edit. Fill Default VM Arguments: -Djava.library.path="the pathhhh of dll" or Under Linux set LD_LIBRARY_PATH. Under Windows set PATH.


3

From your update, your situation is very similar to mine, where I can connect to hostA through the internet, but to hostB only via hostA. Here is the pared down settings from my ~/.ssh/config that you can adapt to your machines: Host hostA HostName hostA.school.edu User rm ForwardX11 yes ForwardX11Trusted yes ControlMaster auto ...


2

I have never had luck with this directly, since the remote machine has to connect back to the master. However, there is a way to do it with OpenVPN -- make the two machines connect to the VPN appear to be on the same subnet.


2

Yes, you can. It is slightly involved, but I think there is no other way than installing a VNC server (e.g. tigervnc) on the Linux server. I put all code and instructions also here for easy copying. The basic idea is to use JLink`UseFrontEnd[ ] from the Kernel. So the FrontEnd is just a service to the Kernel. However, there still needs to be an X-server ...



Only top voted, non community-wiki answers of a minimum length are eligible