- /* Maybe should we get directly a char*, as open takes strings only beginning
- * with C++11...
- */
- file.open(filename.c_str(), std::ios::out | std::ios::trunc);
-
- if(file.is_open()) {
- file << "graph AsClusterFatTree {\n";
- for (unsigned int i = 0 ; i < this->nodes_.size() ; i++) {
- file << this->nodes_[i]->id;
- if(this->nodes_[i]->id < 0) {
- file << " [shape=circle];\n";
- }
- else {
- file << " [shape=hexagon];\n";
- }
- }
+ file.open(filename, std::ios::out | std::ios::trunc);
+ xbt_assert(file.is_open(), "Unable to open file %s", filename.c_str());