Examples of GridNode


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

    JLabel clusterId = getUIElement("general.stats.clusterid");
    JLabel clusterService = getUIElement("general.stats.clusterservice");
   
    if (Grid.isNode()) {
      // If connected
      GridNode instance = GridNode.getInstance();
     
      nodeId.setText(instance.getId().toString());
      nodeIp.setText(NetUtils.getLocalHostAddress());
      clusterId.setText(instance.getClusterId().toString());
      clusterService.setText(instance.getClusterUrl());
     
      getUIElement("menu.node.discover").setEnabled(false);
     
      registerHooks(instance);
      setStatus("Idle");
View Full Code Here

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

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node = Grid.startGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
      log.debug("Reading NAR");
     
      sw.start();
     
      GridArchive archive;
      archive = GridArchive.fromFile(new File("simpletestjob.nar"));
     
      log.debug("Submitting NAR");
     
      GridJobFuture future = (GridJobFuture) node.getJobSubmissionService().submitArchive(archive).values().toArray()[0];
     
      try {
        log.info("RESULT : " + future.getResult());
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
      log.info("Unregistered, Terminating...");
      System.exit(0);
     
     
View Full Code Here

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

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node = Grid.startGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
      log.debug("Submitting Job");
     
      sw.start();
     
      GridJobFuture future = node.getJobSubmissionService().submitJob(testJob,new ResultCallback() {

        public void onResult(Serializable result) {
          System.err.println(result);
        }
       
      });

      while(!future.isJobFinished()) {
        Thread.sleep(1000);
      }
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
      log.info("Unregistered, Terminating...");
      System.exit(0);
     
   
View Full Code Here

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

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node =  Grid.startGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
      log.debug("Submitting Job");
     
      sw.start();
     
      GridJobFuture future = node.getJobSubmissionService().submitJob(testJob,new ResultCallback() {

        public void onResult(Serializable result) {
          System.err.println(result);
        }
       
      });
      try {
        log.info("Job Result : " + future.getResult());
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
      log.info("Unregistered, Terminating...");
      System.exit(0);
     
   
View Full Code Here

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

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();

      GridNode node = Grid.startLightGridNode();

      log.info("GridNode ID : " + node.getId());

      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis()
          + " ms]");

      // Create App Instance
      final MandelbrotApp app = new MandelbrotApp(node);

      app.requestFocus();
     
      // Create Mandelbrot Job
      MandelbrotJob mandelbrotJob = new MandelbrotJob(app.getWidth(), app
          .getHeight());
     
      // Start Job Submission
      sw.start();
     
      GridJobFuture future = node.getJobSubmissionService()
          .submitJob(mandelbrotJob, new ResultCallback() {

            public void onResult(Serializable result) {
             
              MandelbrotResult mResult = (MandelbrotResult) result;
              app.displayResult(mResult);
              app.setProgress(app.getProgress()
                  + mResult.getLines());
            }

          });
     
      app.setFuture(future);
      // Block till job finishes
      future.getResult();
      app.setDone(true);
     
      sw.stop();
     
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis()
          + " ms");

      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();

     
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

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

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      // Start Grid Node
      GridNode node = Grid.startGridNode();
     
      sw.stop();
      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      log.info("GridNode ID : " + node.getId());
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
      log.info("Unregistered, Terminating...");
      System.exit(0);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

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

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();

   
      GridNode node = Grid.startLightGridNode();

      log.info("GridNode ID : " + node.getId());

      log.info("Registered in Cluster : "
          + node.getNodeRegistrationService().getRegistration()
              .getClusterId());

      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis()
          + " ms]");

      // Create App Instance
      final BuddhabrotApp app = new BuddhabrotApp(node);

      app.requestFocus();
     
      // Create Buddhabrot Job
      BuddhabrotJob buddhabrotJob = new BuddhabrotJob(WIDTH, HEIGHT);
     
      // Start Job Submission
      sw.start();
     
      System.err.println(new Date());
     
      GridJobFuture future = node.getJobSubmissionService()
          .submitJob(buddhabrotJob, new ResultCallback() {

            public void onResult(Serializable result) {
             
              log.debug("CALLBACK");
View Full Code Here

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

      log.info("LinPack Benchmark GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();

      GridNode node = Grid.startLightGridNode();

      log.info("GridNode ID : " + node.getId());

      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis()
          + " ms]");

      sw.start();

      GridJobFuture future = null;

      log.debug("Submitting LinPack Benchmark Job");

      // Submit Job
      future = node.getJobSubmissionService()
          .submitJob(new LinPackBenchmark(200,5));

      double result = 0;
      try {
        result = (Double) future.getResult();
        System.err.println("*********************************************");
        System.err.println("LinPack Benchmark Grid MLFOPS : " + result);
        System.err.println("*********************************************");
       
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }

      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis()
          + " ms");

      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();

      log.info("Unregistered, Terminating...");
      System.exit(0);

    } catch (IOException e) {
View Full Code Here

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

      log.info("SciMark Multi-Job Benchmark GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node =  Grid.startLightGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
     
      sw.start();
     
      GridJobFuture future = null;
     
      /* ------------------------------- FFT Benchmark -------------------------------- */
      log.debug("Submitting FFT Job");
      future = node.getJobSubmissionService().submitJob(new BenchmarkFFT(TASKCOUNT));
     
      try {
        mflop_fft = (Double) future.getResult();
        log.debug("FFT Results : " + mflop_fft);
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      /* ------------------------------- SOR Benchmark -------------------------------- */
      log.debug("Submitting SOR Job");
      future = node.getJobSubmissionService().submitJob(new BenchmarkSOR(TASKCOUNT));
     
      try {
        mflop_sor = (Double) future.getResult();
        log.debug("SOR Results : " + mflop_sor);
       
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      /* ------------------------------- Monte Carlo Benchmark -------------------------------- */
      log.debug("Submitting Monte Carlo Job");
      future = node.getJobSubmissionService().submitJob(new BenchmarkMonteCarlo(TASKCOUNT));
     
      try {
        mflop_monte = (Double) future.getResult();
        log.debug("MonteCarlo Results : " + mflop_monte);
       
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      /* ------------------------------- LU Benchmark -------------------------------- */
      log.debug("Submitting LU Job");
      future = node.getJobSubmissionService().submitJob(new BenchmarkLU(TASKCOUNT));
     
      try {
        mflop_lu = (Double) future.getResult();
        log.debug("LU Results : " + mflop_lu);
       
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      /* ------------------------------- Sparse Benchmark -------------------------------- */
      log.debug("Submitting Sparse Job");
      future = node.getJobSubmissionService().submitJob(new BenchmarkSparse(TASKCOUNT));
     
      try {
        mflop_sparse = (Double) future.getResult();
        log.debug("Sparse Results : " + mflop_sparse);
       
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
     
      /* ------------------------------- FINAL RESULT -------------------------------- */
      double result = (mflop_fft + mflop_lu + mflop_monte + mflop_sor + mflop_sparse) /5;
      log.debug("Benchmark Result : " + result);
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      node.getNodeRegistrationService().unregister();
     
     
      System.err.println("*******************************");
      System.err.println("   SciMark Benchmark Results");
      System.err.println("*******************************");
 
View Full Code Here

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

      lightweight = true;
     
      sw.stop();
      log.info("GridNode Started Up. " + sw.getLastTaskTimeMillis() + " ms");
     
      GridNode node = (GridNode) applicationContext.getBean("localNode");
      ServiceEventsSupport.addServiceHook(new ServiceHookCallback() {

        @Override
        public void onServiceEvent(ServiceMessage message) {
         
          log.warn("[GridNode] Disconnected from Cluster");
          log.warn("[GridNode] Shutting Down");
         
          if (isGui) {
            JOptionPane.showMessageDialog(UISupport.activeWindow(), "Disconnected from Cluster, terminating VM");
          }
          System.exit(0);
        }
       
      }, node.getClusterId().toString(), ServiceMessageType.NODE_DISCONNECTED);
     
      return node;
   
    } finally {
      if (sw.isRunning()) {
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.