Skip to content

Commit c40ebbb

Browse files
committed
fixing bug that wrote out information to a data directory when no writing should occur.
1 parent 4bcf932 commit c40ebbb

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

src/evolution.cu

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,16 @@ void evolve(Grid &par,
297297
}
298298
// Write out the newly specified potential
299299
// and exp potential to files
300-
FileIO::writeOutDouble(buffer, data_dir + "V_opt_1",
301-
V_opt, xDim * yDim, 0);
302-
FileIO::writeOut(buffer, data_dir + "EV_opt_1", EV_opt,
303-
xDim * yDim, 0);
304-
305-
//Store necessary parameters to Params.dat file.
306-
FileIO::writeOutParam(buffer, par,
307-
data_dir + "Params.dat");
300+
if(write_it){
301+
FileIO::writeOutDouble(buffer, data_dir + "V_opt_1",
302+
V_opt, xDim * yDim, 0);
303+
FileIO::writeOut(buffer, data_dir + "EV_opt_1", EV_opt,
304+
xDim * yDim, 0);
305+
306+
//Store necessary parameters to Params.dat file.
307+
FileIO::writeOutParam(buffer, par,
308+
data_dir + "Params.dat");
309+
}
308310
}
309311
//If i!=0 and the number of vortices changes
310312
// if num_vortices[1] < num_vortices[0] ... Fewer vortices
@@ -316,8 +318,10 @@ void evolve(Grid &par,
316318
wfc, xDim);
317319
Tracker::vortArrange(vortCoords->getVortices(),
318320
vortCoordsP->getVortices());
319-
FileIO::writeOutInt(buffer, data_dir + "vLoc_",
320-
vortexLocation, xDim * yDim, i);
321+
if(write_it){
322+
FileIO::writeOutInt(buffer, data_dir + "vLoc_",
323+
vortexLocation, xDim * yDim, i);
324+
}
321325
}
322326
}
323327

@@ -408,9 +412,11 @@ void evolve(Grid &par,
408412
lattice.getVortices().size(),
409413
sizeof(double));
410414
lattice.genAdjMat(adjMat);
411-
FileIO::writeOutAdjMat(buffer, data_dir + "graph",
412-
adjMat, uids,
413-
lattice.getVortices().size(), i);
415+
if (write_it){
416+
FileIO::writeOutAdjMat(buffer, data_dir + "graph",
417+
adjMat, uids,
418+
lattice.getVortices().size(), i);
419+
}
414420

415421
//Free and clear all memory blocks
416422
free(adjMat);
@@ -421,8 +427,10 @@ void evolve(Grid &par,
421427
}
422428

423429
//Write out the vortex locations
424-
FileIO::writeOutVortex(buffer, data_dir + "vort_arr",
425-
vortCoords->getVortices(), i);
430+
if(write_it){
431+
FileIO::writeOutVortex(buffer, data_dir + "vort_arr",
432+
vortCoords->getVortices(), i);
433+
}
426434
printf("Located %d vortices\n",
427435
vortCoords->getVortices().size());
428436

src/unit_test.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ void evolve_test(){
11691169
par.store("esteps", esteps);
11701170
par.store("gsteps", gsteps);
11711171
par.store("printSteps", 30000);
1172-
par.store("write_file", true);
1172+
par.store("write_file", false);
11731173
par.store("write_it", false);
11741174
par.store("energy_calc", true);
11751175
par.store("box_size", 0.00007);

0 commit comments

Comments
 (0)