| User Opinions (6 votes) |
50%
50%
|
|
Thank you for rating this answer.
|
Article ID: 189
Last Updated: 17th December 2009 09:07:26 am
Specifying CPU cores for node-locked licenses can be useful in cases such as high-tech computing and application virtualization. This license model enables you to base licensing on the customer's computing resource requirements, increasing the pricing depth for your software offerings. For example, since a 4-CPU machine is double the speed of a 2-CPU machine, licensing the 4-CPU machine would be double the cost of licensing the 2-CPU machine.
To base node-locked licensing on CPU cores (example made in Windows environment):
- Start a new project in your IDE. Base your code on the example in LM-X root directory\examples\local\local.c.
- Include the LM-X library into your application (see the LM-X Quick Start Guide for more information).
- Generate a node-locked license file using xmllicgengui (for Windows only; use xmlilicgen for other platforms), located in LM-X root directory\platform-specific directory, for example, C:\LM-X\Win32_x86.
- Using the OPTIONS setting, specify the number of processor cores that the license will be limited to. For example, "CPU=1" limits the license to one processor core, "CPU = 2" limits the license to two processor cores, etc. (We are using the syntax "CPU=x," but you may use different syntax if desired.) An example of the feature settings for a node-locked license are shown in the following screenshot.

An example XML template for a node-locked license looks like the following:
‹?xml version="1.0" encoding="utf-8"?› ‹LICENSEFILE› ‹FEATURE NAME="F1"› ‹SETTING MAJOR_VERSION="1" /› ‹SETTING MINOR_VERSION="0" /› ‹SETTING END="2012-01-01" /› ‹SETTING OPTIONS="CPU=1" /› ‹CLIENT_HOSTID› ‹SETTING ETHERNET="D71D90A3763DD3BF" /› ‹/CLIENT_HOSTID› ‹/FEATURE› ‹/LICENSEFILE›
-
To take the number of cores into account in your code (based on local.c example), change the checkout parameter:
LMX_Checkout(LmxHandle, LMX_GetFeatureChecksum("f2"), 1, 0, 1)
For processor-based licensing that sets the count to the number of logical CPUs, change the checkout parameter to:
LMX_Checkout(LmxHandle, LMX_GetFeatureChecksum("f2"), 1, 0, LMX_LOGICAL_CPU_COUNT)
For processor-based licensing that sets the count to the number of physical CPUs, change the checkout parameter to:
LMX_Checkout(LmxHandle, LMX_GetFeatureChecksum("f2"), 1, 0, LMX_PHYSICAL_CPU_COUNT)
- To access the license setting OPTIONS "CPU=1” use FI.szOptions which is available after calling LMX_GetFeatureInfo(LmxHandle, LMX_GetFeatureChecksum("F1")).
Retrieve the integer from string FI.szOptions and compare it with FI.nUsedLicCount, the actual number of CPUs. If the comparison does not match your limitation, you can force the program to exit (remember to use LMX_Free(LmxHandle) upon exit to free allocated memory). Otherwise, license restrictions are fulfilled and you can continue.
- Compile and run your application to check how it works.
|