Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
0a8891c
Use ET 16 instead of 14
JeremyMcCormick Jun 2, 2021
c008068
Merge branch 'master' into monitoring-dev-2021
JeremyMcCormick Jun 14, 2021
b85ac97
Merge branch 'master' into monitoring-dev-2021
bloodyyugo Aug 3, 2021
a647cb1
drivers and steering files for online recon
bloodyyugo Aug 10, 2021
f99aba9
Merge branch 'monitoring-dev-2021' of github.com:JeffersonLab/hps-jav…
JeremyMcCormick Aug 20, 2021
c5c991c
online recon driver for 2021 KF tracking; still in test mode
bloodyyugo Aug 21, 2021
3c3d09e
get track parameters referenced to target Z
bloodyyugo Aug 21, 2021
ac1a106
Rework processing of command line in client
JeremyMcCormick Aug 21, 2021
a7772ce
Minor rename of producer script
JeremyMcCormick Aug 21, 2021
e4edbbb
Merge branch 'monitoring-dev-2021' of github.com:JeffersonLab/hps-jav…
JeremyMcCormick Aug 21, 2021
6f4d02e
Possible fix for problems with restarting stopped stations
JeremyMcCormick Aug 21, 2021
5c540a1
Make Matt's monitoring driver work with online recon
JeremyMcCormick Aug 21, 2021
5ae355d
Add check of aggregation flag
JeremyMcCormick Aug 21, 2021
e560cd7
Put remote init into a separate method
JeremyMcCormick Aug 21, 2021
1831f08
Remove some debug prints
JeremyMcCormick Aug 21, 2021
d96f3a3
Change lcsim builder default to 2019 version
JeremyMcCormick Aug 23, 2021
4f8fff8
Fix bug in arg processing
JeremyMcCormick Aug 23, 2021
24621d8
Simplify management of remote AIDA tree and make sure start and stop …
JeremyMcCormick Aug 23, 2021
f1097e8
Decrease log level msg
JeremyMcCormick Aug 23, 2021
15732ca
Remove unused import
JeremyMcCormick Aug 23, 2021
d052c10
Make sure target dir exists before copying
JeremyMcCormick Aug 23, 2021
4de97fd
Simplify AIDA remote init
JeremyMcCormick Aug 23, 2021
abae47a
Minor changes to logging
JeremyMcCormick Aug 23, 2021
e1d1c82
A few small updates to synchronization
JeremyMcCormick Aug 23, 2021
0d3ab64
Change log msg
JeremyMcCormick Aug 23, 2021
12967dd
Fix bug in updating settings
JeremyMcCormick Aug 24, 2021
1cd7cba
Add optional setting for lcsim classpath
JeremyMcCormick Aug 24, 2021
3b9885a
Use lcsim classpath if set
JeremyMcCormick Aug 24, 2021
ea94fc4
Add notifier using web sockets to improve plot updating
JeremyMcCormick Aug 24, 2021
a20d5b9
Remove debug log msg
JeremyMcCormick Aug 24, 2021
c531f00
Remove old import
JeremyMcCormick Aug 24, 2021
f5a9ca6
Revert to ET 14
JeremyMcCormick Aug 24, 2021
8955090
Fix error messages related to missing slf4j lib
JeremyMcCormick Aug 24, 2021
47659a0
Move event timing to RemoteAidaDriver
JeremyMcCormick Aug 24, 2021
d4fa10d
Remove debug print
JeremyMcCormick Aug 24, 2021
ec55c46
Set system properties for station name and remote tree binding
JeremyMcCormick Aug 24, 2021
ee3dda3
Comment out setting that is not needed any longer
JeremyMcCormick Aug 24, 2021
8d63d25
A few improvements to plot aggregation; comment out low level logging…
JeremyMcCormick Aug 25, 2021
f24da58
Run plot aggregation with a fixed 5 second period in between
JeremyMcCormick Aug 25, 2021
ced1f5b
Small change to print out
JeremyMcCormick Aug 25, 2021
35d1b22
Disable object overwriting in tree; add a few comments
JeremyMcCormick Aug 25, 2021
b075fc4
Allow ET version to be set using a property; default to 14.1
JeremyMcCormick Aug 25, 2021
b7001db
Correct syntax error
JeremyMcCormick Aug 25, 2021
5dec0f2
merged OnlineRecon2021KF/SeedTracker to new tracking independtent dri…
bloodyyugo Aug 25, 2021
6bc8900
made a dumb mistake in driver; fix steering files to work with remote…
bloodyyugo Aug 26, 2021
1949242
cleanup up directories a bit; added some options to show/not plots
bloodyyugo Aug 26, 2021
842a3e4
removed somthing I shouldnt have...turn on extra plots in steering
bloodyyugo Aug 26, 2021
eca4e35
try to make main plots for each section show up on one web page
bloodyyugo Aug 27, 2021
2b983cf
mkdir to mkdirs
bloodyyugo Aug 27, 2021
550b15e
Experimental JVM settings for server script
JeremyMcCormick Aug 27, 2021
0dd5009
Merge changes from remote and fix a few conflicts
JeremyMcCormick Aug 27, 2021
6241e0a
change some dir names by x
bloodyyugo Aug 27, 2021
db56928
pare down some ecal plots
bloodyyugo Aug 28, 2021
ce3ec02
Merge branch 'monitoring-dev-2021' of github.com:JeffersonLab/hps-jav…
JeremyMcCormick Aug 28, 2021
caf6445
Comment out updates adding event perf plots for now
JeremyMcCormick Aug 28, 2021
8ab112d
Remove files from cache
JeremyMcCormick Aug 28, 2021
aaee9d7
Fix logger error
JeremyMcCormick Aug 28, 2021
f0932a1
Put event performance plots into RemoteAidaDriver
JeremyMcCormick Aug 28, 2021
1b28efa
Use proper date values for event plots
JeremyMcCormick Aug 29, 2021
afd7848
Suppress log4j warnings and messages
JeremyMcCormick Aug 29, 2021
57a66a4
Remove duplicate var and minor cleanup
JeremyMcCormick Aug 29, 2021
fe11350
Checkpoint work on adding combined event rate plots
JeremyMcCormick Aug 29, 2021
9f43f34
Increase max mem of server to 4g
JeremyMcCormick Aug 30, 2021
400db86
Cleanup and minor changes
JeremyMcCormick Aug 30, 2021
c1419a3
Use 1 sec refresh
JeremyMcCormick Aug 30, 2021
f02ab46
make an ecal only recon for testing on real et ring
bloodyyugo Aug 30, 2021
dffd22d
f-ing checkstyles
bloodyyugo Aug 30, 2021
b542627
again with checkstyles
bloodyyugo Aug 30, 2021
87e4d6c
messed up driver name
bloodyyugo Aug 30, 2021
efc6f8e
set selectMode to selectAll so that non-blocking works
bloodyyugo Aug 31, 2021
b3b0273
Revert "set selectMode to selectAll so that non-blocking works"
bloodyyugo Aug 31, 2021
76d6103
add collection exists checks to monitoring driver
bloodyyugo Aug 31, 2021
d6238da
fix a bug in class type
bloodyyugo Aug 31, 2021
f07c875
Remove print out
JeremyMcCormick Aug 31, 2021
6106bda
Add axis labels
JeremyMcCormick Aug 31, 2021
a93211b
Add combined event time plot and station event counts hist
JeremyMcCormick Aug 31, 2021
e48ab65
Merge branch 'monitoring-dev-2021' of github.com:JeffersonLab/hps-jav…
JeremyMcCormick Aug 31, 2021
0c4b4fd
get rid of RfFitter driver from steering
bloodyyugo Aug 31, 2021
e1d7b16
Add copy of occupancy plots from a single remote
JeremyMcCormick Sep 2, 2021
ea52129
Merge branch 'monitoring-dev-2021' of github.com:JeffersonLab/hps-jav…
JeremyMcCormick Sep 2, 2021
9963408
Just remove comment
JeremyMcCormick Sep 2, 2021
681e7c8
Increase max mem for EVIO producer
JeremyMcCormick Sep 3, 2021
47e3878
Fixes so that station activation and deactivation works properly and …
JeremyMcCormick Sep 3, 2021
ec372c3
Put log4j suppression stuff in logging config classes
JeremyMcCormick Sep 3, 2021
96c2881
Restore server-side ET wake up and other tweaks
JeremyMcCormick Sep 3, 2021
80ad05f
Do shutdown on a separate thread so client returns immediately
JeremyMcCormick Sep 3, 2021
44a73cb
Simplify log messages
JeremyMcCormick Sep 3, 2021
a14ddef
Cleanup server shutdown and a few other methods
JeremyMcCormick Sep 3, 2021
6ddaac5
Use a reentrant lock for updating in aggregator
JeremyMcCormick Sep 4, 2021
3a47b67
Minor changes and cleanup
JeremyMcCormick Sep 4, 2021
fc41146
Revert driver to master
JeremyMcCormick Feb 1, 2022
00e1e89
Remove swap file
JeremyMcCormick Feb 2, 2022
a1c70ab
Minor updates to .gitignore
JeremyMcCormick Feb 2, 2022
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
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ hs_err_pid*
.settings
nbproject

# Maven target dir
target

# Diff output
*.diff

Expand All @@ -40,4 +37,11 @@ ETBuffer

deps.txt

# directories to ignore
scratch/
bin/
target/


# editor swap files
.*.swp
44 changes: 37 additions & 7 deletions online-recon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<version>5.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.hps</groupId>
<artifactId>hps-online-monitoring</artifactId>
</dependency>
<dependency>
<groupId>org.hps</groupId>
<artifactId>hps-recon</artifactId>
Expand Down Expand Up @@ -45,12 +49,27 @@
<groupId>org.sonatype.nexus</groupId>
<artifactId>google-guava-eventbus</artifactId>
<version>3.2.0-01</version>
</dependency>
</dependency>
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- https://www.mojohaus.org/appassembler/appassembler-maven-plugin/ -->
<plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.10</version>
Expand All @@ -74,35 +93,46 @@
<mainClass>org.hps.online.recon.Server</mainClass>
<id>online-recon-server</id>
<jvmSettings>
<maxMemorySize>1g</maxMemorySize>
<maxMemorySize>4g</maxMemorySize>
<initialMemorySize>1g</initialMemorySize>
<maxStackSize>128m</maxStackSize>
<systemProperties>
<systemProperty>java.util.logging.config.class=org.hps.online.recon.logging.ServerLoggingConfig</systemProperty>
</systemProperties>
<extraArguments>
<extraArgument>-XX:+UnlockExperimentalVMOptions</extraArgument>
<extraArgument>-XX:+UseConcMarkSweepGC</extraArgument>
<extraArgument>-XX:MaxGCPauseMillis=50</extraArgument>
<extraArgument>-XX:G1HeapRegionSize=32M</extraArgument>
<extraArgument>-XX:G1NewSizePercent=20</extraArgument>
<extraArgument>-XX:G1ReservePercent=20</extraArgument>
<extraArgument>-XX:SoftRefLRUPolicyMSPerMB=1</extraArgument>
</extraArguments>
</jvmSettings>
</program>
<program>
<mainClass>org.hps.online.recon.Client</mainClass>
<id>online-recon-client</id>
<jvmSettings>
<maxMemorySize>500m</maxMemorySize>
<maxMemorySize>200m</maxMemorySize>
<systemProperties>
<systemProperty>java.util.logging.config.class=org.hps.online.recon.logging.ClientLoggingConfig</systemProperty>
</systemProperties>
</jvmSettings>
</program>
<program>
<mainClass>org.hps.record.evio.EvioFileProducer</mainClass>
<id>hps-recon-producer</id>
<id>evio-producer</id>
<jvmSettings>
<maxMemorySize>2g</maxMemorySize>
<maxMemorySize>1g</maxMemorySize>
<systemProperties>
<systemProperty>java.util.logging.config.class=org.hps.online.recon.logging.LoggingConfig</systemProperty>
</systemProperties>
</jvmSettings>
</program>
</programs>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
176 changes: 115 additions & 61 deletions online-recon/src/main/java/org/hps/online/recon/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ public final class Client {
*/
private PrintWriter pw = null;

/**
* Command line arguments for the client
*/
String[] clientArgs = null;

/**
* Arguments for the command to run on the server
*/
String[] cmdArgs = null;

/**
* The client command (which may be null when opening a console or executing a file)
*/
Command command = null;

/**
* The base options (commands have their own Options objects).
*/
Expand All @@ -84,9 +99,9 @@ public final class Client {
OPTIONS.addOption(new Option("h", "help", false, "print help"));
OPTIONS.addOption(new Option("p", "port", true, "server port"));
OPTIONS.addOption(new Option("H", "host", true, "server hostname"));
OPTIONS.addOption(new Option("o", "output", true, "output file (default writes server responses to System.out)"));
OPTIONS.addOption(new Option("o", "output", true, "output file (default writes server responses to the console)"));
OPTIONS.addOption(new Option("a", "append", false, "append if writing to output file (default will overwrite)"));
OPTIONS.addOption(new Option("i", "interactive", false, "start interactive console after executing command file"));
OPTIONS.addOption(new Option("i", "interactive", false, "start interactive console after executing a command file"));
}

/**
Expand All @@ -101,88 +116,129 @@ private Client() {
private void printUsage() {
final HelpFormatter help = new HelpFormatter();
final String commands = String.join(" ", cf.getCommandNamesSorted());
help.printHelp(80, "Client [options] [[file] | [command] [command_options]]", "Send commands to the online reconstruction server",
help.printHelp(80, "Client [options] [[file] | [command] [command_options]]",
"Send commands to the online reconstruction server",
OPTIONS, "Commands: " + commands + '\n'
+ "Use 'Client [command] --help' for information about a specific command." + '\n'
+ "Run with no client arguments to start the interactive console." + '\n'
+ "Provide a file with commands as a single argument to execute it.");
}

private void execFile(File file) {
// If there is a single argument, see if it looks like a command file to execute.
Console cn = new Console(this);
try {
cn.setEcho(true);
cn.execFile(file);
if (this.interactive) {
cn.setEcho(false);
cn.run();
}
} catch (Exception e) {
throw new RuntimeException("Error executing command file: " + file.getPath(), e);
}
}

/**
* Setup state from the raw command line arguments
*
* @param args The raw command line arguments
*/
private void setup(String args[]) {
int cmdIdx = findCommand(args);
clientArgs = args;
if (cmdIdx > 0) {
String commandName = args[cmdIdx];
command = cf.create(commandName);
clientArgs = new String[0];
if (cmdIdx > 0) {
clientArgs = new String[cmdIdx];
System.arraycopy(args, 0, clientArgs, 0, cmdIdx);
} else {
clientArgs = new String[0];
}

cmdArgs = new String[0];
if (args.length - cmdIdx - 1 > 0) {
cmdArgs = new String[args.length - cmdIdx];
System.arraycopy(args, cmdIdx + 1, cmdArgs, 0, args.length - cmdIdx);
}
}

/*
if (clientArgs.length > 0) {
List<String> clientArgList = Arrays.asList(clientArgs);
LOG.info("Client arg list: " + String.join(" ", clientArgList));
}

if (cmdArgs != null) {
List<String> cmdArgList = Arrays.asList(cmdArgs);
LOG.info("Command arg list: " + String.join(" ", cmdArgList));
}
*/
}

/**
* Run the client using command line arguments
* Run the client using command line arguments.
*
* @param args The command line arguments
*/
void run(String args[]) {

List<String> argList = parseOptions(args);
// Find the client command to run if provided and set various other state
setup(args);

// If extra arguments are provided then try to run a command.
if (argList.size() != 0) {
// Parse the client options
List<String> extraArgs = parseOptions(clientArgs);

// See if a command was provided.
String commandName = argList.get(0);
if (command != null) {
// Run a client command if one was provided

if (cf.commandExists(commandName)) {
LOG.info("Executing client command " + command.getName());

Command command = cf.create(commandName);

// Remove command from arg list.
argList.remove(0);
try {
command.parse(cmdArgs);
} catch (ParseException e) {
throw new RuntimeException(e);
}

// Convert command list to array.
String[] argArr = argList.toArray(new String[0]);
// Setup the command parameters from the parsed options.
command.process();

// Parse command options.
DefaultParser commandParser = new DefaultParser();
CommandLine cmdResult = null;
try {
cmdResult = commandParser.parse(command.getOptions(), argArr);
// Send the command to server.
LOG.info("Sending command " + command.toString());
send(command);

// Print usage of the command and exit.
if (cmdResult.hasOption("help")) {
command.printUsage();
System.exit(0);
}
} catch (ParseException e) {
command.printUsage();
throw new RuntimeException("Error parsing command options", e);
}
} else if (extraArgs.size() > 0) {
// Execute a file with client commands using the Console

// Setup the command parameters from the parsed options.
command.process(cmdResult);
LOG.info("Extra args: " + String.join(" ", extraArgs));

// Send the command to server.
LOG.info("Sending command " + command.toString());
send(command);
} else {
// If there is a single argument, see if it looks like a command file to execute.
File execFile = new File(argList.get(0));
if (argList.size() == 1 && execFile.exists()) {
Console cn = new Console(this);
try {
cn.setEcho(true);
cn.execFile(execFile);
if (this.interactive) {
cn.setEcho(false);
cn.run();
}
} catch (Exception e) {
throw new RuntimeException("Error executing command file: " + execFile.getPath(), e);
}
} else {
// Could not parse command line options.
printUsage();
throw new IllegalArgumentException("Unknown command: " + commandName);
}
}
execFile(new File(extraArgs.get(0)));
} else {
// No command was provided so run the interactive console.
Console cn = new Console(this);
cn.run();
}
}

/**
* Find a client command in the raw arguments
* @param args
* @return
*/
private int findCommand(String[] args) {
int idx = -1;
for (int i = 0; i < args.length; i++) {
if (cf.commandExists(args[i])) {
idx = i;
break;
}
}
return idx;
}

private List<String> parseOptions(String[] args) {

// Parse base options.
CommandLine cl;
try {
Expand All @@ -197,9 +253,6 @@ private List<String> parseOptions(String[] args) {
System.exit(0);
}

// Get extra arg list.
List<String> argList = cl.getArgList();

if (cl.hasOption("p")) {
this.port = Integer.parseInt(cl.getOptionValue("p"));
LOG.config("Port: " + this.port);
Expand Down Expand Up @@ -231,7 +284,8 @@ private List<String> parseOptions(String[] args) {
this.interactive = true;
LOG.config("Interactive mode enable: " + this.interactive);
}
return argList;

return cl.getArgList();
}

/**
Expand Down
Loading