Search in sources :

Example 46 with VolVariable

use of cbit.vcell.math.VolVariable in project vcell by virtualcell.

the class SimulationTask method getEstimatedMemorySizeMB.

public double getEstimatedMemorySizeMB() {
    // 
    // calculate number of PDE variables and total number of spatial variables
    // 
    SimulationSymbolTable simSymbolTable = getSimulationJob().getSimulationSymbolTable();
    Simulation simulation = simSymbolTable.getSimulation();
    MathDescription mathDescription = simulation.getMathDescription();
    int pdeVarCount = 0;
    int odeVarCount = 0;
    Variable[] variables = simSymbolTable.getVariables();
    for (int i = 0; i < variables.length; i++) {
        if (variables[i] instanceof VolVariable) {
            if (mathDescription.isPDE((VolVariable) variables[i])) {
                pdeVarCount++;
            } else {
                odeVarCount++;
            }
        } else if (variables[i] instanceof MemVariable) {
            if (mathDescription.isPDE((MemVariable) variables[i])) {
                pdeVarCount++;
            } else {
                odeVarCount++;
            }
        }
    }
    long numMeshPoints = 1;
    if (simulation.isSpatial()) {
        ISize samplingSize = simulation.getMeshSpecification().getSamplingSize();
        numMeshPoints = samplingSize.getX() * samplingSize.getY() * samplingSize.getZ();
    }
    // 180 bytes per pde variable plus ode per mesh point + 15M overhead
    // there is 70M PBS overhead which will be added when submitted to pbs
    double est = ((180 * pdeVarCount + 16 * odeVarCount) * numMeshPoints / 1e6 + 15);
    if (simulation.getSolverTaskDescription().getSolverDescription().equals(SolverDescription.SundialsPDE)) {
        est *= 2;
    }
    return est;
}
Also used : Variable(cbit.vcell.math.Variable) VolVariable(cbit.vcell.math.VolVariable) MemVariable(cbit.vcell.math.MemVariable) Simulation(cbit.vcell.solver.Simulation) MemVariable(cbit.vcell.math.MemVariable) MathDescription(cbit.vcell.math.MathDescription) VolVariable(cbit.vcell.math.VolVariable) ISize(org.vcell.util.ISize) SimulationSymbolTable(cbit.vcell.solver.SimulationSymbolTable)

Aggregations

VolVariable (cbit.vcell.math.VolVariable)46 Variable (cbit.vcell.math.Variable)29 Expression (cbit.vcell.parser.Expression)25 MemVariable (cbit.vcell.math.MemVariable)24 MembraneRegionVariable (cbit.vcell.math.MembraneRegionVariable)19 VolumeRegionVariable (cbit.vcell.math.VolumeRegionVariable)17 ReservedVariable (cbit.vcell.math.ReservedVariable)16 CompartmentSubDomain (cbit.vcell.math.CompartmentSubDomain)15 Constant (cbit.vcell.math.Constant)14 FilamentVariable (cbit.vcell.math.FilamentVariable)13 MembraneSubDomain (cbit.vcell.math.MembraneSubDomain)13 Vector (java.util.Vector)13 Function (cbit.vcell.math.Function)12 MathDescription (cbit.vcell.math.MathDescription)11 SubDomain (cbit.vcell.math.SubDomain)11 Equation (cbit.vcell.math.Equation)10 FilamentRegionVariable (cbit.vcell.math.FilamentRegionVariable)10 MathException (cbit.vcell.math.MathException)10 OdeEquation (cbit.vcell.math.OdeEquation)10 Domain (cbit.vcell.math.Variable.Domain)10