ScratchDisk module

class ScratchDisk.ScratchDisk

Bases: abc.ABC

Abstract base class for scratch disk.

abstract create()

Create the scratch disk

abstract delete()

Delete the scratch disk

abstract remote_mount(hosts: list)

Mount the scratch disk on remote hosts

Parameters

hosts (list of str) – The list of remote hosts

ScratchDisk.addlock(mountpath: str) → str

Place a file on the disk to act as a lock to prevent disk unmounting/deletion.

ScratchDisk.get_lockcount(mountpath: str) → int

How many processes are using this mount

ScratchDisk.haslocks(mountpath: str) → bool

Test if any locks exist on the disk.

ScratchDisk.readConfig(configfile) → dict

Reads a JSON configuration file into a dictionary.

Parameters

configfile (str) – Full path and filename of a JSON configuration file for this cluster.

Returns

cfDict – Dictionary containing this cluster parameterized settings.

Return type

dict

ScratchDisk.removelock(mountpath: str, uid: str)

Remove an existing lock file from the disk.