1 /*****************************************************************************
5 ** Purpose: MPIWorld classes
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: June 6, 2000
9 ** This is part of the CTSim program
10 ** Copyright (c) 1983-2001 Kevin Rosenberg
12 ** $Id: mpiworld.h,v 1.5 2001/01/28 19:10:18 kevin Exp $
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
35 MPIWorld (int& argc, char* const *& argv);
37 void setTotalWorkUnits (int totalUnits);
39 int getRank (void) const
42 int getNumProcessors (void) const
43 { return m_nProcessors; }
45 int getStartWorkUnit (int rank) const
46 { return m_vStartWorkUnit [rank]; }
48 int getEndWorkUnit (int rank) const
49 { return m_vEndWorkUnit [rank]; }
51 int getLocalWorkUnits (int rank) const
52 { return m_vLocalWorkUnits [rank]; }
54 int getMyStartWorkUnit (void) const
55 { return m_vStartWorkUnit [m_myRank]; }
57 int getMyEndWorkUnit (void) const
58 { return m_vEndWorkUnit [m_myRank]; }
60 int getMyLocalWorkUnits (void) const
61 { return m_vLocalWorkUnits [m_myRank]; }
63 MPI::Intracomm& getComm()
66 void BcastString (string& str);
71 vector<int> m_vLocalWorkUnits;
72 vector<int> m_vStartWorkUnit;
73 vector<int> m_vEndWorkUnit;
74 MPI::Intracomm m_comm;