Hi everyone, I'm using a perl script to oversee some plumbing of a set of related jobs that are being submitted to a PBS cluster. The issue is quite simple, but I am having difficulty figuring one the One True Way to do this... The program is simply splitting up an input file calling a binary on each partition, waits still each job has finished, pools the results and then uses those as input to the next cycle.
for($i=0; $i<5; $i++) { for($j=0; j<60; $j++) { $output[$j]=system("qsub $input[$j]"); } #wait until each of the previous jobs finishes @input=pool_output(@output); }
Now I can't figure out how to hook basically employ an observer pattern so that only after each qsub job has finished, do I pool output and then iterate, without polling. Remember that qsub returns almost immediately after submitting the job (the job itself may not have finished). Here are some of the ideas so far: using qsub -sync, which will block until the qsubbed job is done..ok...so start a bunch of submission jobs in parallel, so open a process file handle for each submission process or something? I can't figure out where to keep a counter so that the iteration is triggered only after each job has finished. qsub -m e to get an email when the job is done...so I write my own smptd....*shudder*...but this is the right concept of what I need. The newest version of PBS has something called "job arrays" that might be the answer, but unfortunately we don't have the newest version here. I would think that there is some sort of obvious aspect of unix IPC that I am missing, but I can't get a handle on this. Any help would be most appreciated.

In reply to Parallel batch process plumbing issues by gmol

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.