Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • atlas-tdaq-software/CES
1 result
Show changes
Commits on Source (2)
......@@ -254,8 +254,10 @@ public class CEPService {
if(this.enableMetrics == true) {
this.esper.getMetricsService().setMetricsReportingEnabled();
CEPService.log.info("Enabled metrics reporting");
} else {
this.esper.getMetricsService().setMetricsReportingDisabled();
CEPService.log.info("Disabled metrics reporting");
}
CEPService.log.info("CEP engine configured.");
......
......@@ -67,6 +67,9 @@ public class ClockSwitchExecutor extends DeferredActionExecutor {
private final static String MUCTPI_CONTROLLER_DEFAULT = "MuctpiController";
private final static int MUCTPI_TIMEOUT_DEFAULT = 15;
private final static String NSW_CONTROLLER_DEFAULT = "NSW-ClockSwitchReceiver";
private final static int NSW_TIMEOUT_DEFAULT = 15;
private final static int CTP_TIMEOUT_DEFAULT = 15;
@Value("#{configuration['chip.cs.l1calo.controller']}")
......@@ -107,6 +110,12 @@ public class ClockSwitchExecutor extends DeferredActionExecutor {
@Value("#{configuration['chip.cs.muctpi.timeout']}")
private Integer muctpiTimeout;
@Value("#{configuration['chip.cs.nsw.controller']}")
private String NSW_CONTROLLER;
@Value("#{configuration['chip.cs.nsw.timeout']}")
private Integer nswTimeout;
@Value("#{configuration['chip.cs.ctp.timeout']}")
private Integer ctpTimeout;
......@@ -537,6 +546,12 @@ public class ClockSwitchExecutor extends DeferredActionExecutor {
return controllerName;
}
private String nswController() {
final String controllerName = ((this.NSW_CONTROLLER != null) && (this.NSW_CONTROLLER.isEmpty() == false)) ? this.NSW_CONTROLLER
: ClockSwitchExecutor.NSW_CONTROLLER_DEFAULT;
return controllerName;
}
private String muctpiController() {
final String controllerName = ((this.MUCTPI_CONTROLLER != null) && (this.MUCTPI_CONTROLLER.isEmpty() == false)) ? this.MUCTPI_CONTROLLER
: ClockSwitchExecutor.MUCTPI_CONTROLLER_DEFAULT;
......@@ -649,73 +664,36 @@ public class ClockSwitchExecutor extends DeferredActionExecutor {
ClockSwitchExecutor.log.info("Not sending resynch commands to " + controllerName + " because it is not part of the partition");
}
}
private void sendAfpResync(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg) {
final String controllerName = this.afpController();
final String cmdName = this.csrCommand();
final Map<String, RCApplicationConfig> allApps = this.daqReader.getRCApplications();
if(allApps.containsKey(controllerName) == true) {
try {
this.execRC_partition.sendUserBroadcast(controllerName,
cmdName,
new String[] {cmdArg.toString()},
Boolean.TRUE,
this.afpTimeout != null ? this.afpTimeout.intValue() : ClockSwitchExecutor.AFP_TIMEOUT_DEFAULT);
}
catch(final ExecutorRCException ex) {
final ClockSwitch event = new ClockSwitch(clockSwitch.getType(),
STATUS.PROBLEM,
clockSwitch.getBeamMode(),
clockSwitch.getState(),
clockSwitch.getId());
event.setError("Problem sending the resync \"" + cmdArg.toString() + "\" command to AFP", ex);
this.cep.injectEvent(event);
}
} else {
ClockSwitchExecutor.log.info("Not sending resynch commands to " + controllerName + " because it is not part of the partition");
}
}
private void sendZdcResync(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg) {
final String controllerName = this.zdcController();
private void sendCtpResync(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg) {
final String cmdName = this.csrCommand();
final Map<String, RCApplicationConfig> allApps = this.daqReader.getRCApplications();
if(allApps.containsKey(controllerName) == true) {
try {
this.execRC_partition.sendUserBroadcast(controllerName,
cmdName,
new String[] {cmdArg.toString()},
Boolean.TRUE,
this.zdcTimeout != null ? this.zdcTimeout.intValue() : ClockSwitchExecutor.ZDC_TIMEOUT_DEFAULT);
}
catch(final ExecutorRCException ex) {
final ClockSwitch event = new ClockSwitch(clockSwitch.getType(),
STATUS.PROBLEM,
clockSwitch.getBeamMode(),
clockSwitch.getState(),
clockSwitch.getId());
event.setError("Problem sending the resync \"" + cmdArg.toString() + "\" command to ZDC", ex);
this.cep.injectEvent(event);
}
} else {
ClockSwitchExecutor.log.info("Not sending resynch commands to " + controllerName + " because it is not part of the partition");
try {
this.execTrigger.sendRCUserCommand(cmdName,
new String[] {cmdArg.toString()},
Boolean.TRUE,
this.ctpTimeout != null ? this.ctpTimeout.intValue() : ClockSwitchExecutor.CTP_TIMEOUT_DEFAULT);
}
catch(final ExecutorRCException ex) {
final ClockSwitch event = new ClockSwitch(clockSwitch.getType(),
STATUS.PROBLEM,
clockSwitch.getBeamMode(),
clockSwitch.getState(),
clockSwitch.getId());
event.setError("Problem sending the resync \"" + cmdArg.toString() + "\" command to CTP", ex);
this.cep.injectEvent(event);
}
}
private void sendMuctpiResync(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg) {
final String controllerName = this.muctpiController();
final String cmdName = this.csrCommand();
private void sendResync(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg, final String controllerName, final int timeout) {
final Map<String, RCApplicationConfig> allApps = this.daqReader.getRCApplications();
if(allApps.containsKey(controllerName) == true) {
try {
this.execRC_partition.sendUserBroadcast(controllerName,
cmdName,
new String[] {cmdArg.toString()},
this.csrCommand(),
new String[] { cmdArg.toString() },
Boolean.TRUE,
this.muctpiTimeout != null ? this.muctpiTimeout.intValue() : ClockSwitchExecutor.MUCTPI_TIMEOUT_DEFAULT);
timeout);
}
catch(final ExecutorRCException ex) {
final ClockSwitch event = new ClockSwitch(clockSwitch.getType(),
......@@ -723,44 +701,54 @@ public class ClockSwitchExecutor extends DeferredActionExecutor {
clockSwitch.getBeamMode(),
clockSwitch.getState(),
clockSwitch.getId());
event.setError("Problem sending the resync \"" + cmdArg.toString() + "\" command to MuCTPi", ex);
event.setError("Problem sending the resync \"" + cmdArg.toString() + "\" command to \"" + controllerName + "\": ", ex);
this.cep.injectEvent(event);
}
} else {
ClockSwitchExecutor.log.info("Not sending resynch commands to " + controllerName + " because it is not part of the partition");
}
}
private void sendCtpResync(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg) {
final String cmdName = this.csrCommand();
try {
this.execTrigger.sendRCUserCommand(cmdName,
new String[] {cmdArg.toString()},
Boolean.TRUE,
this.ctpTimeout != null ? this.ctpTimeout.intValue() : ClockSwitchExecutor.CTP_TIMEOUT_DEFAULT);
}
catch(final ExecutorRCException ex) {
final ClockSwitch event = new ClockSwitch(clockSwitch.getType(),
STATUS.PROBLEM,
clockSwitch.getBeamMode(),
clockSwitch.getState(),
clockSwitch.getId());
event.setError("Problem sending the resync \"" + cmdArg.toString() + "\" command to CTP", ex);
this.cep.injectEvent(event);
}
}
}
}
private void sendResynchsParallel(final ClockSwitch clockSwitch, final CSR_CMD_ARG cmdArg) {
try {
// Long commands, execute them in parallel
final List<Future<?>> tasks = new ArrayList<>();
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> { this.sendL1CaloResync(clockSwitch); }));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> { this.sendAfpResync(clockSwitch, cmdArg); }));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> { this.sendZdcResync(clockSwitch, cmdArg); }));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> { this.sendCtpResync(clockSwitch, cmdArg); }));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> { this.sendMuctpiResync(clockSwitch, cmdArg); }));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> {
this.sendL1CaloResync(clockSwitch);
}));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> {
this.sendCtpResync(clockSwitch, cmdArg);
}));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> {
this.sendResync(clockSwitch,
cmdArg,
this.afpController(),
this.afpTimeout != null ? this.afpTimeout.intValue() : ClockSwitchExecutor.AFP_TIMEOUT_DEFAULT);
}));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> {
this.sendResync(clockSwitch,
cmdArg,
this.zdcController(),
this.zdcTimeout != null ? this.zdcTimeout.intValue() : ClockSwitchExecutor.ZDC_TIMEOUT_DEFAULT);
}));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> {
this.sendResync(clockSwitch,
cmdArg,
this.muctpiController(),
this.muctpiTimeout != null ? this.muctpiTimeout.intValue() : ClockSwitchExecutor.MUCTPI_TIMEOUT_DEFAULT);
}));
tasks.add(ClockSwitchExecutor.resynchTp.submit(() -> {
this.sendResync(clockSwitch,
cmdArg,
this.nswController(),
this.nswTimeout != null ? this.nswTimeout.intValue() : ClockSwitchExecutor.NSW_TIMEOUT_DEFAULT);
}));
for(final Future<?> t : tasks) {
try {
......
......@@ -63,6 +63,11 @@ chip.cs.zdc.timeout = 15
chip.cs.muctpi.controller = MuctpiController
chip.cs.muctpi.timeout = 15
# Properties for commands sent to NSW during clock switch
# Timeouts in seconds
chip.cs.nsw.controller = NSW-ClockSwitchReceiver
chip.cs.nsw.timeout = 15
# Properties for commands sent to CTP during clock switch
# Timeouts in seconds
chip.cs.ctp.timeout = 15
......