Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/application_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "music/mpi_utils.hh"
#endif
#include "music/ioutils.hh"
#include "music/error.hh"
#include <iostream>
#include <fstream>
namespace MUSIC {
Expand Down Expand Up @@ -55,6 +56,8 @@ namespace MUSIC {
void
ApplicationMap::add (std::string name, int n, int c)
{
if (lookup(name) != NULL)
error ("Application label " + name + " is already used");
push_back (ApplicationInfo (name, n, c));
}

Expand Down
2 changes: 1 addition & 1 deletion src/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace MUSIC {
applications_->read (env);
env.ignore ();
std::map<int, int> leaders = applications_->assignLeaders( Name ());
connectivityMap_->read (env, leaders);
connectivityMap_->read (env, leaders, applications_);
// parse config string
while (!env.eof ())
{
Expand Down
5 changes: 4 additions & 1 deletion src/connectivity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "music/debug.hh"

#include "music/connectivity.hh"
#include "music/application_map.hh"
#include "music/ioutils.hh"
#include "music/error.hh"

Expand Down Expand Up @@ -175,7 +176,7 @@ namespace MUSIC {


void
Connectivity::read (std::istringstream& in, std::map<int, int> leaders)
Connectivity::read (std::istringstream& in, std::map<int, int> leaders, ApplicationMap* applications)
{
int nPorts;
in >> nPorts;
Expand All @@ -198,6 +199,8 @@ namespace MUSIC {
{
in.ignore ();
std::string recApp = IOUtils::read (in);
if (applications->lookup(recApp) == NULL)
error ("Connection to non-existent application: " + recApp);
in.ignore ();
std::string recPort = IOUtils::read (in);
in.ignore ();
Expand Down
3 changes: 2 additions & 1 deletion src/music/connectivity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <map>

namespace MUSIC {
class ApplicationMap;
/*
* Communication Type (<COLLECTIVE, POINTTOPOINT>)
* Processing Method (<TREE, TABLE>)
Expand Down Expand Up @@ -229,7 +230,7 @@ namespace MUSIC {

void write (std::ostringstream& out);

void read (std::istringstream& in, std::map<int, int> leaders);
void read (std::istringstream& in, std::map<int, int> leaders, ApplicationMap* applications);
};

}
Expand Down
3 changes: 2 additions & 1 deletion utils/contsink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ main (int argc, char* argv[])
contdata->map (&dmap, delay, interpolate);

double stoptime;
setup->config ("stoptime", &stoptime);
if (!setup->config ("stoptime", &stoptime))
stoptime = 1.0;

MUSIC::Runtime* runtime = new MUSIC::Runtime (setup, timestep);

Expand Down