Changes to userland progress to tweak progress output for test161. We needed

more periodic progress in some cases due to the large slow down that happens
when swapping is implemented (ASST3.3).
This commit is contained in:
Scott Haseley
2016-04-27 18:46:44 -04:00
parent 4e93e0b105
commit 153c0267b6
6 changed files with 114 additions and 35 deletions

View File

@@ -54,6 +54,8 @@
#define NMATS 11
#define JOBSIZE ((NMATS+1)*DIM*DIM*sizeof(int))
#define PROGRESS_INTERVAL 25000
static const int right_answers[NJOBS] = {
-1337312809,
356204544,
@@ -93,18 +95,20 @@ static
void
multiply(struct matrix *res, const struct matrix *m1, const struct matrix *m2)
{
int i, j, k;
int i, j, k, tot;
tot = 0;
for (i=0; i<DIM; i++) {
for (j=0; j<DIM; j++) {
int val=0;
for (k=0; k<DIM; k++) {
val += m1->m_data[i][k]*m2->m_data[k][j];
TEST161_LPROGRESS_N(tot, PROGRESS_INTERVAL);
tot++;
}
res->m_data[i][j] = val;
}
}
TEST161_TPROGRESS(0);
}
static
@@ -186,7 +190,7 @@ go(int mynum)
{
int r;
tsay("Process %d (pid %d) starting computation...\n", mynum,
lsay("Process %d (pid %d) starting computation...\n", mynum,
(int) getpid());
computeall(mynum);
r = answer();
@@ -198,8 +202,7 @@ go(int mynum)
exit(1);
}
tsay("Process %d answer %d: passed\n", mynum, r);
nsay("\nProc %d OK\n", mynum);
lsay("\nProcess %d: OK\n", mynum, r);
exit(0);
}
@@ -328,7 +331,7 @@ makeprocs(bool dowait)
if (pids[i]==0) {
/* child */
if (dowait) {
tsay("Process %d forked\n", i);
//tsay("Process %d forked\n", i);
semopen(&s1);
semopen(&s2);
semV(&s1, 1);
@@ -343,9 +346,9 @@ makeprocs(bool dowait)
if (dowait) {
semopen(&s1);
semopen(&s2);
tsay("Waiting for fork...\n");
//tsay("Waiting for fork...\n");
semP(&s1, NJOBS);
tsay("Starting computation.\n");
//tsay("Starting computation.\n");
semV(&s2, NJOBS);
}