mento.utils#
Utility functions for internal use by online analysis triggering modules at different beamlines.
Functions#
- _map_local_to_remote_path(beamline_local_path, remote_rootdir, remote_subdir):
Generate file path on the remote cluster corresponding to a local file path as shown at the beamline.
- _name_resultfile_with_suffix(datafile_path, result_suffix):
Generate result file name on local beamline filesystem, derived from input data file.
- _name_resultdir(datafile_path):
Get the full path of the location to store results corresponding to the input data file.
- make_writable_dir(dir_name):
Create a directory and make it world-writable, world-readable.
- run_subprocess():
Run command either on local machine with Bash, or after connecting to remote machine with SSH
- run_slurm():
Not yet implemented
- retrieve_script_path(arg_list):
Get the path to the local/remote script to be run by the trigger
- retrieve_arg_list(arg_list):
Get the arguments to be fed to the local/remote script to be run by the trigger
- flatten_arg_list(arg_list):
Flatten all nested lists inside a list to present a one-level list (with no list element being a list itself)
Functions
|
Internal function. |
|
Get the full path valid on the core filesystem on Maxwell, corresponding to the local path. |
|
Get the full path valid on the reserved compute node during the beamtime. |
|
Create a directory and make it world-writable, world-readable. |
|
Make up the name of a result file, derived from the input data file name, then create the appropriate directory tree to store this result file in. |
|
Use Slurm REST API to submit a batch job directly from the local machine. |
|
Use Python's subprocess module to run a command with arguments. |