Skip to content

Commit

Permalink
Merge pull request #23 from MesquiteProject/development
Browse files Browse the repository at this point in the history
v3.11 pull request development into master
  • Loading branch information
DMaddison authored Jan 4, 2020
2 parents 29c9b83 + afee9c0 commit e537e7c
Show file tree
Hide file tree
Showing 59 changed files with 697 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public Class getDutyClass() {
* then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite.
* If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/
public int getVersionOfFirstRelease(){
return -100;
return -3100;
}

public String getName() {
Expand Down
6 changes: 5 additions & 1 deletion Source/mesquite/zephyr/IQTreeRunnerSSH/IQTreeRunnerSSH.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public Class getExternalProcessRunnerClass(){
return SSHRunner.class;
}

/*.................................................................................................................*/
public void reportNewTreeAvailable(){
log("[New tree acquired]");
}

/*.................................................................................................................*/
public String queryOptionsDialogTitle() {
Expand All @@ -69,7 +73,7 @@ public String queryOptionsDialogTitle() {
* then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite.
* If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/
public int getVersionOfFirstRelease(){
return -2500;
return -3000;
}

public String getName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import mesquite.zephyr.lib.*;

public class LocalScriptRunner extends ScriptRunner implements ActionListener, ItemListener, OutputFileProcessor, ShellScriptWatcher {

ExternalProcessManager externalRunner;
ShellScriptRunner scriptRunner;

Expand All @@ -36,7 +37,6 @@ public class LocalScriptRunner extends ScriptRunner implements ActionListener, I

StringBuffer extraPreferences;
boolean deleteAnalysisDirectory = false;
boolean leaveAnalysisDirectoryIntact = false;

/*.================================================================..*/
public boolean startJob(String arguments, Object condition, boolean hiredByName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public String getExternalProcessRunnerModuleName(){
public Class getExternalProcessRunnerClass(){
return SSHRunner.class;
}
/*.................................................................................................................*/
public void reportNewTreeAvailable(){
log("[New tree acquired]");
}

/*.................................................................................................................*/

Expand Down
8 changes: 7 additions & 1 deletion Source/mesquite/zephyr/RAxMLRunnerSSH/RAxMLRunnerSSH.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public Class getExternalProcessRunnerClass(){
public String getTestedProgramVersions(){
return "8.2.10";
}

/*.................................................................................................................*/
public void reportNewTreeAvailable(){
log("[New tree acquired]");
}


public String getLogText() {
String log= externalProcRunner.getStdOut();
Expand Down Expand Up @@ -95,7 +101,7 @@ public String[] modifyOutputPaths(String[] outputFilePaths){
* then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite.
* If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/
public int getVersionOfFirstRelease(){
return -2500;
return -3000;
}

public String getName() {
Expand Down
32 changes: 25 additions & 7 deletions Source/mesquite/zephyr/SSHRunner/SSHRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ public void setForgetPassword(boolean forgetPassword){
}


public String getMessageIfUserAbortRequested () {
return "Do you wish to stop the analysis conducted via SSH? No intermediate trees will be saved if you do.";
}
public String getMessageIfCloseFileRequested () {
return "If Mesquite closes this file, it will not stop the run on the server. To stop the run on the server, press the \"Stop\" link in the analysis window before closing.";
}

public boolean canCalculateTimeRemaining(int repsCompleted){
if (communicator!=null)
Expand Down Expand Up @@ -184,6 +178,12 @@ public Object doCommand(String commandName, String arguments, CommandChecker che
if (checker.compare(this.getClass(), "Sets the sshServerProfile", "[file path]", commandName, "setServerProfileName")) {
String sshServerProfileName = parser.getFirstToken(arguments);
sshServerProfile = sshServerProfileManager.getSSHServerProfile(sshServerProfileName);
if (sshServerProfile==null) {
logln("***********************************");
logln(" WARNING ");
logln("SSH Server Profile \"" + sshServerProfileName + "\" could not be found");
logln("***********************************");
}
return sshServerProfile;
} else if (checker.compare(this.getClass(), "Revives the communicator", "[file path]", commandName, "reviveCommunicator")) {
logln("Reviving SSH Communicator");
Expand Down Expand Up @@ -500,6 +500,7 @@ private boolean prepareCommunicator(boolean hasBeenReconnected, String userName)
communicator.setHasBeenReconnected(hasBeenReconnected);
if (sshServerProfile!=null) {
communicator.setSSHServerProfile(sshServerProfile);
communicator.setPollInterval(sshServerProfile.getPollingInterval());
if (!sshServerProfile.getName().equals(communicator.getSshServerProfileName())) // we've changed to a different
communicator.forgetPassword();
//else
Expand Down Expand Up @@ -536,8 +537,10 @@ public boolean startExecution(){ //do we assume these are disconnectable?
if (communicator.checkUsernamePassword(false)) {
if (communicator.createRemoteWorkingDirectory()) {
communicator.transferFilesToServer(inputFilePaths, inputFileNames);
communicator.setFilesToNotDownload(inputFileNames);
if (MesquiteFile.fileExists(localScriptFilePath)) {
communicator.transferFileToServer(localScriptFilePath, scriptFileName);
communicator.addToFilesToNotDownload(scriptFileName);
communicator.setRemoteFileToExecutable(scriptFileName);
}
successfulStart = true;
Expand All @@ -549,6 +552,7 @@ public boolean startExecution(){ //do we assume these are disconnectable?
forgetPassword = false;
if (scriptBased) {
communicator.addEmptyFileToWorkingDirectory(ShellScriptUtil.runningFileName);
communicator.addToFilesToNotDownload(ShellScriptUtil.runningFileName);
return communicator.sendCommands(new String[] {getExecuteScriptCommand("./"+scriptFileName, visibleTerminal)},true, true, true); // this works on Linux or Mac
// return communicator.sendCommands(new String[] {getExecuteScriptCommand(getRemoteScriptPath(), visibleTerminal)},true, true, true); // this works on Mac
}
Expand All @@ -568,9 +572,23 @@ public boolean monitorExecution(ProgressIndicator progIndicator){
public String checkStatus(){
return null;
}

public String getMessageIfUserAbortRequested () {
if (scriptBased)
return " Mesquite will stop its monitoring of the analysis, but it will not be able to directly stop the other program on the remote server. To stop the other program, you will need to "
+ "log into the remote server and stop the program on it.";
return "";
}
public String getMessageIfCloseFileRequested () {
if (scriptBased)
return "If Mesquite closes this file, it will not stop the run on the server. To stop the other program on the remote server, you will need to "
+ "log into the remote server and stop the program on it.";
return "";
}

public boolean stopExecution(){
if (communicator!=null) {
communicator.deleteJob(null);
communicator.stopJob(null);
communicator.setAborted(true);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ TreeInferenceHandler findHandlerByID(int id){
return null;
}
/*.................................................................................................................*/
String getExtraLinks(TreeInferenceHandler e) {
return e.getExtraLinks();
}
/*.................................................................................................................*/
String getNameForStopLink(TreeInferenceHandler e) {
return "Stop";
}
/*.................................................................................................................*/
int whichInferenceInLog = 0;
String getStatusHTML(int numLinesPerHandler){
String body="";
Expand All @@ -102,7 +110,8 @@ String getStatusHTML(int numLinesPerHandler){
String logTest = "";
for (int i = 0; i<handlers.size(); i++) {
TreeInferenceHandler e=(TreeInferenceHandler)handlers.elementAt(i);
body += " (<a href = \"kill-" + e.getID() + "\">Stop</a>) " + e.getHTMLDescriptionOfStatus(numLinesPerHandler) + "<p><hr size=\"3\" noshade=\"noshade\" />";
body += " (<a href = \"kill-" + e.getID() + "\">"+getNameForStopLink(e)+"</a>) " + getExtraLinks(e)+ e.getHTMLDescriptionOfStatus(numLinesPerHandler)
+"<p><hr size=\"3\" noshade=\"noshade\" />";
if (i==whichInferenceInLog) {
extraPanelText.append("Log from " + e.getInferenceName() + "\n===================\n");
String lt = e.getLogText();
Expand Down Expand Up @@ -252,23 +261,37 @@ else if (checker.compare(this.getClass(), "link touched", null, commandName, "li
if (handler != null) {
int response = 1;
logln("User request to stop tree inference");
String message = handler.getMessageIfUserAbortRequested();
if (handler.canStoreLatestTree()){
String message = handler.getMessageIfUserAbortRequested();
response = AlertDialog.queryLongMessage(containerOfModule(), "Save tree?", "Save the current tree in the inference?", message, "Save", "Don't Save", "Cancel", 2, "");
if (response==0)
handler.storeLatestTree();
if (response<2) {
handler.setUserAborted();
handler.stopInference();
}
} else if (AlertDialog.query(this, "Abort analysis", "Do you want to abort analysis? Preliminary trees will not be saved.", "OK", "Cancel")) {
} else if (AlertDialog.query(this, "Abort analysis", "Do you want to abort analysis? Preliminary trees will not be saved. "+message, "OK", "Cancel")) {
handler.setUserAborted();
handler.stopInference();
}

return null;
}
} else if (token != null && token.startsWith("extra")){
Parser parser = new Parser();
parser.setWhitespaceString("-");
String idS = token.substring(6, token.length());
parser.setString(idS);
String command = parser.getFirstToken();
String idString = parser.getNextToken();
int id = MesquiteInteger.fromString(idString);
TreeInferenceHandler handler = findHandlerByID(id);
if (handler != null) {
handler.dealWithExtraLink(command);
return null;
}
}

}
else
return super.doCommand(commandName, arguments, checker);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public String getMessageIfCloseFileRequested (){
return inferenceTask.getMessageIfCloseFileRequested();
return null;
}
/*.................................................................................................................*/
public String getExtraLinks() {
//return "(<a href = \"extra-harvest-" + this.getID() + "\">Harvest Results</a>) ";
return "";
}
/*.................................................................................................................*/
public void dealWithExtraLink(String command) {
//logln("User request to harvest trees");
}

/*.................................................................................................................*/
public String getHTMLDescriptionOfStatus(int numLines){
Expand Down
Loading

0 comments on commit e537e7c

Please sign in to comment.