The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

        HPCD::SLURM::Stage

SYNOPSIS

        use HPCD::SLURM::Stage;

DESCRIPTION

        This module defines SLURM-specific stage attributes and contains the method
        that decides if the program has failed due to memory shortage, and if so if
        the program can be retried with a larger memory limit.

BUILDERS

_build_cluster_specific_valid_resources

        The only two resources user can define via user_input are (hard) time and
        (hard) memory.

_build_cluster_specific_default_resources

        The default memory limit is 2G, and default time limit is there is no limit.

_build_cluster_specific_default_retry_resources

        A list of possible retry memory limits (when a program fails because of lack
        of memory it will look through this list to find and retry with the next biggest
        memory available). Should be in ascending order. Default is qw(2G 4G 16G 32G).

ATTRIBUTES

METHODS

_analyse_completion_state

        Analyzes and returns the completion state.
        Exit status 0 => pass, otherwise, if the program fails due to lack of memory and
        the program can be retried with the next biggest memory, then returns retry, else
        returns fail.

_can_retry_from_vmem

        Searches for the next biggest memory in _use_retry_resources_required for retry.

_res_to_num

        Takes in a memory size (units: KMG or none(no unit means the unit is byte already))
        and converts it to a number representing the original size in bytes.

        Example:
        &_res_to_num('1024') returns 1024 (because 1024 bytes = 1024 bytes)
        &_res_to_num('2K') returns 2048 (because 2KB = 2048 bytes)
        &_res_to_num('1M') returns 1048576 (because 1MB = 1048576 bytes)

_num_to_res

        Takes in a number in bytes and converts it into designated units (K/M/G).

        Example:
        &_num_to_res(2048) returns '2K'
        &_num_to_res(1048576) returns '1M'

_vmem_usage

        Gives out warning based on memory usage account information and decides if the program
        fails because of lack of memory. If so, invoke _can_retry_from_vmem and return the memory
        limit for retry, otherwise return 0.

AUTHOR

John Macdonald - Boutros Lab

Anqi (Joyce) Yang - Boutros Lab

ACKNOWLEDGEMENTS

Paul Boutros, Phd, PI - Boutros Lab

The Ontario Institute for Cancer Research