Ok, here's a file syncing service solution:
Step 1: Get a Dropbox account and make two folders in your dropbox: 'to_run/' and 'finished/'.
Step 2: Paste and run this in a notebook on your Windows box:
Options[run] = {"Print"->False};
(* runs a notebook f and saves its result *)
run[f_, opts:OptionsPattern[]] := Module[
{nb, pdfName, doneName, tmpName, t, msg},
tmpName = StringInsert[f, "_IN_PROGRESS",-4]; CopyFile[f, tmpName];
doneName = StringReplace[tmpName, "_IN_PROGRESS" -> "_DONE"]; t = Now;
nb = NotebookOpen[tmpName]; NotebookEvaluate[nb, InsertResults->True];
NotebookSave[nb];
If[OptionValue[opts,"Print"],
pdfName = StringTake[doneName,;;-4]<>".pdf";
NotebookPrint[nb, pdfName];
];
NotebookClose[nb]; CopyFile[tmpName, doneName]; DeleteFile[tmpName];
msg = StringForm["``: Evaluted `` in ``", Now, FileBaseName@f, Now-t];
Print[msg]; ChannelSend["example", msg]; (* e.g. monitor things *)
doneName
]
runner[indir_, outdir_] := Module[
{fns = {}, done = {}, ran, to},
Print[StringForm["Listening for files in ``", indir]];
While[True,
Pause[3]; done = {};
fns = FileNames["*.nb", indir];
Do[
If[!MemberQ[done,f],
Print[StringForm["Working on ``",f]];
to = FileNameJoin[{outdir, FileNameTake[f,-1]}];
CopyFile[f, to]; ran = run[to];
If[FileExistsQ[to], DeleteFile[f]; DeleteFile[to]];
AppendTo[done, f];
]
,{f, fns}]
]
]
runner["C:\\Users\\Dropbox\\to_run" , "C:\\Users\\Dropbox\\finished"]
Step 3: Drag a notebook you want to remotely evaluate into the 'to_run/' folder and wait for the notebook result to appear.
Notes:
- This is just a 5-min prototype, you should re-write this to make it robust to notebooks that crash the kernel and handle other issues like name collisions.
- Make sure both laptops have persistant internet access and a dropbox daemon running.
- You can add monitoring easily through a channel with
ChannelListener
and ChannelSend
- To easily save things that you need in the resulting notebook use
DumpSave
, PersistantSymbol
, or just throw in some Iconize
calls.