Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Need Urgent Help

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Urgent Help

    Language/Platform

    This project must target a Unix platform and execute properly on our Unix apache server.
    The project must be written in C, C++, or Java.
    If using C or C++, you must use a Unix fork to create child processes and a Unix pipe for communication.
    If using Java, you must use the Runtime exec method to create child processes and use streams for communication.
    Any other method requires instructor approval.


    Problem Overview

    The purpose is to demonstrate a reduction in elapsed time by dividing a problem between two child processes running in parallel versus a single child process. To magnify the difference, a slow O(N^3) algorithm will be used to find the maximum subsequence sum of a list. In this case, a list half as large should take around 1/8 as long to process. So, the approach will be to measure the time using one process working on the entire list, versus two processes each working on half the list and demonstrate the time reduction.

    Because the maximum subsequence sum could span across the two lists, the center-spanning sum must also be found by the parent process, but this is done in O(N) time so it will not noticeably affect the overall results.

    The user will provide a filename containing data to process and how many processes should be used (1 or 2) as command-line inputs. The program will read the data from the file into a list. The list is then divided among the number of child processes. Each child process will use the maximum subsequence sum algorithm to process its portion and write the result to a separate pipe (or stream in Java). The parent will read from the pipes (streams) to get the results. The parent will then compute the center-spanning sum (in the two-child case) and print the maximum subsequence sum to the screen.



    Other Details

    The data file will contain integer data, one integer per line. It will be a Unix file, with only a newline at the end of each line. The data file provided is an example. Your program should support files as large as 500 numbers.

    The filename and number of child processes to create must be command line arguments where the first argument is the filename and the second argument is the number of processes.

    To get the running time, follow the examples posted in eLearning. The elapsed time should exclude the time to read the input file.

    The maximum subsequence sum code can be found at: http://users.cis.fiu.edu/~weiss/dsaa...axSumTest.java

    Hi,

    Can anyone please help me and let me know how i start doing this program.

    Please do help me.

    thanks a lot in advance.

    sonai4u


  2. #2
    Member
    Join Date
    Jan 2010
    Location
    Oxford, UK
    Posts
    30
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default Re: Need Urgent Help

    Nobody is going to do your assignment for you. If you try it yourself, and run into specific
    problems with parts of your code, we can then help you work out what you're doing wrong.

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need Urgent Help

    Hi,

    Thanks a lot for your response.

    I completely agree with you. I just want anyone to help me start the program and give me some inputs on those.

    thats all i'm looking for.

    thanks

    sonai4u

Similar Threads

  1. Urgent Doubts
    By shilpareddy553 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 27th, 2010, 02:26 AM
  2. JSP E-BOOK URGENT PLEASE
    By YUSUFOZTURK in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: December 1st, 2009, 06:58 PM
  3. Urgent Help
    By pb60704 in forum Web Frameworks
    Replies: 7
    Last Post: December 1st, 2009, 03:27 AM
  4. Urgent code needed
    By subhvi in forum AWT / Java Swing
    Replies: 4
    Last Post: August 27th, 2009, 12:55 AM
  5. Replies: 1
    Last Post: May 4th, 2009, 06:30 AM