python/methylnet/torque_jobs.py
def assemble_replace_dict(command, use_gpu, additions, queue, time, ngpu):
    """Create dictionary to update BASH submission script for torque.

    Parameters
    ----------
    command : type
        Command to executer through torque.
    use_gpu : type
        GPUs needed?
    additions : type
        Additional commands to add (eg. module loads).
    queue : type
        Queue to place job in.
    time : type
        How many hours to run job for.
    ngpu : type
        Number of GPU to use.

    Returns
    -------
    Dict
        Dictionary used to update Torque Script.

    """
    replace_dict = {'COMMAND':"{} {}".format('CUDA_VISIBLE_DEVICES="$gpuNum"' if use_gpu else '',command),
                'GPU_SETUP':"""gpuNum=`cat $PBS_GPUFILE | sed -e 's/.*-gpu//g'`
unset CUDA_VISIBLE_DEVICES
export CUDA_DEVICE=$gpuNum""" if use_gpu else '',
                'NGPU':'#PBS -l gpus={}'.format(ngpu) if (use_gpu and ngpu) else '',
                'USE_GPU':"#PBS -l feature=gpu" if use_gpu else '',
                'TIME':str(time),'QUEUE':queue,'ADDITIONS':additions}
    return replace_dict
Create dictionary to update BASH submission script for torque.

    Parameters
    ----------
    command : type
        Command to executer through torque.
    use_gpu : type
        GPUs needed?
    additions : type
        Additional commands to add (eg. module loads).
    queue : type
        Queue to place job in.
    time : type
        How many hours to run job for.
    ngpu : type
        Number of GPU to use.

    Returns
    -------
    Dict
        Dictionary used to update Torque Script.

    
Create dictionary to update BASH submission script for torque.
Parameters

command : type
Command to executer through torque.

Returns

Dict
Dictionary used to update Torque Script.
Create dictionary to update BASH submission script for torque . Parameters command : type Command to executer through torque . Returns Dict Dictionary used to update Torque Script .
def assemble_replace_dict(command, use_gpu, additions, queue, time, ngpu):
    replace_dict = {'COMMAND':"{} {}".format('CUDA_VISIBLE_DEVICES="$gpuNum"' if use_gpu else '',command),
                'GPU_SETUP':"""gpuNum=`cat $PBS_GPUFILE | sed -e 's/.*-gpu//g'`
unset CUDA_VISIBLE_DEVICES
export CUDA_DEVICE=$gpuNum""" if use_gpu else '',
                'NGPU':'#PBS -l gpus={}'.format(ngpu) if (use_gpu and ngpu) else '',
                'USE_GPU':"#PBS -l feature=gpu" if use_gpu else '',
                'TIME':str(time),'QUEUE':queue,'ADDITIONS':additions}
    return replace_dict
def assemble_replace_dict ( command , use_gpu , additions , queue , time , ngpu ) : replace_dict = { 'COMMAND' : "{} {}" . format ( 'CUDA_VISIBLE_DEVICES="$gpuNum"' if use_gpu else '' , command ) , 'GPU_SETUP' : """gpuNum=`cat $PBS_GPUFILE | sed -e 's/.*-gpu//g'`
unset CUDA_VISIBLE_DEVICES
export CUDA_DEVICE=$gpuNum""" if use_gpu else '' , 'NGPU' : '#PBS -l gpus={}' . format ( ngpu ) if ( use_gpu and ngpu ) else '' , 'USE_GPU' : "#PBS -l feature=gpu" if use_gpu else '' , 'TIME' : str ( time ) , 'QUEUE' : queue , 'ADDITIONS' : additions } return replace_dict
Create dictionary to update BASH submission script for torque.
Create dictionary to update BASH submission script for torque .
"""Create dictionary to update BASH submission script for torque.

    Parameters
    ----------
    command : type
        Command to executer through torque.
    use_gpu : type
        GPUs needed?
    additions : type
        Additional commands to add (eg. module loads).
    queue : type
        Queue to place job in.
    time : type
        How many hours to run job for.
    ngpu : type
        Number of GPU to use.

    Returns
    -------
    Dict
        Dictionary used to update Torque Script.

    """
command
use_gpu
additions
queue
time
ngpu