Skip to content

Commit

Permalink
Merge pull request GraphChi#1 from NoelM/fix_warnings
Browse files Browse the repository at this point in the history
fix some warnings
  • Loading branch information
NoelM authored Feb 12, 2018
2 parents 4b3438b + c29e733 commit c01179d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/api/functional/functional_bulksync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ namespace graphchi {

KERNEL kernel;

VT cumval;
VT cumval = {};

vertex_info vinfo;
graphchi_context * gcontext;
graphchi_context * gcontext = nullptr;

functional_vertex_unweighted_bulksync() : graphchi_vertex<VT, ET> () {}

Expand Down
6 changes: 3 additions & 3 deletions src/api/functional/functional_defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
namespace graphchi {

struct vertex_info {
vid_t vertexid;
int indegree;
int outdegree;
vid_t vertexid = 0;
int indegree = 0;
int outdegree = 0;
};

/* Special sparse locking */
Expand Down
32 changes: 11 additions & 21 deletions src/api/graph_objects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,28 @@ namespace graphchi {
class internal_graphchi_vertex {

public: // Todo, use friend
volatile int inc;
volatile int outc;
volatile int inc = 0;
volatile int outc = 0;

vid_t vertexid;
vid_t vertexid = 0;

protected:
graphchi_edge<EdgeDataType> * inedges_ptr;
graphchi_edge<EdgeDataType> * outedges_ptr;
graphchi_edge<EdgeDataType> * inedges_ptr = nullptr;
graphchi_edge<EdgeDataType> * outedges_ptr = nullptr;


public:
bool modified;
VertexDataType * dataptr;
bool modified = false;
VertexDataType * dataptr = nullptr;


/* Accessed directly by the engine */
bool scheduled;
bool parallel_safe;
bool scheduled = false;
bool parallel_safe = true;

#ifdef SUPPORT_DELETIONS
int deleted_inc;
int deleted_outc;
int deleted_inc = 0;
int deleted_outc = 0;
#endif


Expand All @@ -184,16 +184,6 @@ namespace graphchi {
int indeg,
int outdeg) :
vertexid(_id), inedges_ptr(iptr), outedges_ptr(optr) {
inc = 0;
outc = 0;
scheduled = false;
modified = false;
parallel_safe = true;
dataptr = NULL;
#ifdef SUPPORT_DELETIONS
deleted_inc = 0;
deleted_outc = 0;
#endif
}

virtual ~internal_graphchi_vertex() {}
Expand Down
4 changes: 2 additions & 2 deletions src/preprocessing/sharder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ namespace graphchi {

vid_t curvid=0;
#ifdef DYNAMICEDATA
vid_t lastdst = 0xffffffffffffffff; // 64bits
vid_t lastdst = std::numeric_limits<vid_t>::max();
int jumpover = 0;
size_t num_uniq_edges = 0;
size_t last_edge_count = 0;
Expand Down Expand Up @@ -1089,7 +1089,7 @@ namespace graphchi {
std::vector< graphchi_vertex<vid_t, dummy_t> > vertices(nvertices, graphchi_vertex<vid_t, dummy_t>()); // preallocate


for(int i=0; i < nvertices; i++) {
for(vid_t i=0; i < nvertices; i++) {
vertices[i] = graphchi_vertex<vid_t, dummy_t>(subinterval_st + i, NULL, NULL, 0, 0);
vertices[i].scheduled = true;
}
Expand Down
5 changes: 3 additions & 2 deletions src/shards/slidingshard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace graphchi {
assert(closest_vid>=0);
indexentry closest_offset = lowerbd_iter->second;
assert(closest_vid <= v);
if (closest_vid > curvid) { /* Note: this will fail if we have over 2B vertices! */
if (closest_vid > curvid) {
logstream(LOG_DEBUG)
<< "Sliding shard, start: " << range_st << " moved to: " << closest_vid << " " << closest_offset.adjoffset << ", asked for : " << v << " was in: curvid= " << curvid << " " << adjoffset << std::endl;

Expand Down Expand Up @@ -406,7 +406,8 @@ namespace graphchi {
vid_t lastrec = start;
window_start_edataoffset = edataoffset;

for(int i=((int)curvid) - ((int)start); i<nvecs; i++) {
assert(curvid >= start);
for(vid_t i=curvid - start; i<nvecs; i++) {
if (adjoffset >= adjfilesize) break;

// TODO: skip unscheduled vertices.
Expand Down

0 comments on commit c01179d

Please sign in to comment.