Session-creation attributes
Client-side features of the SessionCreationAttributes API enable developers to dynamically specify the session-level parameters while creating a session. This feature is supported on all supported operating systems. Additionally, note that if you are using the IBM® Spectrum Symphony multicluster, functions related to session creation (such as parent-child workload using the SessionCreationAttributes::setParent() API, and workload redirection across multiple applications using the multiple SSM feature) are not supported.
About client-side session creation workload attributes
- Preemptive
- Determines if the session is preemptive. If the value is set to true in conjunction with the R_PriorityScheduling policy, the session will preempt lesser priority sessions to get resources when it has unsatisfied demand; if set to true for other policies, the session will only preempt sessions with a lesser session ranking. If the value is set to false, and all resources are occupied by other sessions, the session must wait until the currently running tasks are completed before it can get any resources. The default value is false.
- ReclaimRank
- Defines the relative importance of a session; the higher the number, the more severe the impact to the session if the associated tasks are interrupted. This rank overrides the configuration defined for the session type in the application profile.
- ResourceGroupFilter
- Applies a resource group filter to the session. This resource group filter overrides the one defined for the SessionType in the application profile. Tasks from a session can only run on resources that belong to one of the resource groups listed in the filter.
- ServiceName
- Any service name that exists in the application profile. Workload submitted to the session is
sent to the service specified in the SessionCreationAttributes.
If session type is specified, the configured value for ServiceName in the session type will be used as default.
If session type is not specified when creating the session, the default ServiceName is the service configured as default="true" in the application profile.
- ServiceToSlotRatio
- Applies a slot usage requirement to the session by specifying a service-to-slot ratio. This ratio overrides the one defined for the SessionType in the application profile. Tasks from this session can only run on service instances that occupy the appropriate number of slots.
- SessionFlags
-
Flags that control how the API will interact with the session.
- SessionName
- Text to be associated with the session. This name does not have to be unique and exists to give informational details as desired by the creator of the session. SessionName is limited to 256 characters.
- SessionPriority
- A priority between 1 and 10,000 (highest).
If session type is specified, the configured value for SessionPriority in the session type will be used as default.
If no value is configured for SessionPriority, the default SessionPriority of 1 is used.
If session type is not specified when creating the session, the default SessionPriority is 1.
- SessionTag
- A text to be associated with a session that can be used in administrative operations. SessionTag is limited to 128 characters.
- SessionType
- A name associated with a collection of other attributes that can be assigned to a session on its
creation. The session type specified with the API must match the session type that is defined in the
application profile. The session type can be a maximum of 128 characters.
The session type is optional. If you leave this parameter blank (" ") or do not set a session type, system default values are used for session attributes. If you specify a session type in the client application, you must also configure the session type in the application profile so that the session type name in your application profile and session type you specify in the client match. If you use an incorrect session type in the client and the specified session type cannot be found in the application profile, an exception is thrown to the client.
Example: Set workload session attributes with SessionCreationAttributes API
- C++
-
SessionCreationAttributes attrs; attrs.setSessionPriority(100); attrs.setServiceName("calc"); attrs.setSessionName("My Session"); attrs.setSessionType("LongRunningSession"); attrs.setSessionFlags(ReceiveSync); attrs.setSessionTag("S9v234"); ...
- C# (.NET)
-
SessionCreationAttributes attrs = new SessionCreationAttributes(); attrs.SessionPriority = 100; attrs.ServiceName="calc"; attrs.SessionName="My Session"; attrs.SessionType="LongRunningSession"; attrs.SessionFlags = ReceiveSync; attrs.SessionTag="S9v234"; ...
- Java™
SessionCreationAttributes attrs = new SessionCreationAttributes();
attrs.setSessionPriority(100);
attrs.setServiceName("calc");
attrs.setSessionName("My Session")
attrs.setSessionType("LongRunningSession");
attrs.setSessionFlags(ReceiveSync);
attrs.setSessionTag("S9v234");
...