-
Notifications
You must be signed in to change notification settings - Fork 1
Running a simple remote cluster
Here we describe how to run a set of ipython engines and an ipython controller on a remote machine, and connect to the with a Client from your local machine.
-
On the remote machine make sure you have a ipython profile with parallel configuration files. You can create one with the command
ipython profile create --parallel(this creates aprofile_defaultdirectory). Then on the remote machine start the cluster usingdacluster startoripcluster --n=4 --engines=MPI. -
scpthe ipython profile you are using (default in this case) to the local machine.
scp -r 10.7.0.121:~/.ipython/profile_default ~/profile_default ```
- Edit the
ipcontroller-client.jsonfile. Change the"ssh": ""line to"ssh": "<remote host>".
sed -i 's/"ssh": "",/"ssh": "",/g' ~/profile_default/security/ipcontroller-client.json ```
- Move this profile to
~/.ipython/profile_default/so that IPython uses it by default.
mv ~/profile_default ~/.ipython ```
Now when you create a client object with IPython.parallel.Client() it should automatically connect to the controller on the remote machine.
You can run the following as a bash script to transfer, edit, and move the profile to the proper location (steps 2, 3, and 4).
#!/usr/bin/env bash
scp -r <remote host>:~/.ipython/profile_default ~/profile_default
sed -i 's/"ssh": "",/"ssh": "<remote host>",/g' ~/profile_default/security/ipcontroller-client.json
rm -rf ~/.ipython/profile_default.bak
mv ~/.ipython/profile_default ~/.ipython/profile_default.bak
mv ~/profile_default ~/.ipython