# encoding: utf-8 """ Sample configuration file for ipcontroller. """ # Get a valid configuration object for the controller from ipython1.config.api import getConfigObject controllerConfig = getConfigObject('controller') # Now we can configure the controller controllerConfig.listenForEnginesOn['ip'] = '127.0.0.1' controllerConfig.listenForEnginesOn['port'] = 20000
Connecting to controller: ('127.0.0.1', 10105) >>> rc.getIDs() (0, 1, 2, 3) 4. You are ready to go. Next, check out the execute, push and pull methods of RemoteController. """ __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2005 Fernando Perez <*****@*****.**> # Brian E Granger <*****@*****.**> # Benjamin Ragan-Kelly <<*****@*****.**>> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------------------------------------------------------------------------------- import ipython1.config.api as config clientConfig = config.getConfigObject('client') import ipython1.kernel.magic RemoteController = clientConfig.RemoteController """The default RemoteController class obtained from config information.""" RemoteController.MAX_LENGTH = clientConfig.maxMessageSize defaultController = (clientConfig.connectToControllerOn['ip'], clientConfig.connectToControllerOn['port']) """The (ip,port) tuple of the default local controller."""
# Benjamin Ragan-Kelley <*****@*****.**> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------------------------------------------------------------------------------- import sys, os from optparse import OptionParser from twisted.internet import reactor from twisted.python import log from ipython1.kernel.engineservice import EngineService import ipython1.config.api as config engineConfig = config.getConfigObject('engine') shellConfig = config.getConfigObject('shell') mpiConfig = config.getConfigObject('mpi') config.updateConfigWithFile('mpirc.py') # MPI module should be loaded first mpi = None if mpiConfig.mpiImportStatement: try: exec mpiConfig.mpiImportStatement except ImportError: mpi = None def main(n, logfile):
# encoding: utf-8 """ Sample configuration file for MPI. Copy this file into your ~/.ipython directory and uncomment one of the lines below. You can also add your own MPI module using this approach. For more information see the `ipython1.config.objects.MPIConfig` docstrings. """ from ipython1.config.api import getConfigObject mpiConfig = getConfigObject('mpi') # For IPython's basic mpi module. This only calls MPI_Init # and then defines mpi.rank and mpi.size. This is useful # for the many cases where you just need to know those two things. # You could also probably use this approach to make MPI calls from # C/C++ code. #mpiConfig.mpiImportStatement = 'from ipython1 import mpi' # For using mpi4py #mpiConfig.mpiImportStatement = 'from mpi4py import MPI as mpi'
# encoding: utf-8 """ Sample configuration file for ipengine. """ # Get a valid configuration object for the engine and shell from ipython1.config.api import getConfigObject engineConfig = getConfigObject('engine') shellConfig = getConfigObject('shell') # Now we can configure the engine and shell engineConfig.connectToControllerOn['ip'] = '127.0.0.1' engineConfig.connectToControllerOn['port'] = 20000 #shellConfig.filesToRun = ['~/test.py']