LSF provides you with the option to configure host groups, user groups, or both. When the membership of a host or user group changes frequently, or when the group contains a large number of members, you can use an external executable called egroup to retrieve a list of members rather than having to configure the group membership manually. You can write a site-specific egroup executable that retrieves host or user group names and the hosts or users that belong to each group.
LSF does not include a default egroup; you should write your own executable to meet the requirements of your site.
Define the host group in lsb.hosts, or the user group in lsb.users, and put an exclamation mark (!) in the GROUP_MEMBER column.
Create an egroup executable in the directory specified by the parameter LSF_SERVERDIR in lsf.conf. LSF does not include a default egroup; you should write your own executable to meet the requirements of your site.
Run the command badmin reconfig to reconfigure the cluster and import your external host and user groups.
External host groups are defined in lsb.hosts, and external user groups are defined in lsb.users. Your egroup executable must define the same group names that you use in the lsb.hosts and lsb.users configuration files.
Run when invoked by the commands egroup –m hostgroup_name and egroup –u usergroup_name. When mbatchd finds an exclamation mark (!) in the GROUP_MEMBER column of lsb.hosts or lsb.users, mbatchd runs the egroup command to invoke your egroup executable.
Output a space-delimited list of group members (hosts, users, or both) to stdout.
Retrieve a list of static hosts only. You cannot use the egroup executable to retrieve hosts that have been dynamically added to the cluster.
The following example shows a simple egroup script that retrieves both host and user group members:
#!/bin/shif [ "$1"="-m" ]; then #host groupif [ "$2"="linux_grp" ]; then #Linux hostgroupecho "linux01 linux 02 linux03 linux04"elif [ "$2"="sol_grp" ]; then #Solaris hostgroupecho "Sol02 Sol02 Sol03 Sol04"fielse #user groupif [ "$2"="srv_grp" ]; then #srvgrp user groupecho "userA userB userC userD"elif [ "$2"="dev_grp" ]; then #devgrp user groupecho "user1 user2 user3 user4"fifi
On restart and reconfiguration, mbatchd invokes the egroup executable to retrieve external host and user groups and then creates the groups in memory; mbatchd does not write the groups to lsb.hosts or lsb.users. The egroup executable runs under the same user account as mbatchd. By default, this is the root account on UNIX hosts and the cluster administrator account on Windows hosts.
Once LSF creates the groups in memory, the external host and user groups work the same way as any other LSF host and user groups, including configuration and batch command usage.
Although you cannot monitor egroup behavior directly, you can display information about running jobs for specific host or user groups.