Re: [Pympi-users] pyMPI complete api listing
Status: Alpha
Brought to you by:
patmiller
From: Pat M. <pat...@ll...> - 2005-07-22 16:12:00
|
> Where is the best place to look up the complete list of pympi routines and arguments? > I realised that I've been missing some like mpi.synchronizedWrite, which may not be in > the C version of mpi. Do I have to look in the source code, or is there somwhere else I can look? The best way to get a complete listing is to use the "help" function. One nice thing about this is that each function includes a code example. Each example is guaranteed to work since they form the unit test snippets (look at micro_tests/pyMPI_comm_misc_008 for example which tests the comm_dup() function and then do a >>> import mpi ; help(mpi.comm_dup) to see how the doc and the test line up. They are actually created from the C source so everything is always in sync). You can get the pages either from the command line this way % pyMPI -c 'import mpi; help(mpi)' > pympi.man or get things interactive this way: >>> import mpi >>> help(mpi) Help on built-in module mpi: NAME mpi - mpi FILE (built-in) DESCRIPTION Basic mpi calls < snip > FUNCTIONS abort(...) Emergency kill of MPI and Python abort(errorcode=1) --> None Use this to cleanly abort Python and MPI. You can provide a status (default value is 1), but the MPI implementation may ignore it. >>> mpi.abort() >>> mpi.abort(77) allgather(...) Gather items from across the communicator allgather(message, # Some sequence object count=len(message), # Number of objects to send root=0) # Rank that gets the list --> [ list ] | None Gather sub-lists to the root process. The result is a concatenation of the sub-lists on all processes (unlike gather which only gathers to the root). >>> print mpi.allgather([WORLD.rank]) [0,1,2,3] [0,1,2,3] [0,1,2,3] [0,1,2,3] <snip> -- Pat Miller | (925) 423-0309 | http://www.llnl.gov/CASC/people/pmiller If you think you can do a thing or think you can't do a thing, you're right. -- Henry Ford |