Find the answer to your Linux question:
Results 1 to 3 of 3
Hello everyone, I was wondering if there is a way to share ownership with a job that was submitted to a cluster using the qsub command? I would like to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2013
    Posts
    2

    Working with Qsub in Java


    Hello everyone,

    I was wondering if there is a way to share ownership with a job that was submitted to a cluster using the qsub command? I would like to do this so I can ask my program to wait till the process is done since I can ask my program to wait till a process that I own is completed. The language that the program is in is Java. I'm planning on submitting the job though the qsub command though Java too. I also have the input and output streams open too. I didn't open the error stream though.

    This is the method I am using. to submit the qsub command.

    Runtime run = Runtime.getRuntime();
    Process pros = run.exec(String);

    Currently the only way I know on how to check to see if the process is done is by asking it to echo "done" when completed and ask my code to read that output looking for the word done, and then sleep for 10 min if not there, then check again.

    The main reason I would like to wait till this process is done, is because I would like to take the output from the process and make a few changes to it and resubmit it. If I use the method I talk about above, then I could end up waiting longer then I need to. Also the job that will be submitted can take awhile to run, depending on the number of cores I can use at the time I run the job.

    Oh I'm am also open for suggestions on another method. These were the two I could come up with. I also don't have root access to the cluster, I'm only a user.

    If you want to see the entire code, then I can post it.

    Thanks for the help and your time in advance. ^_^

  2. #2
    Just Joined!
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    36
    In my memory , if the output must be returned, executing a command that way e.g. "ls -as /" will sit there on the console fpr 10 20 30 minutes until the output occurs. What you first want to discern is whether the Qsub script command will return on the same in/out command cycle with the information.
    As threading in java is,
    Here is some information to look at that i am studying on data corruption by threading and the Object.wait() and notify() notifyAll()
    but also synchronized blocks and objects to "wakeup".

    Below is on the right track apart Qsub commandline and switches:

    How Synchronization works in Java ? Example of synchronized block

    How Synchronization works in Java ? Example of synchronized block

    qsub man page - Sun Grid Engine

    qsub

    java - IllegalMonitorStateException on wait() call - Stack Overflow

    multithreading - How to use wait and notify in Java? - Stack Overflow

  3. #3
    Just Joined!
    Join Date
    Jun 2013
    Posts
    2
    Thank you for the interesting articles.

  4. $spacer_open
    $spacer_close

Posting Permissions

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