Skip to content

Commit

Permalink
added traces to debug more easily matrix market wrong banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Bickson committed May 8, 2014
1 parent 7ec0343 commit 4d302ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions example_apps/matrix_factorization/matrixmarket/mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ int mm_read_banner(FILE *f, MM_typecode *matcode)
if (fgets(line, MM_MAX_LINE_LENGTH, f) == NULL)
return MM_PREMATURE_EOF;

if (sscanf(line, "%s %s %s %s %s", banner, mtx, crd, data_type,
storage_scheme) != 5){
int rc;
if ((rc = sscanf(line, "%s %s %s %s %s", banner, mtx, crd, data_type,
storage_scheme)) != 5){
perror("Error: Failed to read matrix market header");
exit(1);
logstream(LOG_ERROR)<<"scanf returned " << rc << std::endl;
return MM_NO_HEADER;
}

for (p=mtx; *p!='\0'; *p=tolower(*p),p++); /* convert to lower case */
Expand Down

0 comments on commit 4d302ad

Please sign in to comment.