<p>(((MOAR) PARENTHESES))</p>
<p>One would think you were a Lisper.</p>
<div class="gmail_quote">On Jul 27, 2012 6:05 PM, "Barry Smith" <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I absolutely hate sizeof arch. That is one of the most perverse things people can do in C. What is wrong with good-old sizeof(arch)?<br>
<br>
Needs to go in the PETSc style guide :-)<br>
<br>
<br>
Barry<br>
<br>
<br>
On Jul 27, 2012, at 2:35 PM, Jed Brown wrote:<br>
<br>
> I'm sick of truncated PETSC_ARCH in log_summary. Does anyone object to my pushing the following to petsc-3.3? Should we just make all the fields huge so we're guaranteed to get everything? Since pname can be as long as PETSC_MAX_PATH_LEN, this is not a line we can reasonably limit/align.<br>
><br>
> --- a/src/sys/plog/plog.c<br>
> +++ b/src/sys/plog/plog.c<br>
> @@ -1269,7 +1269,7 @@<br>
> PetscStageInfo *stageInfo = PETSC_NULL;<br>
> PetscEventPerfInfo *eventInfo = PETSC_NULL;<br>
> PetscClassPerfInfo *classInfo;<br>
> - char arch[10], hostname[64], username[16], pname[PETSC_MAX_PATH_LEN], date[64];<br>
> + char arch[64], hostname[128], username[16], pname[PETSC_MAX_PATH_LEN], date[64];<br>
> const char *name;<br>
> PetscLogDouble locTotalTime, TotalTime, TotalFlops;<br>
> PetscLogDouble numMessages, messageLength, avgMessLen, numReductions;<br>
> @@ -1311,12 +1311,12 @@<br>
> ierr = PetscFPrintf(comm, fd, "*** WIDEN YOUR WINDOW TO 120 CHARACTERS. Use 'enscript -r -fCourier9' to print this document ***\n");CHKERRQ(ierr);<br>
> ierr = PetscFPrintf(comm, fd, "************************************************************************************************************************\n");CHKERRQ(ierr);<br>
> ierr = PetscFPrintf(comm, fd, "\n---------------------------------------------- PETSc Performance Summary: ----------------------------------------------\n\n");CHKERRQ(ierr);<br>
> - ierr = PetscGetArchType(arch, 10);CHKERRQ(ierr);<br>
> - ierr = PetscGetHostName(hostname, 64);CHKERRQ(ierr);<br>
> - ierr = PetscGetUserName(username, 16);CHKERRQ(ierr);<br>
> + ierr = PetscGetArchType(arch,sizeof arch);CHKERRQ(ierr);<br>
> + ierr = PetscGetHostName(hostname,sizeof hostname);CHKERRQ(ierr);<br>
> + ierr = PetscGetUserName(username,sizeof username);CHKERRQ(ierr);<br>
> ierr = PetscGetProgramName(pname, PETSC_MAX_PATH_LEN);CHKERRQ(ierr);<br>
> - ierr = PetscGetDate(date, 64);CHKERRQ(ierr);<br>
> - ierr = PetscGetVersion(version,256);CHKERRQ(ierr);<br>
> + ierr = PetscGetDate(date,sizeof date);CHKERRQ(ierr);<br>
> + ierr = PetscGetVersion(version,sizeof version);CHKERRQ(ierr);<br>
> if (size == 1) {<br>
> ierr = PetscFPrintf(comm,fd,"%s on a %s named %s with %d processor, by %s %s\n", pname, arch, hostname, size, username, date);CHKERRQ(ierr);<br>
> } else {<br>
><br>
<br>
</blockquote></div>