Shared configuration file content

Use the #INCLUDE directive to insert the contents of the specified file into a configuration file to share common configurations between clusters or hosts.

About this task

LSF allows common configurations to be shared by all clusters (when you use the LSF multicluster capability) and by all hosts. In addition, configuration for the LSF multicluster capability requires that you keep the lsf.shared configuration files consistent between clusters for definitions and resources that are used by the LSF multicluster capability. To facilitate this requirement, there is an #INCLUDE directive to clearly partition information that is common to all clusters or hosts. The #INCLUDE directive specifies a file whose contents are inserted into the current configuration file. There is no need to create a primary copy for distribution, which can then have local customizations with definition changes that could cause unpredictable behavior for jobs that use the LSF multicluster capability. The #INCLUDE directive simplifies application maintenance by allowing a relevant power user to own and modify each application-specific include file. The #INCLUDE directive also separates portions of the LSF configuration files to allow specific users or user groups to own and modify their portion of the configuration.

You can use the #INCLUDE directive in any place in the following configuration files:

  • lsb.applications
  • lsb.hosts
  • lsb.queues
  • lsb.reasons
  • lsb.resources
  • lsb.users

You can only use the #INCLUDE directive at the beginning of the lsf.shared file.

Procedure

  1. Create the common configuration files and send them to the local administrators. The format for the common configuration files is the same as the existing LSF configuration files.

    Reserved words and structures (such as #if, #elif, #else, and #endif; or the structures that are specific to LSF configuration files) must be entirely contained in a single #include file and cannot cross multiple files. That is, you cannot have #if and #elif in one file with #else and #endif in an #include file. If you have an #if statement in one file, it must have a corresponding #endif statement in the same file.

    For example, the following configuration for the lsb.users file results in an error because the #if and #endif statements are in different files:

    • Contents of the lsb.users file:
      Begin User 
      USER_NAME   MAX_JOBS   JL/P   MAX_PEND_JOBS     PRIORITY
      user1       10          -        1000           200
      user2        4          -           -           100
      user3        -          -           -           300
      groupC       -          -         500           100
      default      6          1          10             0
      #if time(07:00-09:00)
      groupA      10          1      100000           400
      groupA@      -          1         100           200
      #else
      #include "/home/work/lsb.users_groupA"
      End User
    • Contents of the lsb.users_groupA file:
      #USER_NAME   MAX_JOBS   JL/P   MAX_PEND_JOBS     PRIORITY
      groupA       5          1        1000           300
      groupA@      -          1         100           200
      #endif

    The following configuration for the lsb.users file results in an error because the Begin User and End User lines are in different files:

    • Contents of the lsb.users file:
      Begin User 
      USER_NAME   MAX_JOBS   JL/P   MAX_PEND_JOBS     PRIORITY
      user1       10          -        1000           200
      user2        4          -           -           100
      user3        -          -           -           300
      groupC       -          -         500           100
      default      6          1          10             0
      #include "/home/work/lsb.users_groupA"
      
    • Contents of the lsb.users_groupA file:
      #USER_NAME   MAX_JOBS   JL/P   MAX_PEND_JOBS     PRIORITY
      groupA       5          1        1000           300
      groupA@      -          1         100           200
      End User

    The following configuration for the lsb.users file is correct:

    • Contents of the lsb.users file:
      Begin User 
      USER_NAME   MAX_JOBS   JL/P   MAX_PEND_JOBS     PRIORITY
      user1       10          -        1000           200
      user2        4          -           -           100
      user3        -          -           -           300
      #include "/home/work/lsb.users_groupA"
      groupC       -          -         500           100
      default      6          1          10             0
      End User
    • Contents of the lsb.users_groupA file:
      #USER_NAME   MAX_JOBS   JL/P   MAX_PEND_JOBS     PRIORITY
      #if time(07:00-09:00)
      groupA      10          1      100000           400
      groupA@      -          1         100           200
      #else
      groupA       5          1        1000           300
      groupA@      -          1         100           200
      #endif
  2. Ensure that the local administrators for each cluster open their local configuration files and add the #include "path_to_file" syntax to them.

    Grant write access to the intended owners of the shared common files that are specified in the #include directive so that they can maintain their own files. These owners do not necessarily have write access to the entire configuration file, which limits the changes that they can make to the entire cluster and ensures that only the local administrator can affect the system.

    All #include lines must be inserted at the beginning of the local lsf.shared file. If #include lines are placed within or after any other sections in lsf.shared, LSF reports an error.

    You can insert the #include lines anywhere in the other configuration files.

    For example, lsf.shared file has four included common files that represent the HostType, HostModel, and Resource sections. Different users can own the different common files, so one user can be responsible for maintaining the list of hardware types and operating systems, one can be responsible for the list of machine model names and CPU factors, and one can be responsible for the list of LSF resources. The Cluster section is different for each cluster when using the LSF multicluster capability, so this section is not used in a shared common file.

    #INCLUDE "/Shared/lsf.shared.HostType" # Comments
    #INCLUDE "/Shared/lsf.shared.HostModel"
    #INCLUDE "/Shared/lsf.shared.Resource"
    Begin Cluster
    ClusterName  Servers
    cluster1     hostA
    cluster2     hostB
    End Cluster

    The following lsb.queues file has three included common files that represent three different queues. This allows different users (such as queue administrators) to own each file and be responsible for their own queues. The file also has one included common file that specifies the users who can submit jobs to the normal queue. This allows a user, for example, to control the users or user groups that have access to the normal queue.

    #INCLUDE "/Shared/lsb.queues.interactive"
    #INCLUDE "/Shared/lsb.queues.priority"
    #INCLUDE "/Shared/lsb.queues.night"
    Begin Queue
    QUEUE_NAME = normal
    PRIORITY = 30 
    STACKLIMIT= 2048 
    DESCRIPTION = For normal low priority jobs, running only if hosts are lightly loaded. 
    QJOB_LIMIT = 60     # job limit of the queue 
    PJOB_LIMIT = 2     # job limit per processor 
    ut = 0.2 
    io = 50/240 
    #INCLUDE "/Shared/lsb.queues.normal.users" #USERS parameter 
    HOSTS = all  
    NICE = 20 
    End Queue

    The following lsb.applications file has four included common files that represent four different application profiles. This allows different users to own each file and be responsible for their own application profiles. The file also has one included common file that specifies the pre-execution and post-execution scripts for the 4proc application. This allows a user, for example, to change the scripts for this particular application.

    #INCLUDE "/Shared/lsb.applications.dockerapp"
    #INCLUDE "/Shared/lsb.applications.shifterapp"
    #INCLUDE "/Shared/lsb.applications.singapp"
    Begin Application
    NAME          = 4proc
    RUNTIME       = 120      # scheduling hint of 15 minutes
    TASKLIMIT     = 4 4 4
    RES_REQ       = span[hosts=1]
    #INCLUDE "/Shared/lsb.applications.4proc.scripts" #PRE_EXEC/POST_EXEC parameters
    End Application
    #INCLUDE "/Shared/lsb.applications.catia"

    If there is any duplicate configuration between the common configuration file and the local ones, the common one takes effect and LSF reports an error. If there are fewer columns in the common files than the local configurations, LSF provides default values for the undefined columns. If there are more columns in the common files than the local configurations, LSF ignores the lines with more columns and reports an error.

  3. Make the configuration active.

    For more information about how to apply the changes and make the configuration active, see the configuration files that you modified.