[petsc-dev] Is there a reason for short arch and host names?
Barry Smith
bsmith at mcs.anl.gov
Fri Jul 27 21:03:02 CDT 2012
I would be fine with a programing language that enforced that level of consistency.
Barry
On Jul 27, 2012, at 6:20 PM, Jed Brown <five9a2 at gmail.com> wrote:
> By that logic, you should write +(a,b) instead of a+b. I'm looking forward to if (!(rank)) {...}.
>
> On Jul 27, 2012 6:13 PM, "Barry Smith" <bsmith at mcs.anl.gov> wrote:
>
> On Jul 27, 2012, at 6:08 PM, Jed Brown wrote:
>
> > (((MOAR) PARENTHESES))
> >
> > One would think you were a Lisper.
>
> No because lisp puts the parenthesis in the wrong places.
>
> Actually I can handle only one concept: calling a function and I like the syntax to be the same for doing that all the time.
>
> Barry
>
> Just because it may be a pre-processor or compile time function and not a "real" runtime function doesn't make any different to me: I still need function(args).
>
> >
> > On Jul 27, 2012 6:05 PM, "Barry Smith" <bsmith at mcs.anl.gov> wrote:
> >
> > 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)?
> >
> > Needs to go in the PETSc style guide :-)
> >
> >
> > Barry
> >
> >
> > On Jul 27, 2012, at 2:35 PM, Jed Brown 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 {
> > >
> >
>
More information about the petsc-dev
mailing list