Commits

Satish Balay committed 1ea3218

bgq: fix deadlock on bgq due to inconsistant values returned by getpwuid(getuid())
on runs with 256nodes [or 4096 cores]. This fix removes the reliance
on PetscGetHomeDirectory() returning 'same' value across nodes.
[using the fact that PetscOptionsInsertFile() uses HOMEDIR from node-0 only]

Comments (0)

Files changed (1)

src/sys/objects/options.c

   ierr = PetscOptionsGetBool(NULL,"-skip_petscrc",&flag,NULL);CHKERRQ(ierr);
   if (!flag) {
     ierr = PetscGetHomeDirectory(pfile,PETSC_MAX_PATH_LEN-16);CHKERRQ(ierr);
-    /* warning: assumes all processes have a home directory or none, but nothing in between */
-    if (pfile[0]) {
-      ierr = PetscStrcat(pfile,"/.petscrc");CHKERRQ(ierr);
-      ierr = PetscOptionsInsertFile(PETSC_COMM_WORLD,pfile,PETSC_FALSE);CHKERRQ(ierr);
-    }
+    /* PetscOptionsInsertFile() does a fopen() on rank0 only - so only rank0 HomeDir value is relavent */
+    if (pfile[0]) { ierr = PetscStrcat(pfile,"/.petscrc");CHKERRQ(ierr); }
+    ierr = PetscOptionsInsertFile(PETSC_COMM_WORLD,pfile,PETSC_FALSE);CHKERRQ(ierr);
     ierr = PetscOptionsInsertFile(PETSC_COMM_WORLD,".petscrc",PETSC_FALSE);CHKERRQ(ierr);
     ierr = PetscOptionsInsertFile(PETSC_COMM_WORLD,"petscrc",PETSC_FALSE);CHKERRQ(ierr);
   }