Skip to content

Commit

Permalink
Speed up backup restore
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanLucPons committed Jun 20, 2020
1 parent 0c76359 commit 8ff76c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions Backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ void Kangaroo::FectchKangaroos(TH_PARAM *threads) {
nbLoadedWalk = kangs.size();
}

::printf("Restoring");

// Fetch input kangaroo from file (if any)
if(nbLoadedWalk>0) {

Expand All @@ -321,27 +323,27 @@ void Kangaroo::FectchKangaroos(TH_PARAM *threads) {

#ifdef WITHGPU
for(int i = 0; i < nbGPUThread; i++) {
::printf(".");
int id = nbCPUThread + i;
uint64_t n = threads[id].nbKangaroo;
threads[id].px = new Int[n];
threads[id].py = new Int[n];
threads[id].distance = new Int[n];
uint64_t nbGrp = n / GPU_GRP_SIZE;
for(uint64_t g = 0; g < nbGrp; g++) {
if(!saveKangarooByServer)
FetchWalks(GPU_GRP_SIZE,
&(threads[id].px[g * GPU_GRP_SIZE]),
&(threads[id].py[g * GPU_GRP_SIZE]),
&(threads[id].distance[g * GPU_GRP_SIZE]));
else
FetchWalks(GPU_GRP_SIZE,kangs,
&(threads[id].px[g * GPU_GRP_SIZE]),
&(threads[id].py[g * GPU_GRP_SIZE]),
&(threads[id].distance[g * GPU_GRP_SIZE]));
}
if(!saveKangarooByServer)
FetchWalks(n,
threads[id].px,
threads[id].py,
threads[id].distance);
else
FetchWalks(n,kangs,
threads[id].px,
threads[id].py,
threads[id].distance);
}
#endif

::printf("Done\n");

double eFetch = Timer::get_tick();

if(nbLoadedWalk != 0) {
Expand Down
2 changes: 1 addition & 1 deletion Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define CONSTANTSH

// Release number
#define RELEASE "2.0"
#define RELEASE "2.1aplha"

// Use symmetry
//#define USE_SYMMETRY
Expand Down

0 comments on commit 8ff76c9

Please sign in to comment.