Skip to content
Snippets Groups Projects

[RTADPA BW tests] Small cleanups after !359

Merged Ross John Hunter requested to merge rjhunter-bwtest-cleanup-copies into master
1 file
+ 9
10
Compare changes
  • Side-by-side
  • Inline
@@ -27,6 +27,7 @@ import tempfile
import atexit
import shutil
import yaml
from datetime import datetime
# Default cache dir is the current working directory as this is most convenient for the machine
# that the test runs on periodically. It assumes the working directory is not cleaned up often,
@@ -36,9 +37,6 @@ DEFAULT_CACHE_DIRS = {'default': ['.']}
# prefer XDG_RUNTIME_DIR which should be on tmpfs
FALLBACK_CACHE_DIR = os.getenv('XDG_RUNTIME_DIR', tempfile.gettempdir())
# Limit size of output log if many options files
MAX_NFILES_TO_PRINT_TO_LOG = 10
def default_cache_dirs():
hostname = socket.getfqdn()
@@ -170,7 +168,6 @@ if __name__ == '__main__':
job_inputs = [
inputs_fns
] # This is a list to allow for possible NUMA extension: see discussion on !316.
logging.info(inputs_fns[:MAX_NFILES_TO_PRINT_TO_LOG])
# Set up local directories where inputs are cached
if args.download_input_files:
@@ -190,22 +187,24 @@ if __name__ == '__main__':
# Now download files
for i, inputs in enumerate(job_inputs):
logging.info(
f'Downloading input files {inputs[:MAX_NFILES_TO_PRINT_TO_LOG]}'
)
if all(is_remote(url) for url in inputs):
from Moore.qmtest.context import download_mdf_inputs_locally
# download_mdf_inputs_locally only downloads if files
# are not already available locally on the machine
before_copy = datetime.now()
logging.info(
f'Downloading inputs for bandwidth job to {args.cache_dirs[i]}')
logging.info(
'Downloading inputs for bandwidth job to {}'.format(
args.cache_dirs[i]))
f'There are {len(inputs)} input files: [{inputs[0]}, {inputs[1]}, ... ]'
)
kB_to_GB = 1e3
job_inputs[i] = download_mdf_inputs_locally(
inputs,
args.cache_dirs[i],
max_size=args.avg_evt_size * kB_to_GB * args.events)
logging.info(inputs)
logging.info(
f"Finished file downloads. This took: {datetime.now() - before_copy}"
)
elif any(is_remote(url) for url in inputs_fns):
parser.error('inputs must either be all xrootd or all local')
else:
Loading