[petsc-dev] Is there a reason for short arch and host names?

Matthew Knepley knepley at gmail.com
Fri Jul 27 15:19:20 CDT 2012


I like it.

  Matt

On Fri, Jul 27, 2012 at 2:35 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> 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.
>
> --- a/src/sys/plog/plog.c
> +++ b/src/sys/plog/plog.c
> @@ -1269,7 +1269,7 @@
>    PetscStageInfo     *stageInfo = PETSC_NULL;
>    PetscEventPerfInfo *eventInfo = PETSC_NULL;
>    PetscClassPerfInfo *classInfo;
> -  char               arch[10], hostname[64], username[16],
> pname[PETSC_MAX_PATH_LEN], date[64];
> +  char               arch[64], hostname[128], username[16],
> pname[PETSC_MAX_PATH_LEN], date[64];
>    const char         *name;
>    PetscLogDouble     locTotalTime, TotalTime, TotalFlops;
>    PetscLogDouble     numMessages, messageLength, avgMessLen,
> numReductions;
> @@ -1311,12 +1311,12 @@
>    ierr = PetscFPrintf(comm, fd, "***             WIDEN YOUR WINDOW TO 120
> CHARACTERS.  Use 'enscript -r -fCourier9' to print this document
>  ***\n");CHKERRQ(ierr);
>    ierr = PetscFPrintf(comm, fd,
> "************************************************************************************************************************\n");CHKERRQ(ierr);
>    ierr = PetscFPrintf(comm, fd,
> "\n---------------------------------------------- PETSc Performance
> Summary: ----------------------------------------------\n\n");CHKERRQ(ierr);
> -  ierr = PetscGetArchType(arch, 10);CHKERRQ(ierr);
> -  ierr = PetscGetHostName(hostname, 64);CHKERRQ(ierr);
> -  ierr = PetscGetUserName(username, 16);CHKERRQ(ierr);
> +  ierr = PetscGetArchType(arch,sizeof arch);CHKERRQ(ierr);
> +  ierr = PetscGetHostName(hostname,sizeof hostname);CHKERRQ(ierr);
> +  ierr = PetscGetUserName(username,sizeof username);CHKERRQ(ierr);
>    ierr = PetscGetProgramName(pname, PETSC_MAX_PATH_LEN);CHKERRQ(ierr);
> -  ierr = PetscGetDate(date, 64);CHKERRQ(ierr);
> -  ierr = PetscGetVersion(version,256);CHKERRQ(ierr);
> +  ierr = PetscGetDate(date,sizeof date);CHKERRQ(ierr);
> +  ierr = PetscGetVersion(version,sizeof version);CHKERRQ(ierr);
>    if (size == 1) {
>      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);
>    } else {
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120727/5c0276f2/attachment.html>


More information about the petsc-dev mailing list