OpenSprinkler firmware supports two master zones, however, each non-master station can only be associated with one of the two masters. If you want a particular zone to be associated with one master in some programs, and another master in different programs, there are two work-arounds:
Option 1: instead of using master zones, treat the master zones as standard zones, but set them to run ‘parallel’ (i.e. turn off the ‘sequential’ flag of these two zones). I will call them source 1 and source 2 to avoid using the term ‘master’. Then when you schedule a program, make sure to include the desired source zone with a duration that’s equal to the entire program run time. That ways, when the program runs, the source zone will run for the entire duration of the program along with other stations (because it’s set as ‘parallel’, it’s allowed to run together with other zones). This way, you are essentially setting per-program master zone.
Option 2: use master zones, but for each station, have it occupy two station ports (for example, the ‘front yard’ zone wire will simultaneously go to station port 3 and 4). Set station 3 to activate master 1, and station 4 to activate master 2. This way, station 3 and 4 can both turn on the ‘front yard’ zone, but when station 3 is on, master 1 is also activated, and when station 4 is on, master 2 is activated instead. The benefit of this option is that the master zone is automatically managed. The downside is that you need twice as many physical zones as the number of valves (since each will occupy two station ports).