IActivationFilter Interface

This interface defines the methods for implementing a custom job activation filter. The HPC Job Scheduler Service can call activation filters to provide additional checks and controls when a job is about to start or about to grow (get more resources while running). This type of filter is defined as a DLL (its methods are called directly by the HPC Job Scheduler Service), and is configured by the administrator at the job template level.


Namespace: Microsoft.Hpc.Scheduler.AddInFilter.HpcClient
Assembly: Microsoft.Hpc.Scheduler (in Microsoft.Hpc.Scheduler.dll)

'Usage
Dim instance As IActivationFilter

public interface IActivationFilter
public interface IActivationFilter
public interface IActivationFilter

The HPC Job Scheduler Service can run an activation filter when candidate resources are about to be allocated to a queued or running job. The activation filter might run multiple times for the same job. For example, the activation filter can run when the job is about to be started, and then run again as new resources are about to be added to the job (dynamic growth).The job activation filter can check the job for factors that you want to control, such as unavailability of licenses or exceeded usage time for the submitting user.

The filter must implement the FilterActivation and the RevertActivation methods. To evaluate a job, the HPC Job Scheduler Service calls the FilterActivation method. The return value from this method determines how the HPC Job Scheduler Service will treat the job and its resources. If the call to FilterActivation returns JobFailed, then the HPC Job Scheduler Service calls RevertActivation for all previously run filters in the chain.

The Microsoft HPC Pack 2008 R2 code samples include example activation filters (in the folder).Scheduler/Filters/DLLSP2 SDK

The behavior of the HPC Job Scheduler Service is undefined when filters return directly by throwing an exception. To avoid this, use try/catch constructions and set a valid return response within the catch area if an exception is thrown.

All calls to filter methods are time bounded and are aborted if they exceed the allowed time. The time allowed for FilterActivation and RevertActivation is determined by the Activation Filter Timeout setting that the cluster administrator can configure in Job Scheduler options (the timeout for cluster-wide filters also applies to the job template filters).The default timeout is 15 seconds.

DLLs that contain more than one implementation of this interface are rejected by the HPC Job Scheduler Service.

Do not use the scheduler APIs to cancel a job from within a filter. This can cause the HPC Job Scheduler Service to stop responding. To cancel a job, the filter should return the FailJob filter response. This response value causes the HPC Job Scheduler Service to cancel the job and mark it as Failed.

DLL filters are only called if they are specified in the job template that is used for the job. For more information, see How to Add or Remove Job Template Level Submission or Activation Filters.

To read about or share best practices, see the TechNet Wiki article Best practices for writing job template level filters for the HPC Job Scheduler Service.

Platform Note: This class was introduced in Windows HPC Server 2008 R2 with Service Pack 2 (SP2) and is not supported in previous versions.


Development Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

Target Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, with HPC Pack Client Utilities




Build Date:

2013-04-22
Show: