Skip to content

Commit a26c474

Browse files
author
Aapo Kyrola
committed
fixed int->long; a bug in the case a window had no scheduled vertices
1 parent 51dc6ad commit a26c474

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/edu/cmu/graphchi/engine/GraphChiEngine.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public void run(GraphChiProgram<VertexDataType, EdgeDataType> program, int niter
223223
subIntervalStart = subIntervalEnd + 1;
224224
vertexDataHandler.releaseAndCommit();
225225
} else {
226+
subIntervalStart = subIntervalEnd + 1;
226227
System.out.println("Skipped interval - no vertices scheduled.");
227228
}
228229
}

src/edu/cmu/graphchi/engine/auxdata/DegreeData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void load(int _vertexSt, int _vertexEn) throws IOException {
3939
vertexEn = _vertexEn;
4040

4141
int dataSize = (vertexEn - vertexSt + 1) * 4 * 2;
42-
int dataStart = vertexSt * 4 * 2;
42+
long dataStart = (long) vertexSt * 4l * 2l;
4343

4444
degreeData = new byte[dataSize];
4545

src/edu/cmu/graphchi/engine/auxdata/VertexData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public VertexData(int nvertices, String baseFilename, BytesToValueConverter<Vert
6565
public void releaseAndCommit() throws IOException {
6666
assert(currentBlockId >= 0);
6767
byte[] data = blockManager.getRawBlock(currentBlockId);
68-
int dataStart = vertexSt * converter.sizeOf();
68+
long dataStart = (long) vertexSt * (long) converter.sizeOf();
6969

7070
vertexDataFile.seek(dataStart);
7171
vertexDataFile.write(data);
@@ -81,7 +81,7 @@ public void load(int _vertexSt, int _vertexEn) throws IOException {
8181
vertexEn = _vertexEn;
8282

8383
int dataSize = (vertexEn - vertexSt + 1) * converter.sizeOf();
84-
int dataStart = vertexSt * converter.sizeOf();
84+
long dataStart = (long) vertexSt * (long) converter.sizeOf();
8585

8686
currentBlockId = blockManager.allocateBlock(dataSize);
8787

0 commit comments

Comments
 (0)