Skip to content

Commit

Permalink
Merge pull request #467 from lattice/hotfix/multinode_spinor_compare
Browse files Browse the repository at this point in the history
Hotfix/multinode spinor compare
  • Loading branch information
mathiaswagner committed May 5, 2016
2 parents fa3164e + e0aa5b9 commit 2be9efe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions lib/color_spinor_util.cu
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,21 @@ namespace quda {
}
}

// reduce over all processes
for (int i=0; i<N; i++) comm_allreduce_int(&iter[i]);
for (int f=0; f<fail_check; f++) comm_allreduce_int(&fail[f]);

for (int i=0; i<N; i++) printfQuda("%d fails = %d\n", i, iter[i]);

int accuracy_level =0;
for (int f=0; f<fail_check; f++) {
if (fail[f] == 0) accuracy_level = f+1;
}

size_t total = u.Nparity()*u.VolumeCB()*N*comm_size();
for (int f=0; f<fail_check; f++) {
printfQuda("%e Failures: %d / %d = %e\n", pow(10.0,-(f+1)/(double)tol),
fail[f], u.Nparity()*u.VolumeCB()*N, fail[f] / (double)(u.Nparity()*u.VolumeCB()*N));
printfQuda("%e Failures: %d / %lu = %e\n", pow(10.0,-(f+1)/(double)tol),
fail[f], total, fail[f] / (double)total);
}

delete []iter;
Expand Down
8 changes: 4 additions & 4 deletions lib/tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace quda {
TuneKey key = entry->first;
TuneParam param = entry->second;

char tmp[7];
char tmp[7] = { };
strncpy(tmp, key.aux, 6);
bool is_policy = strcmp(tmp, "policy") == 0 ? true : false;
if (param.n_calls > 0 && !is_policy) total_time += param.n_calls * param.time;
Expand All @@ -145,8 +145,8 @@ namespace quda {
TuneKey key = q.top().first;
TuneParam param = q.top().second;

char tmp[7];
strncpy(tmp, key.aux,6);
char tmp[7] = { };
strncpy(tmp, key.aux, 6);
bool is_policy = strcmp(tmp, "policy") == 0 ? true : false;

// synchronous profile
Expand Down Expand Up @@ -405,7 +405,7 @@ namespace quda {
int n_policy = 0;
for (map::iterator entry = tunecache.begin(); entry != tunecache.end(); entry++) {
// if a policy entry, then we can ignore
char tmp[6];
char tmp[7] = { };
strncpy(tmp, entry->first.aux, 6);
TuneParam param = entry->second;
bool is_policy = strcmp(tmp, "policy") == 0 ? true : false;
Expand Down

0 comments on commit 2be9efe

Please sign in to comment.