from textwrap import dedent


def _setup() -> str:
    """Return the setup for PBS job scheduler."""
    return dedent(
        """
    # change to the working directory
    cd $PBS_O_WORKDIR

    # set MPI variables
    export I_MPI_PIN=1
    export I_MPI_PIN_MODE=pm
    export OMP_NUM_THREADS=1
    export MPI_PPN=$(($PBS_NUM_PPN / $OMP_NUM_THREADS))
    export MPI_NP=$(($PBS_NP / $OMP_NUM_THREADS))
    """.rstrip()
    )