I'm trying to use a .m file to remotely connect to a computer in my office and use its six processors in addition to the two on my laptop when running code. The code from the .m file works fine if copy-pasted into my main file, but doesn't work as a .m file using the Get command. Can this code just not be put in a .m, or is my implementation bad?
Here's the code (with my lab computer's address removed):
Get["tunnel.m"]; Needs["SubKernels`RemoteKernels`"]; kernels = RemoteMachineTunnel["email@example.com", 6, "OperatingSystem" -> "Unix", "KernelPath" -> "/home/username/Mathematica/MathKernel"]; CloseKernels; LaunchKernels; LaunchKernels[kernels];
Note that I created the folder "Mathematica" on the lab computer such that this works. I also set up a public key (rather my friend did) so that the tunnel command goes through without being password denied.
Also note that I work at a university with strict restrictions on computer-computer communications, so the built in Wolfram remote access functionality doesn't work for me.
A similar question was asked here but that method does not seem to work here.
I think there's one or two other stackexchange questions I should give credit to for the above code, but my friend wrote it so I have no idea which questions he drew inspiration from.