Skip to content

Commit

Permalink
cleanup debug printf formats (%ld to LD)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Nov 3, 2023
1 parent 7b4011c commit 6d4119a
Show file tree
Hide file tree
Showing 25 changed files with 497 additions and 496 deletions.
4 changes: 2 additions & 2 deletions ParU/Source/paru_Diag_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void paru_Diag_update(int64_t pivcol, int64_t pivrow, paru_work *Work)
int64_t col2 = inv_Diag_map[pivrow];
Diag_map[col2] = diag_row;

PRLEVEL(1, ("%% Inside Diag update pivcol=%ld pivrow=%ld"
" diag_row=%ld col2=%ld\n",
PRLEVEL(1, ("%% Inside Diag update pivcol=" LD " pivrow=" LD ""
" diag_row=" LD " col2=" LD "\n",
pivcol, pivrow, diag_row, col2));

inv_Diag_map[diag_row] = col2;
Expand Down
318 changes: 159 additions & 159 deletions ParU/Source/paru_analyze.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ParU/Source/paru_assemble_row2U.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ void paru_assemble_row_2U(int64_t e, int64_t f, int64_t sR, int64_t dR,
{ // If still valid
ncolsSeen--;
PRLEVEL(1,
("%% sM [%ld] =%2.5lf \n", mEl * j + sR, sM[mEl * j + sR]));
PRLEVEL(1, ("%% uPart [%ld] =%2.5lf \n", rj * fp + dR,
("%% sM [" LD "] =%2.5lf \n", mEl * j + sR, sM[mEl * j + sR]));
PRLEVEL(1, ("%% uPart [" LD "] =%2.5lf \n", rj * fp + dR,
uPart[rj * fp + dR]));
//**//#pragma omp atomic
uPart[rj * fp + dR] += sM[mEl * j + sR];
PRLEVEL(1, ("%% uPart [%ld] =%2.5lf \n", rj * fp + dR,
PRLEVEL(1, ("%% uPart [" LD "] =%2.5lf \n", rj * fp + dR,
uPart[rj * fp + dR]));
if (ncolsSeen == 0) break;
}
Expand Down
8 changes: 4 additions & 4 deletions ParU/Source/paru_bin_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ int64_t paru_bin_srch(int64_t *srt_lst, int64_t l, int64_t r, int64_t num)
// a simple binary search for when we know all the indices are available
{
DEBUGLEVEL(0);
PRLEVEL(1, ("%% BINSearch %ld,%ld for %ld\n", l, r, num));
PRLEVEL(1, ("%% BINSearch " LD "," LD " for " LD "\n", l, r, num));
if (r >= l + LEN)
{
int64_t mid = l + (r - l) / 2;
PRLEVEL(1, ("%% mid is %ld\n", mid));
PRLEVEL(1, ("%% mid is " LD "\n", mid));
if (srt_lst[mid] == num) return mid;

if (srt_lst[mid] > num)
{
PRLEVEL(1, ("%% 1 New %ld,%ld \n", l, mid - 1));
PRLEVEL(1, ("%% 1 New " LD "," LD " \n", l, mid - 1));
return paru_bin_srch(srt_lst, l, mid - 1, num);
}
PRLEVEL(1, ("%% 2 New %ld,%ld \n", mid + 1, r));
PRLEVEL(1, ("%% 2 New " LD "," LD " \n", mid + 1, r));
return paru_bin_srch(srt_lst, mid + 1, r, num);
}

Expand Down
4 changes: 2 additions & 2 deletions ParU/Source/paru_create_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ paru_element *paru_create_element(int64_t nrows, int64_t ncols)
{
DEBUGLEVEL(0);

PRLEVEL(1, ("%% creating %ldx%ld element ", nrows, ncols));
PRLEVEL(1, ("%% creating " LD "x" LD " element ", nrows, ncols));
paru_element *curEl;
size_t tot_size = sizeof(paru_element) +
sizeof(int64_t) * (2 * (nrows + ncols)) +
sizeof(double) * nrows * ncols;
curEl = (paru_element *)paru_alloc(1, tot_size);
if (curEl == NULL) return NULL; // do not do error checking

PRLEVEL(1, (" with size of %ld in %p\n", tot_size, curEl));
PRLEVEL(1, (" with size of " LD " in %p\n", tot_size, curEl));

// Initializing current element
curEl->nrowsleft = curEl->nrows = nrows;
Expand Down
6 changes: 3 additions & 3 deletions ParU/Source/paru_dgemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ int64_t paru_dgemm(int64_t f, double *pF, double *uPart, double *el, int64_t fp,
int64_t rowCount, int64_t colCount, paru_work *Work, ParU_Numeric *Num)
{
DEBUGLEVEL(0);
PRLEVEL(1, ("%% rowCount =%ld ", rowCount));
PRLEVEL(1, ("%% colCount =%ld ", colCount));
PRLEVEL(1, ("%% fp =%ld\n", fp));
PRLEVEL(1, ("%% rowCount =" LD " ", rowCount));
PRLEVEL(1, ("%% colCount =" LD " ", colCount));
PRLEVEL(1, ("%% fp =" LD "\n", fp));

int64_t mA = (int64_t)(rowCount - fp);
int64_t nB = (int64_t)colCount;
Expand Down
58 changes: 29 additions & 29 deletions ParU/Source/paru_factorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ ParU_Ret paru_exec_tasks_seq(int64_t t, int64_t *task_num_child, paru_work *Work

int64_t num_original_children = 0;
if (daddy != -1) num_original_children = Sym->task_num_child[daddy];
PRLEVEL(1, ("Seq: executing task %ld fronts %ld-%ld (%ld children)\n", t,
PRLEVEL(1, ("Seq: executing task " LD " fronts " LD "-" LD " (" LD " children)\n", t,
task_map[t] + 1, task_map[t + 1], num_original_children));
ParU_Ret myInfo;
#ifndef NTIME
double start_time = PARU_OPENMP_GET_WTIME;
#endif
for (int64_t f = task_map[t] + 1; f <= task_map[t + 1]; f++)
{
PRLEVEL(2, ("Seq: calling %ld\n", f));
PRLEVEL(2, ("Seq: calling " LD "\n", f));
myInfo = paru_front(f, Work, Num);
if (myInfo != PARU_SUCCESS)
{
Expand All @@ -49,11 +49,11 @@ ParU_Ret paru_exec_tasks_seq(int64_t t, int64_t *task_num_child, paru_work *Work
#ifndef NTIME
double time = PARU_OPENMP_GET_WTIME;
time -= start_time;
PRLEVEL(1, ("task time task %ld is %lf\n", t, time));
PRLEVEL(1, ("task time task " LD " is %lf\n", t, time));
#endif

#ifndef NDEBUG
if (daddy == -1) PRLEVEL(1, ("%% finished task root(%ld)\n", t));
if (daddy == -1) PRLEVEL(1, ("%% finished task root(" LD ")\n", t));
#endif

if (daddy != -1) // if it is not a root
Expand All @@ -64,19 +64,19 @@ ParU_Ret paru_exec_tasks_seq(int64_t t, int64_t *task_num_child, paru_work *Work
num_rem_children = task_num_child[daddy];

PRLEVEL(1,
("%%Seq finished task %ld(%ld,%ld)Parent has %ld left\n", t,
("%%Seq finished task " LD "(" LD "," LD ")Parent has " LD " left\n", t,
task_map[t] + 1, task_map[t + 1], task_num_child[daddy]));
if (num_rem_children == 0)
{
PRLEVEL(
1, ("%%Seq task %ld executing its parent %ld\n", t, daddy));
1, ("%%Seq task " LD " executing its parent " LD "\n", t, daddy));
return myInfo = paru_exec_tasks_seq(daddy, task_num_child, Work,
Num);
}
}
else // I was the only spoiled kid in the family;
{
PRLEVEL(1, ("%% Seq task %ld only child executing its parent %ld\n",
PRLEVEL(1, ("%% Seq task " LD " only child executing its parent " LD "\n",
t, daddy));
return myInfo =
paru_exec_tasks_seq(daddy, task_num_child, Work, Num);
Expand All @@ -100,7 +100,7 @@ ParU_Ret paru_exec_tasks(int64_t t, int64_t *task_num_child, int64_t &chain_task

int64_t num_original_children = 0;
if (daddy != -1) num_original_children = Sym->task_num_child[daddy];
PRLEVEL(1, ("executing task %ld fronts %ld-%ld (%ld children)\n", t,
PRLEVEL(1, ("executing task " LD " fronts " LD "-" LD " (" LD " children)\n", t,
task_map[t] + 1, task_map[t + 1], num_original_children));
ParU_Ret myInfo;
#ifndef NTIME
Expand All @@ -118,11 +118,11 @@ ParU_Ret paru_exec_tasks(int64_t t, int64_t *task_num_child, int64_t &chain_task
#ifndef NTIME
double time = PARU_OPENMP_GET_WTIME;
time -= start_time;
PRLEVEL(1, ("task time task %ld is %lf\n", t, time));
PRLEVEL(1, ("task time task " LD " is %lf\n", t, time));
#endif

#ifndef NDEBUG
if (daddy == -1) PRLEVEL(1, ("%% finished task root(%ld)\n", t));
if (daddy == -1) PRLEVEL(1, ("%% finished task root(" LD ")\n", t));
#endif

if (daddy != -1) // if it is not a root
Expand All @@ -136,20 +136,20 @@ ParU_Ret paru_exec_tasks(int64_t t, int64_t *task_num_child, int64_t &chain_task
}

PRLEVEL(1,
("%% finished task %ld(%ld,%ld) Parent has %ld left\n", t,
("%% finished task " LD "(" LD "," LD ") Parent has " LD " left\n", t,
task_map[t] + 1, task_map[t + 1], task_num_child[daddy]));
if (num_rem_children == 0)
{
PRLEVEL(1,
("%% task %ld executing its parent %ld\n", t, daddy));
("%% task " LD " executing its parent " LD "\n", t, daddy));
int64_t resq;
#pragma omp atomic read
resq = Work->resq;
if (resq == 1)
{
chain_task = daddy;
PRLEVEL(2, ("%% CHAIN ALERT1: task %ld calling %ld"
" resq = %ld\n",
PRLEVEL(2, ("%% CHAIN ALERT1: task " LD " calling " LD ""
" resq = " LD "\n",
t, daddy, resq));
}
else
Expand All @@ -161,7 +161,7 @@ ParU_Ret paru_exec_tasks(int64_t t, int64_t *task_num_child, int64_t &chain_task
}
else // I was the only spoiled kid in the family;
{
PRLEVEL(1, ("%% task %ld only child executing its parent %ld\n", t,
PRLEVEL(1, ("%% task " LD " only child executing its parent " LD "\n", t,
daddy));
int64_t resq;
#pragma omp atomic read
Expand All @@ -170,8 +170,8 @@ ParU_Ret paru_exec_tasks(int64_t t, int64_t *task_num_child, int64_t &chain_task
if (resq == 1)
{
chain_task = daddy;
PRLEVEL(2, ("%% CHAIN ALERT1: task %ld calling %ld"
" resq = %ld\n",
PRLEVEL(2, ("%% CHAIN ALERT1: task " LD " calling " LD ""
" resq = " LD "\n",
t, daddy, resq));
}
else
Expand Down Expand Up @@ -309,12 +309,12 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,

#ifndef NDEBUG
double chainess = 2;
PRLEVEL(1, ("ntasks=%ld task_Q.size=%ld\n", ntasks, task_Q.size()));
PRLEVEL(1, ("ntasks=" LD " task_Q.size=" LD "\n", ntasks, task_Q.size()));
if (ntasks > 0)
{
// chainess = (task_depth[task_Q[0]] + 1) / (double)nf;
chainess = 1 - (task_Q.size() / (double)ntasks);
PRLEVEL(1, ("nf = %ld, deepest = %ld, chainess = %lf \n", nf,
PRLEVEL(1, ("nf = " LD ", deepest = " LD ", chainess = %lf \n", nf,
task_depth[task_Q[0]], chainess));
}
#pragma omp atomic write
Expand All @@ -331,7 +331,7 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
for (int64_t i = 0; i < (int64_t)task_Q.size(); i++)
{
int64_t t = task_Q[i];
PRLEVEL(PR, ("%ld[%ld-%ld](%ld) ", t, task_map[t] + 1, task_map[t + 1],
PRLEVEL(PR, ("" LD "[" LD "-" LD "](" LD ") ", t, task_map[t] + 1, task_map[t + 1],
task_depth[t]));
}
PRLEVEL(PR, ("\n"));
Expand All @@ -345,9 +345,9 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
{
PRLEVEL(1, ("Parallel\n"));
// chekcing user input
PRLEVEL(1, ("Control: max_th=%ld scale=%ld piv_toler=%lf "
"diag_toler=%lf trivial =%ld worthwhile_dgemm=%ld "
"worthwhile_trsm=%ld\n",
PRLEVEL(1, ("Control: max_th=" LD " scale=" LD " piv_toler=%lf "
"diag_toler=%lf trivial =" LD " worthwhile_dgemm=" LD " "
"worthwhile_trsm=" LD "\n",
Control->paru_max_threads, Control->scale,
Control->piv_toler, Control->diag_toler, Control->trivial,
Control->worthwhile_dgemm, Control->worthwhile_trsm));
Expand All @@ -366,13 +366,13 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
int64_t chain_task = -1;
int64_t start = 0;
PRLEVEL(
1, ("%% size=%ld, steps =%ld, stages =%ld\n", size, steps, stages));
1, ("%% size=" LD ", steps =" LD ", stages =" LD "\n", size, steps, stages));

for (int64_t ii = 0; ii < stages; ii++)
{
if (start >= size) break;
int64_t end = start + steps > size ? size : start + steps;
PRLEVEL(1, ("%% doing Queue tasks <%ld,%ld>\n", start, end));
PRLEVEL(1, ("%% doing Queue tasks <" LD "," LD ">\n", start, end));
#pragma omp parallel proc_bind(spread) \
num_threads(Control->paru_max_threads)
#pragma omp single nowait
Expand Down Expand Up @@ -409,7 +409,7 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
{
#pragma omp atomic write
Work->naft = 1;
PRLEVEL(1, ("Chain_taskd %ld has remained\n", chain_task));
PRLEVEL(1, ("Chain_taskd " LD " has remained\n", chain_task));
info = paru_exec_tasks_seq(chain_task, task_num_child, Work, Num);
}
if (info != PARU_SUCCESS)
Expand All @@ -434,12 +434,12 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
Work->naft = 1;
for (int64_t i = 0; i < nf; i++)
{
// if (i %1000 == 0) PRLEVEL(1, ("%% Wroking on front %ld\n", i));
// if (i %1000 == 0) PRLEVEL(1, ("%% Wroking on front " LD "\n", i));

info = paru_front(i, Work, Num);
if (info != PARU_SUCCESS)
{
PRLEVEL(1, ("%% A problem happend in %ld\n", i));
PRLEVEL(1, ("%% A problem happend in " LD "\n", i));
paru_free_work(Sym, Work); // free the work DS
ParU_Freenum(Num_handle, Control);
return info;
Expand Down Expand Up @@ -540,7 +540,7 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
}
}

PRLEVEL(1, ("max_rc=%ld max_cc=%ld\n", max_rc, max_cc));
PRLEVEL(1, ("max_rc=" LD " max_cc=" LD "\n", max_rc, max_cc));
PRLEVEL(1, ("max_udiag=%e min_udiag=%e rcond=%e\n", max_udiag, min_udiag,
min_udiag / max_udiag));
Num->max_row_count = max_rc;
Expand Down
12 changes: 6 additions & 6 deletions ParU/Source/paru_finalize_perm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ParU_Ret paru_finalize_perm(ParU_Symbolic *Sym, ParU_Numeric *Num)
PRLEVEL(PR, ("%% Initial row permutaion is:\n%%"));
for (int64_t k = 0; k < m; k++)
{
PRLEVEL(PR, (" %ld, ", Pinit[k]));
PRLEVEL(PR, (" " LD ", ", Pinit[k]));
}
PRLEVEL(PR, (" \n"));
#endif
Expand All @@ -48,7 +48,7 @@ ParU_Ret paru_finalize_perm(ParU_Symbolic *Sym, ParU_Numeric *Num)
for (int64_t k = 0; k < n1; k++)
{ // first singletons
Pfin[ip++] = Pinit[k];
PRLEVEL(PR, ("(%ld)%ld ", ip - 1, Pfin[ip - 1]));
PRLEVEL(PR, ("(" LD ")" LD " ", ip - 1, Pfin[ip - 1]));
}
PRLEVEL(PR, ("\n"));

Expand All @@ -66,7 +66,7 @@ ParU_Ret paru_finalize_perm(ParU_Symbolic *Sym, ParU_Numeric *Num)
// P[k] = i
Ps[frowList[k]] = ip - n1;
Pfin[ip++] = Pinit[frowList[k] + n1];
PRLEVEL(PR, ("(%ld)%ld\n ", ip - 1, Pfin[ip - 1]));
PRLEVEL(PR, ("(" LD ")" LD "\n ", ip - 1, Pfin[ip - 1]));
}
}
PRLEVEL(PR, ("\n"));
Expand All @@ -76,12 +76,12 @@ ParU_Ret paru_finalize_perm(ParU_Symbolic *Sym, ParU_Numeric *Num)
PRLEVEL(PR, ("%% Final Ps:\n%%"));
for (int64_t k = 0; k < m - n1; k++)
{
PRLEVEL(PR, (" %ld, ", Ps[k]));
PRLEVEL(PR, (" " LD ", ", Ps[k]));
}
PRLEVEL(PR, (" \n"));
PR = 1;
PRLEVEL(PR, ("%% n1=%ld Final row permutaion is:\n%%", n1));
for (int64_t k = 0; k < MIN(77, m); k++) PRLEVEL(PR, ("%ld ", Pfin[k]));
PRLEVEL(PR, ("%% n1=" LD " Final row permutaion is:\n%%", n1));
for (int64_t k = 0; k < MIN(77, m); k++) PRLEVEL(PR, ("" LD " ", Pfin[k]));
PRLEVEL(PR, (" \n"));
#endif
return PARU_SUCCESS;
Expand Down
3 changes: 2 additions & 1 deletion ParU/Source/paru_front.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ ParU_Ret paru_front(int64_t f, // front need to be assembled
/* ---------------------------------------------------------------------- */

PRLEVEL(-2, ("%%~~~~~~~ Assemble Front " LD " start ~~%.0lf~~~~~~~(%d)\n", f,
Sym->stree_flop_bound[f], omp_get_thread_num()));
Sym->stree_flop_bound[f], PARU_OPENMP_GET_THREAD_ID));


/* pivotal columns Super [f] ... Super [f+1]-1 */
int64_t col1 = Super[f]; /* fornt F has columns col1:col2-1 */
Expand Down
Loading

0 comments on commit 6d4119a

Please sign in to comment.