Skip to content

Commit

Permalink
memcheck - clearer QF output NaN error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Sep 25, 2024
1 parent 77d04a1 commit 2bf66f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backends/memcheck/ceed-memcheck-qfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ static int CeedQFunctionApply_Memcheck(CeedQFunction qf, CeedInt Q, CeedVector *
CeedCallBackend(CeedQFunctionGetKernelName(qf, &kernel_name));
CeedCallBackend(CeedQFunctionGetFields(qf, NULL, NULL, NULL, &output_fields));
for (CeedInt i = 0; i < num_out; i++) {
CeedInt field_size;
const char *field_name;
CeedInt field_size;

// Note: need field size because vector may be longer than needed for output
CeedCallBackend(CeedQFunctionFieldGetSize(output_fields[i], &field_size));
CeedCallBackend(CeedQFunctionFieldGetName(output_fields[i], &field_name));
for (CeedSize j = 0; j < field_size * (CeedSize)Q; j++) {
CeedCheck(!isnan(impl->outputs[i][j]), ceed, CEED_ERROR_BACKEND,
"QFunction output %" CeedInt_FMT " entry %" CeedSize_FMT " is NaN after restoring write-only access: %s:%s ", i, j, kernel_path,
kernel_name);
"QFunction output %" CeedInt_FMT " '%s' entry %" CeedSize_FMT " is NaN after restoring write-only access: %s:%s ", i, field_name, j,
kernel_path, kernel_name);
}
CeedCallBackend(CeedVectorRestoreArray(V[i], &impl->outputs[i]));
VALGRIND_DISCARD(output_block_ids[i]);
Expand Down

0 comments on commit 2bf66f3

Please sign in to comment.