Step 1: Write a Custom Filter Application

Applies To: Windows HPC Server 2008

A job submission or activation filter application parses the job description file (an XML file that specifies the terms of the job) to check for options that you want to disallow or limit. A submission filter can also make changes to the job description file.

The application must accept a single command-line argument, which is an absolute path to the job description file.

Depending on the return value from your filter, the HPC Job Scheduler Service will take the appropriate action. The acceptable return values are shown in the table below:

Filter Exit code meanings

Submission

  • 0 - The job will be queued as-is.

  • 1 - The filter modified one or more job properties, and the job will be queued.

  • Any other exit code - The job will not be queued.

Activation

  • 0 - The queue will not be blocked. If the filter did not cancel the job, the job will be activated.

  • Any other exit code - The queue will be blocked by this job. The job will not be activated and remains in the queue. The filter will reevaluate the job periodically until either the job passes, or until the job is canceled.

The HPC Job Scheduler Service, which is running on the head node, needs to be able to access your filter application. The access permissions for the filter application file must be properly set so that the local System account on the head node is able to run the filter application.

Important

Before writing and installing a custom filter, ensure that you have installed the HPC Pack 2008 Fix for Job XML Import and Export Issues update (https://go.microsoft.com/fwlink/?LinkId=132745). This update affects the job XML schema.

You can write a custom filter by using any programming language. The following topics provide C# code samples as an example of how to implement a submission filter and an activation filter: