OCEAN: Returning from paramRun() command using distributed hostmode

Discussion in 'Cadence' started by Stephen Greenwood, Dec 3, 2009.

  1. I often run a parametric analysis, then select the results immediately
    afterward, like this:

    ....
    paramRun()
    selectResult( 'tran )
    ....

    In local hostmode, this works fine. The paramRun() function does not
    return until the run is over, and then the script moves on to the
    selectResult() command.

    Recently I tried to modify some of my scripts to utilize distributed
    hostmode. The corresponding commands look something like this:

    ....
    paramRun(?jobName myJobName ?queue "myQueueName" ?lsfResourceStr
    "rusage[mem=1024]")
    selectResult( 'tran )
    ....

    The structure is identical except that paramRun() needs arguments.
    Unfortunately I find that the paramRun() function returns immediately
    after it has submitted the jobs. It does not wait until the jobs are
    completed, and moves directly on to the selectResult() call.
    Naturally, it fails because there's nothing there yet. Does anyone
    know how to force the paramRun() command to wait until the jobs are
    finished, as it does by default in local mode?

    I looked through all the paramRun() options in the manual, and I don't
    see anything related to this. I'm using v5.1.41, if it matters.

    Thank you,
    Stephen Greenwood

    P.S. In the meantime I used an obvious workaround, which was to
    separate my script into two scripts, one that submits the jobs and one
    that does the analysis. I simply wait until the first script is
    finished and then run the second. It worked immediately. But this is
    an annoying workaround, because I have to maintain certain parts of
    the code in two places, which is never good.
     
    Stephen Greenwood, Dec 3, 2009
    #1
  2. Stephen Greenwood

    Riad KACED Guest

    Hi Stephen,

    I'm doubting you have 'looked through all the paramRun() options in
    the manual' ... :)
    The '?block' option is exactly what you need. This is what I read from
    the ocean manual:
    s_block: When s_block is not nil, the OCEAN script halts until the job
    is complete. Default value: nil
    So all what you need is to add '?block t' to your paramRun() argument
    list. This should work as expected !

    Cheers,
    Riad.
     
    Riad KACED, Dec 3, 2009
    #2
  3. Riad KACED wrote, on 12/03/09 08:00:
    And you can also use the wait() function to wait for a job (or jobs) to finish.
    wait() is particularly useful if you've submitted several jobs, and then want to
    wait for all of them to finish, which would allow them to run in parallel; using
    ?block t would mean that each job would be done one after the other.

    Regards,

    Andrew.
     
    Andrew Beckett, Dec 3, 2009
    #3
  4. Riad KACED wrote, on 12/03/09 08:00:
    Oh, I did read the man page for paramRun(), else I'd not have found
    the other arguments. But I must have overlooked the "?block" option
    somehow. Thank you for pointing it out.

    Thank you. The wait() function is the best solution, since it appears
    to be a superset of the ?block option's functionality.

    Best,
    Stephen
     
    Stephen Greenwood, Dec 3, 2009
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.