1. petsc
  2. PETSc
  3. petsc

Commits

Matt Knepley  committed 6fa9880

Options: Allow env variables, like PETSC_DIR, in the options file name for startup

  • Participants
  • Parent commits 7436b39
  • Branches master

Comments (0)

Files changed (1)

File src/sys/objects/options.c

View file
  • Ignore whitespace
   options->args = (args) ? *args : NULL;
 
   if (file && file[0]) {
-    ierr = PetscOptionsInsertFile(PETSC_COMM_WORLD,file,PETSC_TRUE);CHKERRQ(ierr);
+    char fullpath[PETSC_MAX_PATH_LEN];
+
+    ierr = PetscStrreplace(PETSC_COMM_WORLD,file,fullpath,PETSC_MAX_PATH_LEN);CHKERRQ(ierr);
+    ierr = PetscOptionsInsertFile(PETSC_COMM_WORLD,fullpath,PETSC_TRUE);CHKERRQ(ierr);
   }
   /*
      We want to be able to give -skip_petscrc on the command line, but need to parse it first.  Since the command line