Skip to content

Commit

Permalink
Fix filename string and memory limiter bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian "DragonLord" Wong authored and Brian "DragonLord" Wong committed Dec 29, 2014
1 parent 25e8884 commit 6157036
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@
- Updated documentation to reflect the memory limiting feature.
- Increased the maximum file name length to 200 characters.
- Minor stylistic changes in code.

## 0.3.2 (December 28, 2014)

- Fixed a bug in the memory limiting code which caused execution to continue
two trials past the limit.
- Fixed a bug affecting the filename string buffer limiting the filename to 80
characters rather than the intended 160.
10 changes: 5 additions & 5 deletions hi64.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
int main(int argc, char *argv[])
{
FILE *curv; /* Output file for QUIPS curve */
char filnm[200]; /* Output file name */
char filnm[160]; /* Output file name */

Speed qdata[NSAMP]; /* Array to keep track of QUIPs and time */

Expand Down Expand Up @@ -58,7 +58,7 @@ int main(int argc, char *argv[])
qpnet, /* Net QUIPS; integral of QUIPS d(log t) */
qpeak, /* Peak QUIPS attained */
qprat, /* Ratio of current QUIPS to peak QUIPS */
qptmp, /* QUIPS temporary for calculating Net QUIPS */
qptmp, /* QUIPS temporary for calculating Net QUIPS */
t, /* Time for a given trial */
t0, /* Starting time */
t1, /* Ending time */
Expand All @@ -77,7 +77,7 @@ int main(int argc, char *argv[])

char* suffix; /* Suffix for data.suffix directory */

printf("\nHI64 System Benchmark, Version 0.3.1");
printf("\nHI64 System Benchmark, Version 0.3.2");
printf(" (December 28, 2014)\n");
printf("Derived from HINT originally developed by");
printf(" John L. Gustafson & Quinn O. Snell,\n");
Expand Down Expand Up @@ -112,7 +112,7 @@ if (memlimit < 0x7fffffffffffffffLL)
if (argc>=3) {
suffix=argv[2];
}
snprintf(filnm, 80, "data%s/%s", suffix, argv[0]);
snprintf(filnm, 160, "data%s/%s", suffix, argv[0]);
if ((curv = fopen(filnm, "w")) == NULL)
{
printf("Could not open data file\n");
Expand Down Expand Up @@ -216,7 +216,7 @@ if (memlimit < 0x7fffffffffffffffLL)
/* This loop is the main loop driver of the HINT kernel. */
for (t = 0, i = 0, n = NMIN, qpeak = 0, qprat = 1, memuse2 = 0;
((i < NSAMP) && (t < STOPTM) && (n < scx) && (qprat > STOPRT)
&& (memuse2 < memlimit * ADVANCE));
&& (memuse2 * ADVANCE < memlimit));
i++, n = ((int64_t)(n * ADVANCE) > n)? (n * ADVANCE) : n + 1)
{
printf(".");
Expand Down

0 comments on commit 6157036

Please sign in to comment.