Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
312 commits
Select commit Hold shift + click to select a range
fd38bd5
make uploaded database names unique
markmac99 Feb 3, 2026
6aac11f
oops, make sure phase1 dir exists even in mc mode
markmac99 Feb 3, 2026
ce2877b
small bugfixes
markmac99 Feb 4, 2026
3622d0c
remove some excess verbosity
markmac99 Feb 4, 2026
67fefbe
indicate how many are being solved
markmac99 Feb 4, 2026
c4eecac
bugfix to handle nans in the database
markmac99 Feb 4, 2026
92f865a
add log suffix
markmac99 Feb 4, 2026
b271037
add log suffix properly
markmac99 Feb 4, 2026
1d366bf
catch SFTP fails
markmac99 Feb 4, 2026
333b48e
more small changes to protect against sftp fails
markmac99 Feb 4, 2026
c224ac1
defend against sftp failures
markmac99 Feb 11, 2026
47a2d27
bugfix to prevent phase2 crash merging data
markmac99 Feb 11, 2026
6da8bbb
add function to copy json data over
markmac99 Feb 11, 2026
83a2b72
bugfix: only move phase1 if client was doing phase1
markmac99 Feb 11, 2026
6ece9ab
make sure folders exist
markmac99 Feb 12, 2026
c9bb9bd
initialise remote data handling in the right place for phase2
markmac99 Feb 12, 2026
c9ede51
improve logging
markmac99 Feb 12, 2026
cda60ba
prevent crash in mcmode 2
markmac99 Feb 12, 2026
fbd7899
print operation mode more frequently
markmac99 Feb 12, 2026
7677acc
update remote data handling to actually move trajectories!
markmac99 Feb 12, 2026
21c94b4
slight improvement in shutdown messaging
markmac99 Feb 12, 2026
1b73810
bugfix
markmac99 Feb 12, 2026
8d8a325
chmod upload folders as needed
markmac99 Feb 12, 2026
cb20be5
fix perms on upload folders
markmac99 Feb 12, 2026
db2f17c
add some verbosity for debug
markmac99 Feb 13, 2026
e753a1e
bugfix in pairing routine
markmac99 Feb 13, 2026
b2cf365
Merge branch 'wmpg:master' into distrib_processing
markmac99 Feb 14, 2026
b12504a
rename archiveoldrecords to archivemonths
markmac99 Feb 14, 2026
379a5e9
Merge branch 'distrib_processing' of github.com:markmac99/WesternMete…
markmac99 Feb 14, 2026
4d212af
remove unnecessasry flag
markmac99 Feb 14, 2026
22dadc5
whoops changed param name incorrectly
markmac99 Feb 14, 2026
86721cd
initialise obs and traj db
markmac99 Feb 14, 2026
508f40e
a bit of documentation
markmac99 Feb 16, 2026
bd31fa0
check status from merge functions
markmac99 Feb 16, 2026
8de1c47
if connection fails, close gracefully and retry later
markmac99 Feb 16, 2026
e04f9f4
write pidfile
markmac99 Feb 16, 2026
17ef66d
remove unnecessary saving of temp pickles in ph2
markmac99 Feb 16, 2026
0a102b9
tidying up the date formats when reporting candidates, fails etc
markmac99 Feb 18, 2026
b73f07d
bugfix failed to define ref_dt
markmac99 Feb 19, 2026
7b45db1
add some comments
markmac99 Feb 26, 2026
91ab59e
create function to merge broken so we can call it elsewhere if needed
markmac99 Feb 26, 2026
615ea33
commit the write-ahead-log after every candidate save op
markmac99 Feb 27, 2026
43a4e8d
commit the obs database after saving candidates
markmac99 Feb 27, 2026
1a5d592
don't load stations or scan folders if in phase1 or phase2 only modes
markmac99 Feb 27, 2026
4ba68fc
support fractional bins
markmac99 Feb 27, 2026
3c0ae48
small correction in correlateDB
markmac99 Feb 27, 2026
f51e56c
remove unnecessary cursors
markmac99 Feb 27, 2026
d898e1f
support to purge local processed data
markmac99 Feb 27, 2026
704aa0a
make sure dbs are closed in the maintenance section
markmac99 Feb 27, 2026
51b637a
add verbosity
markmac99 Feb 27, 2026
3e7ac46
fix verbosity
markmac99 Feb 27, 2026
7c16e37
error handling in db merge process
markmac99 Feb 27, 2026
739ae25
remote remote WAL dbs after merger
markmac99 Feb 27, 2026
dcc904a
avoid trying to merge empty databases
markmac99 Feb 27, 2026
6415260
more fixes for database or table not existing
markmac99 Feb 27, 2026
d46b06f
documentation
markmac99 Feb 27, 2026
70b59ce
add more debug
markmac99 Feb 27, 2026
8071f49
delete rather than update when unpairing
markmac99 Feb 27, 2026
f663308
handle unpairing more efficiently with multi-insert
markmac99 Feb 27, 2026
6e20cf7
rename function more sensibly
markmac99 Mar 3, 2026
821bf68
switch logic round to mark paired after succeessful phase1. This redu…
markmac99 Mar 3, 2026
5fe13e0
remove unnecessay commit
markmac99 Mar 3, 2026
cfc0b81
pass new obs to solveTrajectory so they can be marked paired if needed
markmac99 Mar 4, 2026
7db6bdf
bug in phase1 processing
markmac99 Mar 5, 2026
ac19e59
working on ref_dt bug
markmac99 Mar 5, 2026
ced94c2
add debug messages to help testing
markmac99 Mar 5, 2026
9db92f7
tidying up
markmac99 Mar 6, 2026
e9d3c6e
avoid reprocessing already processed candidates
markmac99 Mar 7, 2026
c2572de
bugfixes and performance improvements
markmac99 Mar 8, 2026
e9794a8
remove incorrect location of Obs DB
markmac99 Mar 8, 2026
9612432
various improvements
markmac99 Mar 9, 2026
b9d9747
tidying up
markmac99 Mar 9, 2026
d7fabbd
fixes for issues #86, #87, #88, #94
markmac99 Mar 10, 2026
88bcd09
Add candidate database and use it
markmac99 Mar 11, 2026
48a35b0
purge older candidate data to keep database size reasonable
markmac99 Mar 11, 2026
cfd7645
save cands using jdt_ref to make checks easier
markmac99 Mar 11, 2026
c820387
small bug in cands db purge process
markmac99 Mar 11, 2026
bcaa042
move cand loading to within datahandle
markmac99 Mar 11, 2026
f234e8e
avoid slightly misleading message in log
markmac99 Mar 11, 2026
16a3db2
make sure to close and commit databases on exit
markmac99 Mar 11, 2026
2416d4b
bugfix
markmac99 Mar 12, 2026
1e44569
bugfixes and tidying up
markmac99 Mar 12, 2026
87c5109
add obs id to traj data
markmac99 Mar 15, 2026
21ab115
remove some debug
markmac99 Mar 16, 2026
8f6eaf6
add obs_ids to failed traj if convergence angle too small
markmac99 Mar 16, 2026
d9505a1
add ignored obs to database
markmac99 Mar 17, 2026
92e42bd
add ignored obs to traj object
markmac99 Mar 17, 2026
323d4c9
simplify updating the traj database
markmac99 Mar 17, 2026
6fe3f86
bugfix in trajdb
markmac99 Mar 17, 2026
a17a3a6
Merge branch 'wmpg:master' into distrib_processing
markmac99 Mar 20, 2026
205b9a3
add functionality to remove a trajectory by ID and to retrieve obsids…
markmac99 Mar 20, 2026
e74b8d7
remove some debugging
markmac99 Mar 21, 2026
830cce1
better remote data error management
markmac99 Mar 24, 2026
5bbf10e
improved duplicate management
markmac99 Mar 24, 2026
0fbfb3e
be sure to remove both traj with an overlap in obs so they get reanal…
markmac99 Mar 24, 2026
4a0c828
possible dupes: don't delete both trajs if not in auto mode
markmac99 Mar 26, 2026
c317cd6
less aggressive purging of processed phase1
markmac99 Mar 26, 2026
37cb56a
bugfixes in process to copy data from Json file
markmac99 Mar 27, 2026
e269d94
bugfix in allocation of data to children
markmac99 Mar 27, 2026
be840b8
log where phase1 files are saved
markmac99 Mar 27, 2026
8aa22e4
adding remote processing config file
markmac99 Mar 27, 2026
c12138c
tweaking debug
markmac99 Mar 27, 2026
b592ac8
support conversion of legacy trajectories as well as failed to sqlite
markmac99 Mar 28, 2026
9a3a4ed
more work on getting buckets right
markmac99 Mar 29, 2026
f421533
bugfix
markmac99 Mar 29, 2026
4fb4433
fix error in cand/phase1 saving logic
markmac99 Mar 29, 2026
83098f3
reworking on obs loading
markmac99 Mar 29, 2026
704bbb4
improve exception handling
markmac99 Mar 29, 2026
af31def
fixing timebucket calcs
markmac99 Mar 29, 2026
7521455
remove some debugging
markmac99 Mar 29, 2026
8b22845
improvements in data selection to avoid
markmac99 Mar 30, 2026
a89601a
performance bugfix in finding unprocessed data
markmac99 Mar 30, 2026
5785fed
bugfix when iterating through testing stations to ignore
markmac99 Mar 31, 2026
9433235
remove some debug and add some informational messages
markmac99 Mar 31, 2026
e6a8679
fix bug that was creating duplicates when reprocessing existing traj …
markmac99 Apr 1, 2026
8c8356b
updating some inline documentation
markmac99 Apr 3, 2026
68154de
Adding documentation on new capabilities
markmac99 Apr 3, 2026
0dfb9b4
Move documentation to right place
markmac99 Apr 3, 2026
047f784
More work on documentation
markmac99 Apr 3, 2026
bb872b7
More doco tweaks
markmac99 Apr 3, 2026
2807a0b
don't load json db if its not present (doh)
markmac99 Apr 4, 2026
5c09521
add merge process for canddb and fix small bug
markmac99 Apr 7, 2026
f437bca
bugfix in addTrajectory
markmac99 Apr 11, 2026
bae0d29
avoid closing closed databases
markmac99 Apr 11, 2026
8c5ce08
filter out legacy traj that can't be checked for dupes as easily
markmac99 Apr 11, 2026
5e44e3c
make dbdir and logdir if they dont exist
markmac99 Apr 16, 2026
b4daaa1
make sure traj objects include obs_ids when persisted
markmac99 Apr 20, 2026
300376b
bugfix - set candidate id and ref_ts in UTC
markmac99 Apr 20, 2026
7996132
sort trajbasics by jdt_ref
markmac99 Apr 21, 2026
cb989e3
bugfix for zero-length obsids
markmac99 Apr 21, 2026
58d7dea
correct return value from addTrajectory
markmac99 Apr 21, 2026
2d7a586
fix issues with updateTrajectoryDatabase
markmac99 Apr 21, 2026
ed9137d
missing verbose parameter
markmac99 Apr 24, 2026
781639e
bugfix to avoid crash if dupe traj arlready removed
markmac99 May 1, 2026
ca3fdf7
tiny tweak to avoid reprocessing the same events twice
markmac99 May 4, 2026
610b902
trying to fix bug #110
markmac99 May 5, 2026
2f55828
add some debug
markmac99 May 6, 2026
4ce305c
adding a little commentary
markmac99 May 6, 2026
4bbc6cb
Resolving issue where deduplication would crash if there were no
markmac99 May 6, 2026
32b9059
cosmetic tweak to remove irrelevant comment
markmac99 May 7, 2026
ba5e525
improvements in archiving/purging process
markmac99 May 13, 2026
89b9c7b
increase threshold for switching to only one timing estimation model.
markmac99 May 16, 2026
f4c6943
provide some additional logging when verbose is true
markmac99 May 16, 2026
04ee755
set default archivemonths to zero, meaning purge anything older than …
markmac99 May 28, 2026
9bf71d2
improve documentation
markmac99 May 28, 2026
f42cbca
missed an f-string
markmac99 May 28, 2026
68da3d4
update docs a little
markmac99 Jun 2, 2026
88258d6
minor tweak
markmac99 Jun 2, 2026
e77e398
Fix for issue 3 identified by Codex CLI
markmac99 Jun 3, 2026
0addda1
fix for issues 1,2,4 identified by Codex.
markmac99 Jun 3, 2026
4f1770c
fix for issue 6 identified by codex in an unused function. Also renam…
markmac99 Jun 3, 2026
c63d7b3
interestingly, this worked BEFORE my correction, because mcmode is a …
markmac99 Jun 3, 2026
9f67b33
improve handling of situations where the remote 'processed' file exists
markmac99 Jun 4, 2026
d2fc408
slight improvement in documentation
markmac99 Jun 4, 2026
02057b9
small doco changes
markmac99 Jun 4, 2026
11a431b
move processed phase1 from child nodes
markmac99 Jun 4, 2026
2f4fc0a
more clarification of the docs
markmac99 Jun 4, 2026
b6faca9
make sure we log assignment of candidates to nodes or master
markmac99 Jun 4, 2026
3a618a8
log if files are reallocated
markmac99 Jun 4, 2026
16facf5
daft error when checking and redistributing data
markmac99 Jun 4, 2026
bb78616
further small fix for capacity zero nodes
markmac99 Jun 4, 2026
6e1e7a4
small tweak to prevent overassignment to children
markmac99 Jun 5, 2026
0175ac3
make sure we properly log when pickles are assigned to a child
markmac99 Jun 5, 2026
0959005
typo
markmac99 Jun 5, 2026
affb633
oops log the correct target dir
markmac99 Jun 5, 2026
f677391
more doc changes
markmac99 Jun 5, 2026
e096cb0
Merge pull request #115 from wmpg/master
markmac99 Jun 8, 2026
ae3cd68
fix for bug where the original version of remotely calculated phase-2…
markmac99 Jun 12, 2026
ac23d37
minor tweak to use 'parent' instead of 'master'
markmac99 Jun 16, 2026
5209e1a
replace 'master' with 'parent'
markmac99 Jun 16, 2026
7bf1f28
replace 'master' with 'parent'
markmac99 Jun 16, 2026
8c160a0
Merge pull request #118 from wmpg/master
markmac99 Jun 17, 2026
f83956f
Adding documentation explaining how to set up remote processing from …
markmac99 Jun 17, 2026
dcd8691
Merge branch 'distrib_processing' of github.com:markmac99/WesternMete…
markmac99 Jun 17, 2026
2ab8928
Update Processing_High_Data_Volumes.md
markmac99 Jun 17, 2026
6ed0f52
fixes for issues 120 and 119 reported by Denis Vida
markmac99 Jun 18, 2026
7cf674c
Merge branch 'distrib_processing' of github.com:markmac99/WesternMete…
markmac99 Jun 18, 2026
6327dd7
bugfix for unusual case where trajectory has no valid obs_ids
markmac99 Jul 13, 2026
5243f88
add log handler to print messages to the console if no other streamha…
markmac99 Jul 13, 2026
a257a17
avoid double-logging
markmac99 Jul 14, 2026
eaa8b8e
correct a comment
markmac99 Jul 14, 2026
9f63e04
remove extra param from log.info
markmac99 Jul 14, 2026
08b1737
change info to warning
markmac99 Jul 14, 2026
30e46cf
fix bug in aggregateAndPlot - lam_err and bet_err not properly set if…
markmac99 Jul 14, 2026
70c167b
Merge branch 'wmpg:master' into distrib_processing
markmac99 Jul 14, 2026
a1ee994
make sure array is floating point
markmac99 Jul 14, 2026
1ebb1cd
Merge branch 'wmpg:master' into distrib_processing
markmac99 Jul 15, 2026
6f73c56
unwind some changes made via the mattex_bug fix so a clean merge can …
markmac99 Jul 17, 2026
d77fc2c
Merge branch 'distrib_processing' into fixmergeconf
markmac99 Jul 17, 2026
05e4916
Merge pull request #123 from markmac99/fixmergeconf
markmac99 Jul 17, 2026
6218be6
Fix for "Bug: this can return deleted trajectories, and the not jdt_e…
markmac99 Jul 20, 2026
051519c
detach attached databases after archiving;
markmac99 Jul 20, 2026
526aed6
reinstate reboundx
markmac99 Jul 21, 2026
46e8639
documentation bugs noted by Denis
markmac99 Jul 21, 2026
9805c9d
small fixes recommended by Denis
markmac99 Jul 21, 2026
b445f09
add support for multiple ssh key types
markmac99 Jul 21, 2026
0acdfaf
archiveCandDatabase, avoid purging the newly opened/created arch data…
markmac99 Jul 21, 2026
67fe1b9
add python version constraint on rebound as version 4.3.0 isn't suppo…
markmac99 Jul 21, 2026
2e5119f
update constraint on reboundx as 4.3.0 is available for python 3.13
markmac99 Jul 21, 2026
e4c2ef8
Merge pull request #125 from wmpg/master
markmac99 Jul 21, 2026
378f83d
apply upstream changes in rebound
markmac99 Jul 23, 2026
c66560e
add e to sync with upstream master
markmac99 Jul 23, 2026
53bab01
Merge pull request #128 from markmac99/master
markmac99 Jul 23, 2026
165f19f
error trapping round insertion of observations and trajectories
markmac99 Jul 23, 2026
7c3ff7a
add the l-bfgs-b cutoff parameter
markmac99 Jul 23, 2026
1301016
add l-bfgs-b cuttof as a parameter
markmac99 Jul 23, 2026
85747f9
rename the logger to wmpl_logger
markmac99 Jul 23, 2026
ac9a0f5
Merge pull request #129 from markmac99/quieten_rebound
markmac99 Jul 23, 2026
1a2afa9
pass logger to Trajectory() so that log messages can be captured by t…
markmac99 Jul 24, 2026
5b458bb
Merge pull request #130 from markmac99/quieten_rebound
markmac99 Jul 24, 2026
2ea79d6
Merge branch 'wmpg:master' into distrib_processing
markmac99 Jul 25, 2026
1b931bb
bugfix in correlator - legacy traj dont have l-bgfs-b cutofff
markmac99 Jul 25, 2026
d059373
forgot to remove unused parameter
markmac99 Jul 25, 2026
5a8d44d
remove disused function
markmac99 Jul 25, 2026
20c6664
Merge pull request #133 from wmpg/master
markmac99 Jul 28, 2026
8b05563
remove trajectory from db by ID not date
markmac99 Jul 28, 2026
0d13189
rework of database classes to use parameterised queries.
markmac99 Jul 28, 2026
dcb35c2
Adding test cases for CorrelateDB
markmac99 Jul 29, 2026
4932304
Add some simple tests for Correlator
markmac99 Jul 29, 2026
f34dfaf
missed data
markmac99 Jul 29, 2026
f608efc
slight change to acls
markmac99 Jul 30, 2026
eeaa5a1
improvements to remote-data handling. Still being tested
markmac99 Jul 30, 2026
d4dcfb4
improvements to remote data handling. Still being tested
markmac99 Jul 30, 2026
ac9e534
bugfix in capacity mgmt for nodes
markmac99 Jul 30, 2026
90a3fa3
fix up name of in flight files
markmac99 Jul 30, 2026
c853211
correct the names of the inflight files
markmac99 Jul 30, 2026
7216992
manage all child data renaming etc from the child
markmac99 Jul 31, 2026
4bbec09
improvements to avoid read/write conflicts during sftp uploads and pi…
markmac99 Aug 1, 2026
fcc7ad5
improve logging and fix a small error
markmac99 Aug 1, 2026
3526b10
incorrect logging
markmac99 Aug 1, 2026
31721e6
exception handling for the database merge processes
markmac99 Aug 1, 2026
50b1f67
bugfix: remove existing file when renaming a temp pickle or copied file
markmac99 Aug 2, 2026
3a88a4f
changes to only move processed files once finished with them but avoi…
markmac99 Aug 3, 2026
cc9b386
add WAL to trajectory DB and increase sqlite timeout to avoid db locks
markmac99 Aug 3, 2026
e92c104
manage test data better
markmac99 Aug 4, 2026
583288c
ignore test artefacts
markmac99 Aug 4, 2026
2f16131
don't put coverage files in github
markmac99 Aug 4, 2026
8592a2f
improved sqlite database handling and resilience
markmac99 Aug 4, 2026
d075793
Avoid distributing cands or traj that are already being processed
markmac99 Aug 4, 2026
b33411b
bugfix to avoid trying to read partial uploads
markmac99 Aug 4, 2026
eeda63e
bugfix removing write-ahead temp files
markmac99 Aug 4, 2026
ad059e0
correct error message
markmac99 Aug 4, 2026
26681cc
copy/paste error
markmac99 Aug 4, 2026
1ac0624
add explanation about retries
markmac99 Aug 4, 2026
233ac31
typo
markmac99 Aug 4, 2026
568379f
on the first pass, clear the being-processed flags so that traj or c…
markmac99 Aug 4, 2026
3e90e6c
better error handling in remoteDataHandler
markmac99 Aug 5, 2026
2b76f25
quieten successful uploads
markmac99 Aug 5, 2026
fa3728e
Quieten remote successful data downloads
markmac99 Aug 5, 2026
7d66b18
prevent removal of traj where the ph1 got uploaded but the main traj …
markmac99 Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ wmpl/share/Atens.txt
wmpl/share/gmn_shower_table_20230518.npy
wmpl/share/ELEMENTS.COMET
wmpl/MetSim/MetSimErosionCyTools.c
wmpl/Trajectory/Tests/correlator/phase1/
wmpl/Trajectory/Tests/correlator/trajectories/
wmpl/Trajectory/Tests/correlator/candidates/
wmpl/Trajectory/Tests/correlator/*.log
wmpl/Trajectory/Tests/**/*.db*
wmpl/Trajectory/Tests/**/*.pickle*
**/.coverage
146 changes: 146 additions & 0 deletions Documentation/Processing_High_Data_Volumes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Multi-Server or Distributed Mode

