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 
July 12, 2020, 04:01:11 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: Problem in Parallelisation  (Read 3504 times)

Abhilash K

  • JPPF Grand Master
  • ****
  • Posts: 64
Problem in Parallelisation
« on: December 13, 2006, 12:44:43 PM »

Hii,

        I have created two clients and run it with two nodes, one server, two clients.  In one client, i have given 3 tasks and in the other 10 tasks.  I have made both the nodes running.  But i can see only one node is executing the tasks, the other is not at all executing any, but its connected to driver.  How can i make sure that both are doing the tasks parallely.  I mean, if i need to share the 10 tasks in two nodes, what can i do?  Pls help me.

Regds,
         Abhilash
Logged

Abhilash K

  • JPPF Grand Master
  • ****
  • Posts: 64
Should i need to parallelise the tasks in the run() method?
« Reply #1 on: December 13, 2006, 03:37:36 PM »

Hii,

        for parallelising the process, should i need to create threads in the run() method.  my code is as follows.  I tried to fetch the URL info, its working fine but only in one node.  I need to run those tasks in 2 nodes parallely.  is it because of the problem in my code, which is as follows.

---------------------------------------------------------------------------
public void run(){
           try{
       int c,k=0;
     is=url.openStream();
   char[] ch=new char[is.available()];
   if(is.available()>0){
                            int i=is.available();
          while(((c=is.read())!= -1)&&(--i > 0)){
               ch[k++]=(char)c;
          }
                      }
                     str=new String(ch);
                     System.out.println(str);
            }
           catch(Exception e){
           setException(e);
           }
}
--------------------------------------------------------------------------

         Please help.
Regds,
          Abhilash
Logged

Abhilash K

  • JPPF Grand Master
  • ****
  • Posts: 64
Thanx
« Reply #2 on: December 14, 2006, 05:47:45 AM »

Hii Laurent,

Thanks for the previous answer.  For parallelising the process, should i need to create threads in the run() method. my code is as follows. I tried to fetch the URL info, its working fine but only in one node. I need to run those tasks in 2 nodes parallely. is it because of the problem in my code, which is as follows.

---------------------------------------------------------------------------
public void run(){
try{
int c,k=0;
is=url.openStream();
char[] ch=new char[is.available()];
if(is.available()>0){
int i=is.available();
while(((c=is.read())!= -1)&&(--i > 0)){
ch[k++]=(char)c;
}
}
str=new String(ch);
System.out.println(str);
}
catch(Exception e){
setException(e);
}
}
--------------------------------------------------------------------------

Please help.
Regds,
Abhilash
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