Package org.jamesii.core.distributed.partition

Examples of org.jamesii.core.distributed.partition.Partition


      SimSystem.report(Level.WARNING, "Failure by setting the host name.");
    } else {
      if (simulation == null) {
        SimSystem.report(Level.WARNING, "No simulation given.");
      } else {
        Partition partition = null;
        try {
          partition = server.getPartition(simulation);
        } catch (RemoteException e1) {
          SimSystem.report(e1);
        }
        if (partition != null) {
          try {
            if (partition.getHost().getName().equalsIgnoreCase(hostname)) {

              partitionToHostname = partition;
              partitionFound = true;

              if (setModelAndStateAndChildren(partitionToHostname)) {
                result = true;
              }

              // partition is not the correct one
            } else {
              if (!partition.hasSubPartitions()) {
                SimSystem
                    .report(Level.WARNING,
                        "Correct partition not found (no partitions available at all).");
              } else {
                // go through all subpartitions /subsubpartitions... and find
View Full Code Here


    if (part == null) {
      SimSystem.report(Level.WARNING, "No partition given.");
    } else {
      if (part.hasSubPartitions()) {
        for (int i = 0; i < part.getSubPartitionCount(); i++) {
          Partition childpart = part.getSubPartition(i);

          String childmodelname = childpart.getModel().getName();
          String childhostname = childpart.getHost().getName();

          ResilienceFurtherSimulationInformation child =
              new ResilienceFurtherSimulationInformation(childmodelname,
                  modelname, childhostname, hostname);
View Full Code Here

   */
  public Partition partitionize(IModel model,
      List<ISimulationServer> resources, ParameterBlock parameters) {

    if (resources == null) {
      return new Partition(model, null, null);
    }

    if (resources.isEmpty()) {
      throw new RuntimeException(
          "No ressources available! Cannot create a distributed run.");
    }

    Partition singlePartition = new Partition(model, resources.get(0), null);

    if (resources.size() == 1) {
      return singlePartition;
    }

View Full Code Here

   *          the parameters handed over to the simulator
   *
   * @return the model, extracted from the partition
   */
  public static IModel getModelRuntime(ParameterBlock parameters) {
    Partition partition =
        parameters.getSubBlockValue(AbstractProcessorFactory.PARTITION);
    return partition.getModel();
  }
View Full Code Here

    domFactory.setParameters(new ArrayList<IParameter>());

    asr.addNewFactoryManually(new BestSimulatorInTheWorldFactory(), domFactory);

    ParameterBlock parameters = new ParameterBlock();
    parameters.addSubBl(AbstractProcessorFactory.PARTITION, new Partition(
        new Model() {
          private static final long serialVersionUID = -2162741150899329228L;
        }, null, null));
    return parameters;
  }
View Full Code Here

    @Override
    public List<ProcessorFactory> filter(List<ProcessorFactory> factories,
        ParameterBlock parameter) {

      Partition partition = parameter.getSubBlockValue(PARTITION);

      // System.out.println("the part " + partition);
      // System.out.println("the model " + partition.getModel());

      // If model could not be instantiated, it cannot be simulated
      IModel model = partition.getModel();
      if (model == null) {
        SimSystem
            .report(Level.SEVERE,
                "The model is null! Selecting of a processor factory is not possible.");
        factories.clear();
View Full Code Here

    @Override
    public List<ProcessorFactory> filter(List<ProcessorFactory> factories,
        ParameterBlock parameter) {

      Partition partition = parameter.getSubBlockValue(PARTITION);

      // System.out.println("the part " + partition);
      // System.out.println("the model " + partition.getModel());

      // If model could not be instantiated, it cannot be simulated
      if (partition.getModel() == null) {
        SimSystem.report(Level.SEVERE, "ModelNull", "The model is null!");
        factories.clear();
        return factories;
      }

      // get the interfaces supported by this modeling formalism
      List<Class<?>> modelInterfaces =
          getMostSpecializedInterfaces(partition.getModel().getClass(),
              new ArrayList<Class<?>>());

      // iterate over all available factories
      Iterator<ProcessorFactory> iPF = factories.iterator();
View Full Code Here

    public List<ProcessorFactory> filter(List<ProcessorFactory> factories,
        ParameterBlock parameter) {
      // iterate over all available factories
      Iterator<ProcessorFactory> iPF = factories.iterator();

      Partition partition = parameter.getSubBlockValue(PARTITION);

      while (iPF.hasNext()) {
        ProcessorFactory pf = iPF.next();

        if ((partition.hasSubPartitions()) && (!pf.supportsSubPartitions())) {
          iPF.remove();
        }
      }
      return factories;
    }
View Full Code Here

  }

  @Override
  public Partition getPartition(ComputationTaskIDObject uid) {
    ISimulationRun simulation = getSimulationByUID(uid);
    Partition partition = null;

    if (simulation != null) {
      partition = simulation.getPartition();
    } else {
      // addEvent("Simulation " + uid + " not found on Server.");
View Full Code Here

TOP

Related Classes of org.jamesii.core.distributed.partition.Partition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.