This document explains how WMPL can be run in a distributed (multi server) configuration, to allow higher data volumes to be processed. There's more information about this mode [here](WMPL_Upgrades_2026April.md).

## Notes
* The instructions below are for a Linux-type operating system. Adapting them for Windows is left as an exercise for the reader.
* For the purposes of this document, we will assume that WMPL is running under an account "ubuntu" on a server called "parent"and that we have a child node "node1".
* Node names to not need to match physical machine names (though you might find it useful for keeping track / auditing).
* Parent and children need not be on the same network, but it must be possible to connect between them using ssh and sftp.

## Prerequisites
### At least Two Computers
You will need at least two computers with WMPL installed. Installing WMPL is covered [here](https://github.com/wmpg/WesternMeteorPyLib/README.md).

Both Windows and Linux are supported, or a mixture of both. Child nodes can even be run under WSL2 on Windows. MacOS should also work though we have not tested it.

#### Parent Node
One computer will be the parent node and will
- load the raw camera data to create candidate groups of observations.
- distribute candidates to any child nodes and to itself.
- solve its own workload of candidates.
- receive any solutions uploaded by child nodes and integrate them into the solution dataset.

The parent node must have access to the raw camera data. The solved trajectories, logs and operational databases will be saved in folders on the parent node (these areas can be network shares).

#### Child nodes
Other computers will be child nodes and will
- connect to the parent and download any assigned data
- run the solver on the candidates
- upload any successful solutions to the parent node.

Child nodes do not need access to the raw data and do not require any long-term storage. All solved trajectories are uploaded back to the parent node and then removed from the child. Transient data on the child are housekept after a few days.

## 1: Setup Connectivity
### 1a: Create Child Node Public Keys
Login on each child node as the account that will run WMPL *on that node* and create an SSH key, then copy it to the parent:
``` bash
ssh-keygen -t ed25519 -f ~/.ssh/wmpl -N ""
Comment thread
markmac99 marked this conversation as resolved.
scp ~/.ssh/wmpl.pub ubuntu@parent:/tmp/node1.pub
```
You will of course have to provide the correct login details for the scp command.

### 1b: Install an SSH Server on the Parent
The parent node must have an SSH/SFTP server to allow child nodes to collect data and upload results.

The SSH server is normally preinstalled on Linux though you may need to activate it. On Windows, you can install OpenSSH Server as explained [here](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui&pivots=windows-11).

### 1c: Create a "wmpl" Unix Group on the Parent
This group will be used to manage permissions for the child accounts on the parent node.
```bash
sudo groupadd wmpl
```

### 1d: Create Child Node Accounts and File Structure on the Parent
On the parent, create accounts and the required file structure for each child node as shown below, changing the value of NODENAME as needed

```bash
NODENAME=node1
sudo useradd $NODENAME -G wmpl
sudo mkdir -p /home/$NODENAME/files/candidates/processed
sudo mkdir -p /home/$NODENAME/files/phase1/processed
sudo mkdir -p /home/$NODENAME/files/trajectories
sudo chown $NODENAME:$NODENAME /home/$NODENAME
sudo chown -R $NODENAME:wmpl /home/$NODENAME/files
sudo chmod -R 775 /home/$NODENAME/files
```
You should end up with a structure like the one below.

![image](node_structure.png)

### 1e: Set Child Node ACLs on the Parent
Group permissions may not be sufficient to ensure the parent account can access the child accounts. To make certain you can apply extended ACLs to the folders as follows:
```bash
sudo setfacl -R -m user:ubuntu:rwx ~node1
```
replace 'ubuntu' with the account that will run WMPL on the parent.

### 1f: Enable Sftp Logins for each Child Node on the Parent
On the parent, sudo to each child node account in turn and enable key-based logins following the example below.
Additionally while we're still configuring things we don't want WMPL to start trying to distribute data. So we create a 'stop' file in each child's 'files' folder.

```bash
sudo su - node1
mkdir .ssh
chown $(whoami):$(whoami) .ssh
chmod 0700 .ssh
cat /tmp/$(whoami).pub >> .ssh/authorized_keys
chmod 0600 .ssh/authorized_keys

echo "stop" > ~/files/stop
```

Test that this has worked by logging into each child node, then attempting to connect to the parent with ssh:
``` bash
ssh -i ~/.ssh/wmpl node1@parent
```
Answer 'yes' if asked to accept the server key. If you get 'permission denied' check that you added the right key to the child's authorized_keys file on the parent node.

## 2) Enable Remote Processing on the Parent
### 2a) Configure Remote Processing on the Parent
Copy `wmpl_remote.cfg.sample` to `wmpl_remote.cfg` in the WMPL working directory on the parent. The working directory is the folder that contains the sqlite databases or legacy `processed_trajectories.json` file.

Edit this file to ensure that the mode is `parent` and then configure one row for each child node, following the patterns shown in the sample file. See [here](WMPL_Upgrades_2026April.md) for more details on how to configure each node and for recommended capacity values, but in general each child node should be allocated capacity of no more than 200 at a time, to avoid delays in processing.

## 2b) Start WMPL on the Parent Node
You need to run three instances of the correlator on the parent node, one in mcmode 4 to create candidate groups, one in mcmode 1 to perform local solving of candidates, and one in mcmode 2 to perform full monte-carlo solutions. Example command lines are shown below.

``` bash
# candidate-finder node. This will continuously scan the DATADIR for potential candidate groups
python -m wmpl.Trajectory.CorrelateRMS $DATADIR --mcmode 4 --logdir $LOGDIR --dbdir $DBDIR --outdir $OUTDIR -a 4 --autofreq 15 --addlogsuffix

# local solver. This will collect candidates and attempt to solve them
python -m wmpl.Trajectory.CorrelateRMS $DATADIR --mcmode 1 --logdir $LOGDIR --dbdir $DBDIR --outdir $OUTDIR -a --autofreq 30 --addlogsuffix

# local monte-carlo phase solver. This will collect phase1 solutions and add uncertainties
python -m wmpl.Trajectory.CorrelateRMS $DATADIR --mcmode 2 --logdir $LOGDIR --dbdir $DBDIR --outdir $OUTDIR -a --autofreq 60 --addlogsuffix
```

With these options the correlator will read data from DATADIR, write trajectories to OUTDIR, write logs to LOGDIR with a suffix indicating which mode it is running in, and save the operational databases in DBDIR.

These options also instruct the candidate-finder (mcmode 4) to run at least every 15 minutes collecting any new data from the last four days (as set by `-a 4`), the phase-1 solver to run every 30 minutes, collecting any available data irrespective of date, and the phase-2 solver to run every 60 minutes again collecting any available data.

The remote config file will be read from DBDIR. The file is re-loaded every time WMPL starts a new run (every 15 minutes in this example) and so you can dynamically add or remove nodes by updating the file. Initially all nodes will be disabled because earlier we created "stop" files at step (1f) above.

## 3) Enable Remote Processing on Child Nodes
### 2a) Configure Remote Processing on the Parent
Copy `wmpl_remote.cfg.sample` to `wmpl_remote.cfg` in the WMPL working directory on the child. The working directory is the folder that contains the sqlite databases or legacy `processed_trajectories.json` file.

Edit this file to set mode to `child` and to configure the SFTP login details appropriately.

## 3b) Start WMPL on the Child Node
We run only one instance of WMPL on the child node.
```bash
# local solver. This will collect candidates and attempt to solve them then upload the results back to the parent
DATADIR=.
python -m wmpl.Trajectory.CorrelateRMS $DATADIR --mcmode 1 --logdir $LOGDIR --dbdir $DBDIR --outdir $OUTDIR -a --autofreq 15 --addlogsuffix
```
When it first starts up, the correlator will connect to the parent, remove the stop file and wait for data to be assigned to it.
On its next pass round the parent will see that the stop file has been removed, and will assign some data to the child.
On the child's next pass, it will collect the data, process and upload the results.
The parent will then consolidate it into the main dataset.

## 3c) Distributing Phase1 to Child Nodes
In the explanation above we've focused on distributing candidates so that we can quickly obtain initial (phase1) solutions.

It is also possible to distribute phase1 solutions to child nodes which can then perform monte-carlo solutions. We do this by adding a node to the parent's remote config file, indicating that a node is in "mode 2". Then we start up a node as above, but instead of mcmode 1, we run it in mcmode 2.
Loading