Skip to content

Avoid use of /tmp #729

Closed
Closed

Description

@golaz

MPAS-Analysis will occasionally fail on compy when /tmp fills up. When I contacted support, they recommended not using /tmp:

Glaesemann, Kurt R commented:

You are safer avoiding /tmp, and using /scratch instead. Secondly that /tmp was extra tiny because of some crash logs.

Would it be possible to change MPAS-Analysis so that it doesn't use /tmp?

Here is the log from one of the failure

analysis task computeRegionMasks_EC30to60E2r2_antarcticRegions20200621 failed during run 
Traceback (most recent call last):
  File "/share/apps/E3SM/conda_envs/base/envs/e3sm_unified_1.3.1.1/lib/python3.7/site-packages/mpas_analysis/shared/analysis_task.py", line 329, in run
    self.run_task()
  File "/share/apps/E3SM/conda_envs/base/envs/e3sm_unified_1.3.1.1/lib/python3.7/site-packages/mpas_analysis/shared/regions/compute_region_masks_subtask.py", line 473, in run_task
    showProgress=False, useMpasMaskCreator=self.useMpasMaskCreator)
  File "/share/apps/E3SM/conda_envs/base/envs/e3sm_unified_1.3.1.1/lib/python3.7/site-packages/mpas_analysis/shared/regions/compute_region_masks_subtask.py", line 66, in compute_mpas_region_masks
    logger=logger)
  File "/share/apps/E3SM/conda_envs/base/envs/e3sm_unified_1.3.1.1/lib/python3.7/site-packages/mpas_tools/conversion.py", line 188, in mask
    with TemporaryDirectory() as tempdir:
  File "/share/apps/E3SM/conda_envs/base/envs/e3sm_unified_1.3.1.1/lib/python3.7/site-packages/backports/tempfile.py", line 53, in __init__
    self.name = mkdtemp(suffix, prefix, dir)
  File "/share/apps/E3SM/conda_envs/base/envs/e3sm_unified_1.3.1.1/lib/python3.7/tempfile.py", line 366, in mkdtemp
    _os.mkdir(file, 0o700)
OSError: [Errno 28] No space left on device: '/tmp/tmpsaoco80k'

Activity

  1. chengzhuzhang commented on Sep 3, 2020

    @chengzhuzhang

    Based on a recent conversation with @stephenprice, the issue that /tmp is filled also happened on a local LANL luster. The fix Steve had for MPAS-Analysis has been to set “export TEMPDIR=/some_other_place_w_plenty_of_space”, This gets set in the batch script for MPAS-A when submitting the job.
    This may serve as a short-term solution.

  2. rljacob commented on Sep 3, 2020

    @rljacob

    An environment variable set by user is actually the right solution to this.

  3. maltrud commented on Sep 3, 2020

    @maltrud

    this is actually a problem i've had for quite a while. the default temp space for NCO is /tmp. maybe we should have Charlie change that?

  4. rljacob commented on Sep 3, 2020

    @rljacob

    TMPDIR is the unix/posix standard for where to find temporary disk space. If its set to /tmp but should be something else, that is first the responsibility of the sysadmin to change and then the user. Not the program.

  5. rljacob commented on Sep 3, 2020

    @rljacob

    On the other hand, if NCO and MPAS-analysis are using really large amounts of TMPDIR, 10's to 100's of GB, then its not reasonable to expect TMPDIR to have the space. In that case, I think the default behavior should be to use a MPAS_ANALYSIS_TMPDIR variable which the user has to set. If its not set, use $HOME/tmp.

  6. golaz commented on Sep 3, 2020

    @golaz
    Author

    Interesting, there is a lot more to it than I expected.

    It might be too much to expect that users of software within E3SM Unified will be aware that they are expected to set TMPDIR in order to reliably run NCO or MPAS-Analysis on E#SM machines. Could a better default be set as part of loading the E3SM Unified environment?

  7. maltrud commented on Sep 3, 2020

    @maltrud

    @rljacob are you saying that TMPDIR should always be set by the system's default login settings since it is the standard? seems unlikely to get admins to do this.
    and i may be wrong, but i think it is NCO within MPAS-Analysis that uses /tmp, not any of the analysis python stuff.

  8. golaz commented on Sep 3, 2020

    @golaz
    Author

    I don't think it's only NCO. The failure above clearly arose within some python code. So I think it's both NCO and MPAS-Analysis, and maybe other utilities as well.

  9. maltrud commented on Sep 3, 2020

    @maltrud

    @golaz yeah i think you're right. thanks for pointing that out.

  10. rljacob commented on Sep 3, 2020

    @rljacob

    Yes TMPDIR will always be defined to something in any unix system. But since NCO and MPAS-An aren't your typical unix program, maybe they should have their own variable for that tmp directory. If you want machine-specific, user-proof defaults, you get in to the same config file situation as CIME. Better to to just have each user set it once per machine in their .bashrc

  11. milenaveneziani commented on Sep 3, 2020

    @milenaveneziani
    Collaborator

    From the log file, I gather it has to do with an MPAS-Tool routine that creates ocean region masks.

    Defining an env variable seems like a good idea to me: maybe a best-practice recommendation to add to the MPAS-Analysis documentation.

  12. golaz commented on Sep 3, 2020

    @golaz
    Author

    Yes TMPDIR will always be defined to something in any unix system.

    @rljacob,

    echo $TMPDIR

    returns an empty string on compy

  13. rljacob commented on Sep 4, 2020

    @rljacob

    Doh! I got that wrong. Nearly all unix systems will have a /tmp or /var/tmp directory. IF the system defines a TMPDIR to something, programs are supposed to honor that setting.

  14. xylar commented on Sep 4, 2020

    @xylar
    Collaborator

    @golaz, thanks for bringing this up. I will fix this in the next release. It should be easy to just use the output directory as a temp directory.

    Everyone else, thanks for the discussion. But I do think this issue is probably best resolved by MPAS-Analysis just not using /tmp for this purpose. It's easy enough to use a different directory.

  15. reopened this on Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions