Results 1 to 11 of 11
  1. #1
    ki_ha1984 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    118
    Rep Power
    0

    Default Java parallelization for OpenMPI cluster running

    Hi,

    I need to parallelize my java application in order to run it in a cluster with many nodes where is OpenMPI.
    My code works like this:

    In the First.jar (the code below) runs a for loop many times which executes another jar file (Second.jar) with different argument in every loop.

    Java Code:
    for (int i = 0; i < gameEnd; i++) {
       Runtime.getRuntime().exec("java -jar Second.jar "+plrA+" "+plrB+" "+path+"); 
    }
    Any idea ?


    Thank you in advanced

    Ki_ha1984

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: Java parallelization for OpenMPI cluster running

    This is not parallelization. This is running a program multiple times with different arguments.

    And besides "Any idea?", you didn't ask a question. Any idea about what exactly?
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Java parallelization for OpenMPI cluster running

    I don't have an idea, I have a concern. About this:

    Open MPI User Documentation

    "Widely used", yet nobody cares to write proper user documentation for it. When I read that kind of nonsense, I run away as fast as I can too.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    ki_ha1984 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    118
    Rep Power
    0

    Default Re: Java parallelization for OpenMPI cluster running

    First of all thank you for your fast answers.

    i mean any idea how to make it parallel running. in order to run in more than one node of the cluster ?

    gimbal2 -> I know the link that you send me, but i didn't found any helpful guide this is why post. I need some example in how to convert my code to the need of the OpenMPI.


    Thank you again

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Java parallelization for OpenMPI cluster running

    Yes and for that you need proper documentation. Which nobody wants to write.

    But you are not even there yet - first you need to study what parallelization actually is. Making an operating system fork different processes running the same program is not it, thus your code example makes absolutely no sense in this context.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    ki_ha1984 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    118
    Rep Power
    0

    Default Re: Java parallelization for OpenMPI cluster running

    if i use new threads of the in the same jarfule (First.jar) in case of the execution of the Second.jar, do i will have something like parallelization ?


    ki_ha1984

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Java parallelization for OpenMPI cluster running

    Did you do a web search on parallel processing (at least that is what I presume you are talking about)?

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  8. #8
    ki_ha1984 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    118
    Rep Power
    0

    Default Re: Java parallelization for OpenMPI cluster running

    Like i told yes i searched in for parallel processing, but didnt found anything about converting the above loop to a parallel running this is the reason that i writing o this forum.
    i need some example ?

    Thank you

    ki_ha1984

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Java parallelization for OpenMPI cluster running

    Here's the Oracle Java Tutorial page on parallelism.

    From the first sentence:
    "
    Parallel computing involves dividing a problem into subproblems, solving those problems simultaneously (in parallel, with each subproblem running in a separate thread), and then combining the results of the solutions to the subproblems.
    "

    As you can see, that is not what you are doing in your original post.
    You are simply launching your other program twice.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  10. #10
    ki_ha1984 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    118
    Rep Power
    0

    Default Re: Java parallelization for OpenMPI cluster running

    Thank you Tolls,

    In my first post with the for loop, i think that i am making the same thing but i don't know if it runs as parallel in Open MPI.
    My project is: i have thousands of agent playing a game as Round Robin Tournament. The for loop is managing those matches, more simple for each match executes the Second.jar with different arguments (players), where Second.jar is the game. This means that in every round this for loop runs many matches in parallel and in the end of the tournament the First.jar combines those players and their data, for a data analysis.

    I believed that my problem is on how i execute every match inside the for loop. is it that true ?

    Now my thought is to add the code of the second.jar to First.jar and inside the for loop to call the code of the second.jar some how.

    This is what exactly i need to do as parallel.


    Thank you


    ki_ha1984

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Java parallelization for OpenMPI cluster running

    I have no idea what OpenMPI is, or what it expects.
    I'm just pointing out that what you have up there is not parallelism as you don't do anything with the results.

    Yes, you could (and probably should) simply create "matches" and fire them off in parallel picking up the result when they're done.
    That should be easy enough to do as you already have the code in your other jar file, so simply include it in your project.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. cluster series
    By ameerulislam in forum New To Java
    Replies: 9
    Last Post: 11-10-2012, 06:09 PM
  2. Replies: 7
    Last Post: 12-18-2011, 04:13 AM
  3. Help me with cluster !!
    By ariuka in forum Advanced Java
    Replies: 2
    Last Post: 09-16-2010, 12:40 PM
  4. Replies: 0
    Last Post: 08-26-2009, 01:03 PM
  5. Cluster using 2 machines
    By Albert in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 06:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •