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 
April 14, 2021, 10:34:42 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: [HELP-JPPF EXECUTION ORDER]  (Read 23 times)

hoho23

  • JPPF Padawan
  • *
  • Posts: 11
[HELP-JPPF EXECUTION ORDER]
« on: March 24, 2021, 04:31:15 PM »

I am working on a project that uses JPPF for optimized Computation. Some times I need to run a code snippet on nodes before receiving a job from the server. The code to run depends on the job type submitted by the client. How can I run the code automatically on nodes before receiving jobs from the server or client taking into consideration the job type?

I need your help and I will be grateful for your help!

Thanks,
hoho23.
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2268
    • JPPF Web site
Re: [HELP-JPPF EXECUTION ORDER]
« Reply #1 on: March 25, 2021, 07:46:49 AM »

Hello hoho23,

Please correct me if I'm mistaken, but it looks like you need to specify dependencies between your jobs. This seems ot be a perfect fit for the job dependencies feature of JPPF. Could you try this out and let us know if this works for you? There is also a dedicated sample that may help you get started.

I hope this helps,
-Laurent
Logged

hoho23

  • JPPF Padawan
  • *
  • Posts: 11
Re: [HELP-JPPF EXECUTION ORDER]
« Reply #2 on: March 26, 2021, 10:27:28 AM »

Thank you for your help!
I think the best method is to use NodeLifeCycleListenerAdapter and override the method jobHeaderLoaded() in which I will retrieve a runnable object passed into metadata, then all I need to do is to run that runnable object.
THE PROBLEM HERE IS  that I could not pass a runnable object as metadata parameter, with the method :
Code: [Select]
metadata.setParameter("code1", runnable);I didn't get any error message neither from the client console nor from the node console. I tried to pass other objects into the metadata parameter and it worked, but for the runnable object I didn't get anything and the program blocked. After that, the connection to the class server and task server is lost.
Here is the only thing I get from the client console:
Code: [Select]
2021-03-26 11:43:51,425 - [ForkJoinPool.commonPool-worker-3] - INFO  - org.my.package.Main - Do JPPF distributed task
[client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at address:port
[client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
[client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at address:port
[client: jppf_discovery-1-1 - TasksServer] Reconnected to the JPPF task server
[client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at address:port
[client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
[client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at address:port
[client: jppf_discovery-1-1 - TasksServer] Reconnected to the JPPF task server

Help!
hoho23
« Last Edit: March 26, 2021, 11:48:35 AM by hoho23 »
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