diff --git a/examples/Parallel Computing/Index.ipynb b/examples/Parallel Computing/Index.ipynb index f500583..d6e4fd8 100644 --- a/examples/Parallel Computing/Index.ipynb +++ b/examples/Parallel Computing/Index.ipynb @@ -321,24 +321,6 @@ }, "metadata": {}, "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "workflow/
\n", - "  client.py
\n", - "  job_wrapper.py
\n", - "  wmanager.py
" - ], - "text/plain": [ - "workflow/\n", - " client.py\n", - " job_wrapper.py\n", - " wmanager.py" - ] - }, - "metadata": {}, - "output_type": "display_data" } ], "source": [ diff --git a/examples/Parallel Computing/workflow/client.py b/examples/Parallel Computing/workflow/client.py deleted file mode 100644 index 985e822..0000000 --- a/examples/Parallel Computing/workflow/client.py +++ /dev/null @@ -1,3 +0,0 @@ -from IPython.parallel.client import Client - -client = Client() diff --git a/examples/Parallel Computing/workflow/job_wrapper.py b/examples/Parallel Computing/workflow/job_wrapper.py deleted file mode 100755 index 216fe51..0000000 --- a/examples/Parallel Computing/workflow/job_wrapper.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -"""Python wrapper around a submitted workflow job. - -In reality this would be a more sophisticated script, here we only illustrate -the basic idea by considering that a submitted 'job' is a Python string to be -executed. -""" - -import sys - -argv = sys.argv - -from IPython.parallel.engine import EngineFactory -from IPython.parallel.ipengineapp import launch_new_instance - -ns = {} - -# job -exec sys.argv[1] in ns - -# this should really use Config: -EngineFactory.user_ns = ns - -# start engine with job namespace -launch_new_instance() diff --git a/examples/Parallel Computing/workflow/wmanager.py b/examples/Parallel Computing/workflow/wmanager.py deleted file mode 100644 index e4786b4..0000000 --- a/examples/Parallel Computing/workflow/wmanager.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Mock workflow manager. - -This is a mock work manager whose submitted 'jobs' simply consist of executing -a python string. What we want is to see the implementation of the ipython -controller part. -""" - -from __future__ import print_function - -import atexit -import sys - -from subprocess import Popen - -def cleanup(controller, engines): - """Cleanup routine to shut down all subprocesses we opened.""" - import signal, time - - print('Starting cleanup') - print('Stopping engines...') - for e in engines: - e.send_signal(signal.SIGINT) - print('Stopping controller...') - # so it can shut down its queues - controller.send_signal(signal.SIGINT) - time.sleep(0.1) - print('Killing controller...') - controller.kill() - print('Cleanup done') - - -if __name__ == '__main__': - - # Start controller in separate process - cont = Popen(['python', '-m', 'IPython.parallel.ipcontrollerapp']) - print('Started controller') - - # "Submit jobs" - eng = [] - for i in range(4): - eng.append(Popen(['python', 'job_wrapper.py','x=%s' % i])) - - # Ensure that all subpro - atexit.register(lambda : cleanup(cont, eng)) diff --git a/tools/run_ipy_in_profiler.py b/tools/run_ipy_in_profiler.py deleted file mode 100755 index 7362293..0000000 --- a/tools/run_ipy_in_profiler.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -"""XXX - What exactly is the use of this script? - -I (fperez) tried it quickly and it doesn't work in its current form. Either it -needs to be fixed and documented or removed. -""" - -import cProfile as profile -import sys -#import profile - -def main(): - import IPython.ipapi - print "Entering ipython for profiling. Type 'Exit' for profiler report" - IPython.ipapi.launch_new_instance() - -if len(sys.argv) == 1: - profile.run('main()', 'ipython_profiler_results') - -import pstats -p = pstats.Stats(len(sys.argv) >1 and sys.argv[1] or 'ipython_profiler_results') -p.sort_stats('time').print_stats(30) -