Examples of GridNode


Examples of org.nebulaframework.grid.cluster.node.GridNode

public class SciMark2App {
 
  public static void main(String[] args) throws Exception {
   
    GridNode node = Grid.startLightGridNode();
   
    final int TASKS = 10;
   
    GridJobFuture future;
    BenchmarkResult result;
   
    double mflops_sum = 0;
   
    // FFT
    future = node.getJobSubmissionService().submitJob(new SciMark2FFTBenchmark(TASKS));
    result = (BenchmarkResult) future.getResult();
    System.err.println("FFT : " + result);
    mflops_sum += result.getMflops();
   
    // SOR
    future = node.getJobSubmissionService().submitJob(new SciMark2SORBenchmark(TASKS));
    result = (BenchmarkResult) future.getResult();
    System.err.println("SOR : " + result);
    mflops_sum += result.getMflops();
   
    // Monte Carlo
    future = node.getJobSubmissionService().submitJob(new SciMark2MCBenchmark(TASKS));
    result = (BenchmarkResult) future.getResult();
    System.err.println("Monte Carlo : " + result);
    mflops_sum += result.getMflops();
   
    // Sparse
    future = node.getJobSubmissionService().submitJob(new SciMark2SparseBenchmark(TASKS));
    result = (BenchmarkResult) future.getResult();
    System.err.println("Sparse : " + result);
    mflops_sum += result.getMflops();
   
    // LU
    future = node.getJobSubmissionService().submitJob(new SciMark2LUBenchmark(TASKS));
    result = (BenchmarkResult) future.getResult();
    System.err.println("LU : " + result);
    mflops_sum += result.getMflops();
   
   
    System.err.println("Composite Result : " + mflops_sum / 5);
   
    node.shutdown();
    System.exit(0);
  }
View Full Code Here

Examples of org.nebulaframework.grid.cluster.node.GridNode

    AnnotatedSATestJob annoatedJob = new AnnotatedSATestJob();
   
    try {

     
      GridNode node =  Grid.startLightGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
     
      // Submit Job
      log.debug("Submitting Job");
     
      GridJobFuture future = node.getJobSubmissionService().submitJob(annoatedJob);
      try {
        log.info("Job Result : " + future.getResult());
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      node.getNodeRegistrationService().unregister();
     
      log.info("Unregistered, Terminating...");
     
   
    } catch (Exception e) {
View Full Code Here

Examples of org.nebulaframework.grid.cluster.node.GridNode

   
    log.debug("[Service] " + message);

    this.message = message;

    GridNode node = GridNode.getInstance();
   

    // Notify Relevant Parties
    if (message.isJobMessage()) {
      // If Job Message Notify Job Service
      if (node.getJobExecutionService()!=null) {
        node.getJobExecutionService().onServiceMessage(message);
      }
      else {
        log.debug("[ServiceMessage]Job Message ignored as no JobExecutionService is registered");
      }
    }
    else if (message.getType()==ServiceMessageType.NODE_BANNED) {
     
      // If Message is a Banned Message for this Node
     
      if (node.getId().toString().equals(message.getMessage().split("#")[0])) {
       
        try {
          // Create a Cancel Message and Send
          ServiceMessage msg = new ServiceMessage(message.getMessage().split("#")[1], ServiceMessageType.JOB_CANCEL);
          node.getJobExecutionService().onServiceMessage(msg);
         
        } catch (Exception e) {
          log.warn("[ServiceMessage] Exception while processing message", e);
        }
       
      }
      else {
        log.debug("Disregarding Node Banned for : " + message.getMessage() + ", Local : " + node.getId());
      }
    }
   
    // Notify Service Event
    ServiceEventsSupport.getInstance().onServiceMessage(message);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.