petsc-3.7.1 2016-05-15
Report Typos and Errors

PetscOptionsGetenv

Gets an environmental variable, broadcasts to all processors in communicator from first.

Synopsis

PetscErrorCode  PetscOptionsGetenv(MPI_Comm comm,const char name[],char env[],size_t len,PetscBool  *flag)
Collective on MPI_Comm Many br

Input Parameters

comm - communicator to share variable Many br
name - name of environmental variable Many br
len - amount of space allocated to hold variable Many br

Output Parameters

flag - if not NULL tells if variable found or not Many br
env - value of variable Many br

Many br

Notes

You can also "set" the environmental variable by setting the options database value Many br-name "stringvalue" (with name in lower case). If name begins with PETSC_ this is Many brdiscarded before checking the database. For example, PETSC_VIEWER_SOCKET_PORT would Many brbe given as -viewer_socket_port 9000 Many br

If comm does not contain the 0th process in the MPIEXEC it is likely on Many brmany systems that the environmental variable will not be set unless you Many brput it in a universal location like a .chsrc file Many br

Level:advanced
Location:
src/sys/utils/pdisplay.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages