schencoding / graphlite Goto Github PK
View Code? Open in Web Editor NEWA lightweight graph computation platform in C/C++
A lightweight graph computation platform in C/C++
For example, if I have a graph like this:
7
8
0 1
0 2
1 2
3 1
3 2
4 5
4 6
5 6
It will be divided into 4 part as default. So the input for the third worker will be:
2
0
So there will be no edge in this input, and this will be invalid input of the program according to the code in loadGraph() function. But obviously it should not be invalid input because it is possible to have a graph like this. When I run the program, it will show me "Sender: connect: Connection refused".
for (; ! pmsgs->done(); pmsgs->next()){ Neighbor myneighbor; memcpy(&myneighbor,&pmsgs->getValue(),sizeof(Neighbor)); }
如果改成
for (; ! pmsgs->done(); pmsgs->next()){ Neighbor myneighbor; memcpy(&myneighbor,&pmsgs->getValue(),sizeof(Neighbor)); memset(&myneighbor,0,sizeof(Neighbor)); }
则没用问题,但没有意义了
bin/setenv的换行符是用\r\n结尾的,直接下载下来并拷贝到虚拟机上,在我的电脑上出现了无法正确配置环境变量的问题
void loadGraph() {
unsigned long long last_vertex;
unsigned long long from;
unsigned long long to;
double weight = 0;
double value = INF; //init value as INF
int outdegree = 0;
const char *line= getEdgeLine();
// Note: modify this if an edge weight is to be read
// modify the 'weight' variable
sscanf(line, "%lld %lld %lf", &from, &to, &weight);
addEdge(from, to, &weight);
last_vertex = from;
++outdegree;
for (int64_t i = 1; i < m_total_edge; ++i) {
line= getEdgeLine();
// Note: modify this if an edge weight is to be read
// modify the 'weight' variable
sscanf(line, "%lld %lld %lf", &from, &to, &weight);
if (last_vertex != from) {
addVertex(last_vertex, &value, outdegree);
last_vertex = from;
outdegree = 1;
} else {
++outdegree;
}
addEdge(from, to, &weight);
}
addVertex(last_vertex, &value, outdegree);
}
};
定义 INF = 1000000
在compute()函数中打印每个节点的value值,发现只有一部分是预先设置的INF, 另一部分节点的value为0。
没能发现我所写代码的逻辑问题, 所以提出这个可能的issue。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.