Commits

BarryFSmith committed 6d065ec

PetscInitialize() and PetscFinalize() should only process -server argument (with PetscPOpen) if PETSc is built with server support

Comments (0)

Files changed (2)

src/sys/objects/init.c

     ierr = (*PetscHelpPrintf)(comm,"-----------------------------------------------\n");CHKERRQ(ierr);
   }
 
+#if defined(PETSC_HAVE_SERVER)
   flg1 = PETSC_FALSE;
   ierr = PetscOptionsGetBool(NULL,"-server",&flg1,NULL);CHKERRQ(ierr);
   if (flg1) {
     ierr = PetscPOpen(PETSC_COMM_WORLD,NULL,"${PETSC_DIR}/${PETSC_ARCH}/bin/petscwebserver","r",NULL);CHKERRQ(ierr);
   }
+#endif
 
   ierr = PetscOptionsGetReal(NULL,"-petsc_sleep",&si,&flg1);CHKERRQ(ierr);
   if (flg1) {

src/sys/objects/pinit.c

   }
 #endif
 
+#if defined(PETSC_HAVE_SERVER)
   flg1 = PETSC_FALSE;
   ierr = PetscOptionsGetBool(NULL,"-server",&flg1,NULL);CHKERRQ(ierr);
   if (flg1) {
+    /*  this is a crude hack, but better than nothing */
     ierr = PetscPOpen(PETSC_COMM_WORLD,NULL,"pkill -9 petscwebserver","r",NULL);CHKERRQ(ierr);
   }
+#endif
 
   ierr = PetscHMPIFinalize();CHKERRQ(ierr);