134. fe.jobs_menu
— Jobs Menu¶
134.1. Functions defined in module fe.jobs_menu¶
- fe.jobs_menu.getRemoteDirs(host, userdir)[source]¶
Get a list of all subdirs in userdir on host.
The host should be a machine where the user has ssh access. The userdir is relative to the user’s home dir.
- fe.jobs_menu.transferFiles(host, userdir, files, targetdir)[source]¶
Copy files from userdir on host to targetdir.
files is a list of file names.
- fe.jobs_menu.rsyncFiles(srcdir, tgtdir, include=['*'], exclude=[], exclude_first=False, rsh='ssh -q', chmod='ug+rwX,o-rwx', opts='-rv')[source]¶
Transfer files remotely using rsync
- Parameters:
srcdir (str) – Path from where to copy files. The path may be relative or absolute, and it can containing a leading ‘host:’ part to specify a remote directory (if tgtdir does not contain one).
tgtdir (str) – Path where to copy files to. The path may be relative or absolute, and it can containing a leading ‘host:’ part to specify a remote directory (if srcdir does not contain one). If tgtdir does not exist, it is created (though the parent should exist).
include (list) – List of fles to include in the copying process.
exclude (list) – List of files to exclude from the copying process.
rsh (str) – The remote shell command to be used. Default is ssh.
chmod (str) – The permission settings on the target system.
opts (is included in) – Extra options to pass to rsync
decide (The includes are applied before the excludes. The first match will) –
to (the outcome. The default is to recursively copy all files from srcdir) –
uses (tgtdir. Other typical) –
tgtdir:: (- Copy all but some files from srcdir to) – rsyncFiles(src,tgt,include=[’.png’,’.jpg’],exclude=[‘*’])
tgtdir:: – rsyncFiles(src,tgt,exclude=[’.png’,’.jpg’],exclude_first=True)
option (Returns the Process used to execute the command. If the -v) –
opts –
contain (then the Process.out atribute will) –
transfered. (the list of files) –
Notes
You need to have rsync installed on source and target systems.
You need to have no-password ssh access to the remote systems
- fe.jobs_menu.submitJob(srcdir, tgtdir, include=[], delete_old=True)[source]¶
Submit a cluster job in srcdir to the tgtdir.
This will copy the specified include files from srcdir to the tgtdir, making sure that a file
*.request
is only copied after all other files have been copied. If no includes are given, all files in the srcdir are copied.For example, to submit a simple abaqus job from a folder with multiple job files, you can do:
submitJob('myjobdir','bumpfs1:bumper/requests/jobname',include=['*.inp'])
To submit a job having its own input folder equal to the job name, do:
submitJob('myjobdir/jobname','bumpfs1:bumper/requests/jobname')
- fe.jobs_menu.remoteCommand(host=None, command=None)[source]¶
Execute a remote command.
host: the hostname where the command is executed command: the command line
- fe.jobs_menu.runLocalProcessor(filename='', processor='abaqus')[source]¶
Run a black box job locally.
The black box job is a command run on an input file. If a filename is specified and is not an absolute path name, it is relative to the current directory.
- fe.jobs_menu.checkResultsOnServer(host=None, userdir=None)[source]¶
Get a list of job results from the cluster.
Specify userdir=’bumper/running’ to get a list of running jobs.