From 5ea2e6d42dd8918b5a71e89e8e641ae4c13cf749 Mon Sep 17 00:00:00 2001 From: johnzkchen Date: Thu, 29 May 2025 14:03:35 +0800 Subject: [PATCH] update --- examples/YiTu_GNN/NDP/shared/graph.cu | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/YiTu_GNN/NDP/shared/graph.cu b/examples/YiTu_GNN/NDP/shared/graph.cu index 46b6bde..407f695 100644 --- a/examples/YiTu_GNN/NDP/shared/graph.cu +++ b/examples/YiTu_GNN/NDP/shared/graph.cu @@ -19,6 +19,11 @@ void GraphStructure::ReadGraph(string graphFilePath) { ifstream infile(graphFilePath, ios::in | ios::binary); + if (!infile) { + cout << "Error: Cannot open file " << graphFilePath << endl; + exit(-1); + } + infile.read((char*)&num_nodes, sizeof(uint)); infile.read((char*)&num_edges, sizeof(uint)); @@ -191,6 +196,11 @@ void GraphStates::ReadEdgeWeight(string weightFilePath, uint num_edge { ifstream infile(weightFilePath, ios::in | ios::binary); + if (!infile) { + cout << "Error: Cannot open file " << weightFilePath << endl; + exit(-1); +} + uint num_edges = 0; infile.read((char*)&num_edges, sizeof(uint));