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 
May 30, 2023, 06:15:25 AM *
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: Does groovy-all-1.8.0.jar need to be added to lib folder of every node?  (Read 3029 times)

Laurence

  • JPPF Padawan
  • *
  • Posts: 2

Hi,

First of all I'm glad I just discovered JPPF and I fully admit I've got some RTFMing to do.  What I've liked so far about JPPF is that without basically reading anything I was able to download all the necessary zips from SourceForge and I was able to very quickly start running local and distributed nodes right out of the box, it was so darn easy ... this is fantastic, thanks to all.  I recently tried another type of Java app that lets you run jars remotely, but the problem I ran into is the auto discovery mechanism would not work very well on a Wi-Fi network (I constantly had to keep restarting the distributed server apps).

I tried the sample application template.  I then added groovy-all-1.8.0.jar to the sample template lib folder and then added a simple line to the template task example to add 1+1 with Groovy and print it out.  I did an ant build and then ran the sample and could not get it to work.

I could only get the task to work if I added groovy-all-1.8.0.jar to all the node lib folders on all machines where I have a node running.  I saw another post where someone had a problem with Jython, but said he did get Groovy to work but I have no idea how he got Groovy to work.

Has anyone else had any success in getting to Groovy to work with JPPF without copying groovy-all-1.8.0.jar files to every running node folder?

Code: [Select]

public void run()
{
// write your task code here.
System.out.println("Hello, this is the node executing a template JPPF task");

try {

System.out.println( groovy.util.Eval.me( "1+1" ) );


} catch( Exception ex ) {
// System.err.println( ex );
System.out.println( ex );
}


// ...

// eventually set the execution results
setResult("the execution was performed successfully");
}


Thanks

Laurence
Logged

Laurence

  • JPPF Padawan
  • *
  • Posts: 2
Re: Does groovy-all-1.8.0.jar need to be added to lib folder of every node?
« Reply #1 on: September 21, 2011, 03:04:20 AM »

I did find one way to limit how many times I have to copy the groovy-all-1.8.0.jar for my simple test of modifying the template app.  Besides adding the groovy-all-1.8.0.jar to the template app lib folder you have to add it to the driver lib folder too.  After I added groovy-all-1.8.0.jar to the driver lib folder I was able to execute my task that required the groovy-all-1.8.0.jar.  The only catch is it takes about 2 - 3 minutes for a new node to run the task for the very first time (I'm not sure if this extra time delay is for every new node or only a one time penalty per new machine when running the first node the first time).

Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2272
    • JPPF Web site
Re: Does groovy-all-1.8.0.jar need to be added to lib folder of every node?
« Reply #2 on: September 22, 2011, 08:38:18 AM »

Hello Laurence,

The code in your task should work with the groovy lib in the client application's classpath only. There should be no need to deploy it on any of the nodes to make it work.
Could you let us know in more details what behavior you observed when it didn't work the first time? Did you see any error message or exception in the node, server or client's log file?

I have tested myself with Groovy 1.8.2., simply adding groovy-all-1.8.2.jar to the client's classpath, and it worked without any problem.

On the other hand, the delay you are observing during the first task execution is probabbly due to the class loading that occurs when using the Groovy APIs the first time: it seems that a large number of classes need to be loaded, and the node will attempt to download them from the server's classpath, then in the client's classpath if not found in the server. The JPPF class loader downloads the classes one at a time, when they are needed for execting the tasks. This implies that, if the number of classes to load is large, and the network connection betweeen node/server or server/client is slow, then it may take some time at the first execution.

I hope this helps,
-Laurent

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