Enabling Distributed Processing - #61
Conversation
add some verbosity flags to support more advanced logging
…orPyLib into distrib_processing
In fact this should be handled already elsewhere. Each trajectory contains a traj = loadPickle(src_path, src_name)
if hasattr(traj, 'pre_mc_longname') and traj.pre_mc_longname != traj.longname:
# When saving MC-phase solns we need to check if the MC phase has changed the reference time
# slightly, and if so, remove the original folder to ensure no duplicates.
pretraj = traj.pre_mc_longname
pre_path = os.path.join(self.output_dir, 'trajectories', pretraj[:4], pretraj[:6], pretraj[:8], pretraj)
log.info(f'removing {pre_path}')
if os.path.isdir(pre_path):
shutil.rmtree(pre_path, ignore_errors=True)Then, in So, while its a bit convoluted, i think it does do what we need. and in testing, I did not encounter any situations where phase1 solns were orphaned. I will double check though. |
Note that this risk already exists because even on a single server the phase1 process could be writing to the Issues can arise in three places .
To ensure partly-created pickles are not read by sftp or other processes on the parent, I've altered To ensure partly-complete uploads are not read, i've altered I've also created a function |
…nd left behind after a crash or shut down get picked up.
|
I've made what i hope are the final changes. Candidates and phase1 solutions that are being processed are now no longer moved to the processed/ folders till after processing is complete. To prevent the same data being picked up by another process or remote node, the status is marked as 2 in the database. This entailed some changes to the DB class to handle concurrency better. Testing: The parent node distributed and collected data as expected as well as processing is own workload. The remote nodes collected data, processed and uploaded as expected. There was occasionally an upload failure sending data to the parent node but this is handled by sending the data on the next pass. Let me know if you spot anything else i need to look at. |
An upgrade to the RMS solver, CorrelateRMS, to enable distributed processing across multiple servers. To assist with this the first step has been split into two, one to create candidates and one to perform initial simple solutions.
This PR also replaces the JSON database with SQLite which is necessary to enable distributed processing and also brings performance benefits. The PR adds two new commandline arguments, one to control how much data to retain in the databases, and one to post-fix the log name with the phase name eg correlate_rms_20260101_12345_cands.log. This is to ensure each phase's logfile is uniquely named and to make it easier to monitor and debug.