Commit a9251efe authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' into compress2

parents 8649143d 05e25a14
......@@ -583,6 +583,10 @@ int mapping_precheck() {
pclass_vector *vec = new pclass_vector();
vnode_type_table[v->name] = tt_entry(0,vec);
// Remember if there are no nodes of the requested type in the physical
// topology. Without this diagnostic, our "guess what's wrong with
// the vnode" code concludes that there was not enough bandwidth.
bool matched_node_type = true;
// This constitutes a list of the number of ptypes that matched the
// criteria. We use to guess what's wrong with the vnode.
int matched_bw = 0;
......@@ -615,6 +619,7 @@ int mapping_precheck() {
// Check to make sure there are actually nodes of this type in the
// physical topology
if (type_table.find(this_type) == type_table.end()) {
matched_node_type = false;
// Yes, I know, goto is evil. But I'm not gonna indent the next
// 100 lines of code for this error case
goto nosuchtype;
......@@ -763,7 +768,10 @@ nosuchtype:
}
}
if (!matched_bw) {
if (!matched_node_type) {
cout << " No physical nodes of requested type '"
<< v->type << "'!\n";
} else if (!matched_bw) {
cout << " Too much bandwidth on emulated links!" << endl;
}
......
......@@ -15,7 +15,11 @@
*/
#ifdef NEW_GCC
#include <ext/hash_map>
#include <ext/hash_fun.h>
#ifdef NEWER_GCC
#include <backward/hash_fun.h>
#else
#include <ext/hash_fun.h>
#endif
using namespace __gnu_cxx;
#define RANDOM() random()
......
......@@ -29,8 +29,11 @@
using namespace std;
#ifdef NEW_GCC
#include <ext/hash_fun.h>
//#include <hash_fun.h>
#ifdef NEWER_GCC
#include <backward/hash_fun.h>
#else
#include <ext/hash_fun.h>
#endif
using namespace __gnu_cxx;
#else
#include <stl_hash_fun.h>
......
......@@ -17,11 +17,25 @@
/*
* We have to do these includes differently depending on which version of gcc
* we're compiling with
*
* In G++ 4.3, hash_set and hash_map were formally deprecated and
* moved from ext/ to backward/. Well, that's what the release notes
* claim. In fact, on my system, hash_set and hash_map appear in both
* ext/ and backward/. But, hash_fun.h is only in backward/, necessi-
* tating the NEWER_GCC macro.
*
* The real fix is to replace
* hash_set with tr1::unordered_set in <tr1/unordered_set>
* hash_map with tr1::unordered_map in <tr1/unordered_map>
*/
#if (__GNUC__ == 3 && __GNUC_MINOR__ > 0) || (__GNUC__ > 3)
#define NEW_GCC
#endif
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 4)
#define NEWER_GCC
#endif
#ifdef NEW_GCC
#include <ext/slist>
using namespace __gnu_cxx;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment