Skip to content

Commit

Permalink
remove special client data logic for Langevin, upgrade to langevin 1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Feb 12, 2024
1 parent 0ba67af commit 366027c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 112 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,5 @@ vcell-core/src/test/resources/simdata/n5/N5ExportData/
!vcell-core/src/test/resources/simdata/n5/ezequiel23/SimID_1136922340_0_00.zip

docker/swarm/zeke_env.txt

localsolvers/mac64/GNUSparseFile.0/
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@
<solvers-vcell-mac.version>v0.0.44-dev4</solvers-vcell-mac.version>
<solvers-vcell-windows.version>v0.0.40</solvers-vcell-windows.version>
<solvers-vcell-linux.version>v0.0.44-dev4</solvers-vcell-linux.version>
<solvers-langevin-mac.version>1.2.4</solvers-langevin-mac.version>
<solvers-langevin-windows.version>1.2.4</solvers-langevin-windows.version>
<solvers-langevin-linux.version>1.2.4</solvers-langevin-linux.version>
<solvers-langevin-mac.version>1.2.5</solvers-langevin-mac.version>
<solvers-langevin-windows.version>1.2.5</solvers-langevin-windows.version>
<solvers-langevin-linux.version>1.2.5</solvers-langevin-linux.version>
</properties>


Expand Down
126 changes: 17 additions & 109 deletions vcell-client/src/main/java/cbit/vcell/client/ClientSimManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,6 @@

package cbit.vcell.client;

import java.awt.Dimension;
import java.awt.Window;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.EventObject;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Scanner;
import java.util.Vector;

import org.vcell.util.gui.GeneralGuiUtils;
import org.vcell.solver.langevin.LangevinSolver;
import org.vcell.solver.smoldyn.SmoldynFileWriter;
import org.vcell.solver.smoldyn.SmoldynSolver;
import org.vcell.util.*;
import org.vcell.util.document.DocumentValidUtil;
import org.vcell.util.document.LocalVCDataIdentifier;
import org.vcell.util.document.User;
import org.vcell.util.gui.DialogUtils;

import cbit.vcell.client.ChildWindowManager.ChildWindow;
import cbit.vcell.client.data.DataViewer;
import cbit.vcell.client.data.DataViewerController;
Expand All @@ -66,33 +35,25 @@
import cbit.vcell.resource.ResourceUtil;
import cbit.vcell.server.DataSetController;
import cbit.vcell.server.SimulationStatus;
import cbit.vcell.simdata.DataManager;
import cbit.vcell.simdata.DataSetControllerImpl;
import cbit.vcell.simdata.ODEDataManager;
import cbit.vcell.simdata.OutputContext;
import cbit.vcell.simdata.PDEDataManager;
import cbit.vcell.simdata.SimDataConstants;
import cbit.vcell.simdata.VCDataManager;
import cbit.vcell.solver.AnnotatedFunction;
import cbit.vcell.solver.DataProcessingInstructions;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.SimulationInfo;
import cbit.vcell.solver.SimulationJob;
import cbit.vcell.solver.SimulationOwner;
import cbit.vcell.solver.SolverDescription;
import cbit.vcell.solver.SolverException;
import cbit.vcell.solver.SolverUtilities;
import cbit.vcell.solver.TempSimulation;
import cbit.vcell.solver.VCSimulationDataIdentifier;
import cbit.vcell.solver.VCSimulationIdentifier;
import cbit.vcell.simdata.*;
import cbit.vcell.solver.*;
import cbit.vcell.solver.ode.ODESimData;
import cbit.vcell.solver.server.SimulationMessage;
import cbit.vcell.solver.server.Solver;
import cbit.vcell.solver.server.SolverEvent;
import cbit.vcell.solver.server.SolverFactory;
import cbit.vcell.solver.server.SolverListener;
import cbit.vcell.solver.server.SolverStatus;
import cbit.vcell.solver.server.*;
import cbit.vcell.util.ColumnDescription;
import org.vcell.solver.smoldyn.SmoldynFileWriter;
import org.vcell.solver.smoldyn.SmoldynSolver;
import org.vcell.util.*;
import org.vcell.util.document.DocumentValidUtil;
import org.vcell.util.document.LocalVCDataIdentifier;
import org.vcell.util.document.User;
import org.vcell.util.gui.DialogUtils;
import org.vcell.util.gui.GeneralGuiUtils;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.*;
import java.util.*;

/**
* Insert the type's description here.
Expand Down Expand Up @@ -758,9 +719,6 @@ public void solverAborted(SolverEvent event) {
solver.startSolver();

int sleepInterval = 500;
if(solver instanceof LangevinSolver) {
sleepInterval = 2000;
}
while (true) {
try {
Thread.sleep(sleepInterval);
Expand Down Expand Up @@ -792,56 +750,6 @@ public void solverAborted(SolverEvent event) {
break;
}
if(solverStatus.getStatus() == SolverStatus.SOLVER_RUNNING) {
if(solver instanceof LangevinSolver) {
//
// TODO: it may (theoretically) be possible that a logfile exists from a previous run
// in which case there may be a brief interval where we display a Progress: 100% spurious result
// We should delete the log file for our run id early, right after initializing the solver
// in the call to createQuickRunSolver() above (or right after the call?)
//
getClientTaskStatusSupport().setMessage("Running... Progress: ");
LangevinSolver ls = (LangevinSolver)solver;
String logFileName = ls.getLogFileString();
if(logFileName == null) {
getClientTaskStatusSupport().setProgress(0);
continue;
}
File logFile = new File(logFileName);
if(!logFile.exists()) {
getClientTaskStatusSupport().setProgress(0);
continue;
}
BufferedReader br = null;
FileReader fr = null;
String lastLine = null;
Scanner lineScanner;
int percentComplete = 0;
try {
fr = new FileReader(logFile);
br = new BufferedReader(fr);
Scanner sc = new Scanner(br);
// Get to the last line
while(sc.hasNextLine()){
lastLine = sc.nextLine();
}
sc.close();
if(lastLine != null) {
if(!lastLine.startsWith("Simulation")) {
continue;
}
lineScanner = new Scanner(lastLine);
// Skip "Simulation"
lineScanner.next();
String percent = lineScanner.next();
percent = percent.substring(0,percent.length()-1);
percentComplete = Integer.parseInt(percent);
getClientTaskStatusSupport().setProgress(percentComplete);
lineScanner.close();
}
} catch(FileNotFoundException fne) {
fne.printStackTrace(System.out);
}
}
}
}
}
Expand Down

0 comments on commit 366027c

Please sign in to comment.