** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: mpiworld.cpp,v 1.1 2000/06/09 01:35:33 kevin Exp $
+** $Id: mpiworld.cpp,v 1.2 2000/06/22 10:17:28 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
}
+void
+MPIWorld::BcastString (string& str)
+{
+ int len;
+
+ if (m_myRank == 0)
+ len = str.length();
+ m_comm.Bcast (&len, 1, MPI::INT, 0);
+ char buf [ len + 1];
+
+ if (m_myRank == 0)
+ strcpy (buf, str.c_str());
+
+ m_comm.Bcast (buf, len + 1, MPI::CHAR, 0);
+
+ if (m_myRank > 0)
+ str = buf;
+}