JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
November 22, 2019, 09:11:24 PM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: set up Jppf on windows xp  (Read 2705 times)

vishalpachori25

  • JPPF Knight
  • **
  • Posts: 18
set up Jppf on windows xp
« on: July 26, 2011, 12:43:17 PM »

hello,
I am new to JPPF and i had gone through the tutorial of jppf but i am not able to run a simple java program. i am running programs by copying them into JPPF Application template folder and adding the task to application runner. please someone tell me how to run a fresh program.     
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2257
    • JPPF Web site
Re: set up Jppf on windows xp
« Reply #1 on: July 27, 2011, 01:19:34 PM »

Hello,

Could you please describe in details what you are trying to do, so we can help you further?
Ideally, could you provide a sample that demonstrates the problem you are facing?

Thanks for your time.

Sincerely,
-Laurent
Logged

vishalpachori25

  • JPPF Knight
  • **
  • Posts: 18
Re: set up Jppf on windows xp
« Reply #2 on: July 28, 2011, 05:45:50 PM »

Thanks for replying,
Actually I am trying to implement an encryption algorithm using JPPF, so i am starting with a simple program lets say adding two numbers which is running on java perfectly now i changed the program to run on jppf as follows:
import org.jppf.server.protocol.JPPFTask;   
public class TemplateJPPFTask extends JPPFTask
{
   public void run()
   {
      
      System.out.println("Hello, this is the node executing a one vishal's template 2 JPPF task");
      int a = 56;
      int b=61;
      int c;
      c=a + b;
      System.out.println("addition of "  + a +  " and "  + b +" is "+ c);
      setResult("the execution of my templet was performed successfully");
         
   }
}

and i had already started JPPF node , Server. Now how i will run this code on jppf? 
please guide me i will really appreciate your help.
 
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2257
    • JPPF Web site
Re: set up Jppf on windows xp
« Reply #3 on: July 30, 2011, 04:10:51 AM »

Hi,

Thanks for the clarification. Now all you need is to create an application that will create a job with one or more instances of your task, and submit this job to the grid using the JPPF client APIs.
You have an example of that in in the JPPF application template: the class org.jppf.application.template.TemplateApplicationRunner.
Basically the code boils down to something like this:

Code: [Select]
public class MyJPPFRunner {
  public static void main(String...ars) {
    JPPFClient jppfClient;
    try {
      // start a JPPF client
      jppfClient = new JPPFClient();
      // create a job
      JPPFJob job = new JPPFJob();
      job.addTask(new TemplateJPPFTask());
      // run the job on the grid
      List<JPPFTask> results = jppfClient.submit(job);
      // ... process the results ...
    } catch(Exception e) {
      e.printStackTrace();
    } finally {
      if (jppfClient != null) jppfClient.close();
    }
  }
}

I hope this helps.

Sincerely,
-Laurent
Logged

vishalpachori25

  • JPPF Knight
  • **
  • Posts: 18
Re: set up Jppf on windows xp
« Reply #4 on: July 30, 2011, 10:59:24 AM »

Thanks for replying,
After creating the application where should i copy my task and the application i mean in which folder i have to copy those files(.java) and then how can i run these files? thanks in advance.
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads