Author: bugman Date: Thu Mar 1 16:32:34 2012 New Revision: 15428 URL: http://svn.gna.org/viewcvs/relax?rev=15428&view=rev Log: Expansion and improvements to the multi-processor package and module docstrings. Modified: 1.3/multi/__init__.py 1.3/multi/mpi4py_processor.py 1.3/multi/multi_processor_base.py 1.3/multi/uni_processor.py Modified: 1.3/multi/__init__.py URL: http://svn.gna.org/viewcvs/relax/1.3/multi/__init__.py?rev=15428&r1=15427&r2=15428&view=diff ============================================================================== --- 1.3/multi/__init__.py (original) +++ 1.3/multi/__init__.py Thu Mar 1 16:32:34 2012 @@ -20,6 +20,29 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # ############################################################################### + +# Package docstring. +"""The multi-processor package. + +Introduction +============ + +This package is an abstraction of specific multi-processor implementations or fabrics such as MPI via mpi4py. It is designed to be extended for use on other fabrics such as grid computing via SSH tunnelling, threading, etc. It also has a uni-processor mode as the default fabric. + + +API +=== + +The public API is available via the __init__ module. It consists of the following functions and classes: + + - multi.load_multiprocessor: The interface for how a program can load and set up a specific processor fabric. This function returns the set up processor, which itself provides a run() method which is used to execute your application. + - multi.Processor_box: A special singleton object which provides access to the processors and their data. This is useful if you would like to access the data on a processor. + - multi.Memo: A special base class to be inherited. This is used by the master processor to access the results from the slave processors. + - multi.Slave_command: A special base class to be inherited. The run() function should be overridden, and this provides the code to execute on the slave processors. + - multi.Result_command: A special base class to be inherited. The run() function should be overridden, and this provides the code to process the results from the slaves. + +Using this basic interface, code can be parallelised and executed via an MPI implementation, or default back to a single CPU when needed. The choice of processor fabric is up to the calling program (via multi.load_multiprocessor). +""" __all__ = ['commands', @@ -28,9 +51,6 @@ 'processor_io', 'processor', 'uni_processor'] - -__doc__ = \ -"""Package for multi-processor code execution.""" # Python module imports. import sys as _sys Modified: 1.3/multi/mpi4py_processor.py URL: http://svn.gna.org/viewcvs/relax/1.3/multi/mpi4py_processor.py?rev=15428&r1=15427&r2=15428&view=diff ============================================================================== --- 1.3/multi/mpi4py_processor.py (original) +++ 1.3/multi/mpi4py_processor.py Thu Mar 1 16:32:34 2012 @@ -20,6 +20,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # ############################################################################### + +# Module docstring. +"""The MPI processor fabric via the mpi4py Python implementation.""" + # TODO: clone communicators & resize # TODO: check exceptions on master Modified: 1.3/multi/multi_processor_base.py URL: http://svn.gna.org/viewcvs/relax/1.3/multi/multi_processor_base.py?rev=15428&r1=15427&r2=15428&view=diff ============================================================================== --- 1.3/multi/multi_processor_base.py (original) +++ 1.3/multi/multi_processor_base.py Thu Mar 1 16:32:34 2012 @@ -22,7 +22,7 @@ ############################################################################### # Module docstring. -"""Module containing a Processor base class to be used by any multi-processor methodology. +"""Module containing a Processor base class to be used by any multi-processor fabric. This is used by the mpi4py clustering code. It can also be used by any new implementation including, for example: Modified: 1.3/multi/uni_processor.py URL: http://svn.gna.org/viewcvs/relax/1.3/multi/uni_processor.py?rev=15428&r1=15427&r2=15428&view=diff ============================================================================== --- 1.3/multi/uni_processor.py (original) +++ 1.3/multi/uni_processor.py Thu Mar 1 16:32:34 2012 @@ -22,7 +22,8 @@ ############################################################################### # Module docstring. -"""Module containing the uni-processor class.""" +"""The uni-processor fabric for running on a single CPU.""" + # Python module imports. import sys, os