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-2009 Kevin Rosenberg
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License (version 2) as
14 ** published by the Free Software Foundation.
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ** GNU General Public License for more details.
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ******************************************************************************/
33 MPIWorld (int& argc, char* const *& argv);
35 void setTotalWorkUnits (int totalUnits);
37 int getRank (void) const
40 int getNumProcessors (void) const
41 { return m_nProcessors; }
43 int getStartWorkUnit (int rank) const
44 { return m_vStartWorkUnit [rank]; }
46 int getEndWorkUnit (int rank) const
47 { return m_vEndWorkUnit [rank]; }
49 int getLocalWorkUnits (int rank) const
50 { return m_vLocalWorkUnits [rank]; }
52 int getMyStartWorkUnit (void) const
53 { return m_vStartWorkUnit [m_myRank]; }
55 int getMyEndWorkUnit (void) const
56 { return m_vEndWorkUnit [m_myRank]; }
58 int getMyLocalWorkUnits (void) const
59 { return m_vLocalWorkUnits [m_myRank]; }
61 MPI::Intracomm& getComm()
64 void BcastString (string& str);
69 vector<int> m_vLocalWorkUnits;
70 vector<int> m_vStartWorkUnit;
71 vector<int> m_vEndWorkUnit;
72 MPI::Intracomm m_comm;