:orphan:
# PetscGetTmp
Gets the name of the "tmp" directory, often this is `/tmp` 
## Synopsis
```
PetscErrorCode PetscGetTmp(MPI_Comm comm, char dir[], size_t len)
```
Collective


## Input Parameters

- ***comm -*** MPI_Communicator that may share tmp
- ***len -*** length of string to hold name



## Output Parameter

- ***dir -*** directory name



## Options Database Keys

- ***-shared_tmp  -*** indicates the directory is known to be shared among the MPI processes
- ***-not_shared_tmp -*** indicates the directory is known to be not shared among the MPI processes
- ***-tmp tmpdir -*** name of the directory you wish to use as tmp



## Environmental Variables

- ***`PETSC_SHARED_TMP` -*** indicates the directory is known to be shared among the MPI processes
- ***`PETSC_NOT_SHARED_TMP` -*** indicates the directory is known to be not shared among the MPI processes
- ***`PETSC_TMP` -*** name of the directory you wish to use as tmp





## See Also
 `PetscSharedTmp()`, `PetscSharedWorkingDirectory()`, `PetscGetWorkingDirectory()`, `PetscGetHomeDirectory()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/fileio/fretrieve.c.html#PetscGetTmp">src/sys/fileio/fretrieve.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/fretrieve.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
