# PetscSharedTmp
Determines if all processors in a communicator share a /tmp or have different ones. 
## Synopsis
```
PetscErrorCode PetscSharedTmp(MPI_Comm comm, PetscBool *shared)
```
Collective


## Input Parameter

- ***comm -*** MPI_Communicator that may share /tmp



## Output Parameter

- ***shared -*** `PETSC_TRUE` or `PETSC_FALSE`



## Options Database Keys

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



## Environmental Variables

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





## Notes
Stores the status as a MPI attribute so it does not have
to be redetermined each time.

Assumes that all processors in a communicator either
1) have a common /tmp or
2) each has a separate /tmp
eventually we can write a fancier one that determines which processors
share a common /tmp.

This will be very slow on runs with a large number of processors since
it requires O(p*p) file opens.

If the environmental variable PETSC_TMP is set it will use this directory
as the "/tmp" directory.


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

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/fileio/fretrieve.c.html#PetscSharedTmp">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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
