Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Mathematica 8.0.0:

I am stuck trying to get a Mathematica Mathlink connection from my Windows computer working that should connects to Linux over network (or vice versa) and then launches a Kernel on the remote end (which I want to use to do some calculations on my Windows PC or vice versa).

For local connections it works on both operating system and I can use this Mathlink connection to launch a Kernel:

Needs[ "SubKernels`LinkKernels`"]
kernel = FileNameJoin[{$InstallationDirectory, "MathKernel.exe"}];
link = LinkLaunch[kernel <> " -subkernel -mathlink"]

LaunchKernels[link]

I have already tried to create MathLinks on one computer (let's say IP: 192.168.1.1) where the kernel is launched with:

(*Computer which creates the remote link*)
kernel = LinkLaunch[First[$CommandLine] <> " -mathlink"];
    LinkRead[kernel];
    LinkWrite[kernel, Unevaluated[$ParentLink = LinkCreate["8000", LinkProtocol -> "TCPIP"];]]

But I cannot access this link when I use:

(*Computer which wants to use the remote link*)
link = LinkConnect["8000@192.168.1.1", LinkProtocol -> "TCPIP"]
LinkRead[link]
LinkRead[link]
LinkWrite[link, Unevaluated[$ProcessID]]
First[LinkRead[link]]

Somehow I am also missing authentication informations for the computer which wants to connect in my code but I did not get an example which shows me where to state these credentials.

share|improve this question
2  
I see you were new, when you posted your question. Have you read the FAQ of our site? If an answer helps you, you should upvote it. If it solves your problem, you should accept it. And if you want to discuss details, use the comment-function here or go to chat. Doing nothing might be considered as rude and it's unlikely (at least the same) people help you again. –  halirutan Oct 28 '12 at 23:28

1 Answer 1

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 it looks like

enter image description here

It's obvios, that the "math" call will not work on my MacOSX machine where Mathematica is installed under /Applications and the terminal can not call it directly. Furthermore, the kernel is call MathKernel. After adjustment I used the following custom launch command

enter image description here

After this it worked instantly (I turned the local parallel kernels off):

LaunchKernels[]

(*
  {KernelObject[1, "192.168.1.116"], KernelObject[2, "192.168.1.116"],
  KernelObject[3, "192.168.1.116"],  KernelObject[4, "192.168.1.116"]}
*)

$SystemID
    ParallelEvaluate[$SystemID]

(*
  "Linux-x86-64"
  {"MacOSX-x86-64", "MacOSX-x86-64", "MacOSX-x86-64", "MacOSX-x86-64"}
*)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.