resource requirements at job add, job submit, and task level RRS feed

  • Question

  • It appears that resource requirements can be specified at various points:

    - on a job, when adding it  (e.g., new-hpcjob)
    - on a job, when submitting it (e.g., submit-hpcjob)
    - on a task, when adding it to a job (e.g., add-hpctask)

    1) Are the submit-time values an override of the add-time values?
    2) does the task-level specification limit  how many tasks of the job can be simultaneously executed? 
    3) if a task specifies greater requirements that its job, what happens?

    I might be misunderstanding the whole thing.  If so, set me straight.


    Leo Tohill
    Friday, January 9, 2009 3:45 AM


  • Leo,
    Thanks for a great question!  Let me see if I can answer:

    There are two levels of resource requirement: Job-level (this is the number of resources you want for the job) and Task-level (the number of resources out of that job allocation that you want for a particular task once the job is allocated).

    New-HpcJob and Submit-HpcJob are both dealing with Job-level resource requests.  Anything you set at Submit time is overriding whatever you set at New time (think of it like running Set-HpcJob and then submitting).

    Add-HpcTask is rather specifying the resource requirement of the new task that you are creating.

    To simplify:
    HPC Pack 2008 actually includes a feature to auto-calulate the job requirement based on the tasks.  So you can simply do:
    $j = New-HpcJob
    $j | Add-HpcTask -numcores 1-4 -Command Foo1.exe
    $j | Add-HpcTask -numcores 2 -Command Foo2.exe
    $j | Submit-HpcJob

    The scheduler will figure out that your job needs 2-6 resurces to run (at least 2 so task 2 can start, and no more than 6 since that's the most you could use to concurrently run task 1 and task 2).  This is recommended since it allows the Scheduler to fit your tasks in as well as possible, and to take advantage of the Grow/Shrink scheduling policy.

    Alternatively, you could do:
    $j = New-HpcJob -numcores 2-4
    $j | Add-HpcTask -numcores 1-4 -Command Foo1.exe
    $j | Add-HpcTask -numcores 2 -Command Foo2.exe
    $j | Submit-HpcJob

    This would tell the scheduler to create a job which needs at least 2 but no more than 4 resources, and then run those two commands in it.  Each command would get the appropriate number of resources out of that 2-4 that you requested . . . so for example Task 1 might get all 4, and then 2 of those would go to Task 2 when Task 1 finishes.

    Does that answer your queston?  Check out my blog posts at http://blogs.technet.com/WindowsHPC for some more information.

    Friday, January 9, 2009 7:26 PM