25.06.2015 Views

Administering Platform LSF - SAS

Administering Platform LSF - SAS

Administering Platform LSF - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9<br />

Adding Resources<br />

ELIM restart<br />

For example, elim.license.exe<br />

If LIM expects some resources to be collected by an ELIM according to<br />

configuration, it invokes the ELIM automatically on startup. The ELIM runs with<br />

the same user ID and file access permission as the LIM.<br />

The LIM restarts the ELIM if it exits; to prevent problems in case of a fatal error<br />

in the ELIM, it is restarted at most once every 90 seconds. When the LIM<br />

terminates, it sends a SIGTERM signal to the ELIM. The ELIM must exit upon<br />

receiving this signal.<br />

Example 1 Write an ELIM.<br />

The following sample ELIM (<strong>LSF</strong>_SERVERDIR/elim.mysrc) sets the value<br />

of myrsc resource to 2. In a real ELIM, you would have a command to<br />

retrieve whatever value you want to retrieve and set the value.<br />

#!/bin/sh<br />

while :<br />

do<br />

# set the value for resource "myrsc"<br />

val=2<br />

# create an output string in the format:<br />

# number_indices index1_name index1_value...<br />

reportStr="1 myrsc $val"<br />

echo "$reportStr"<br />

# wait for 30 seconds before reporting again<br />

sleep 30<br />

done<br />

2 Test this ELIM by running it from the command line.<br />

% ./elim.myrsc<br />

It should give you the output:<br />

1 myrsc 2<br />

3 Copy the ELIM to <strong>LSF</strong>_SERVERDIR and make sure it has the name<br />

elim.myrsrc.<br />

4 Define the myrsc resource in lsf.shared.<br />

In this case, we are defining the resource as Numeric because we want it<br />

to accept numbers. The value does not increase with load.<br />

Begin Resource<br />

RESOURCENAME TYPE INTERVAL INCREASING DESCRIPTION<br />

myrsc Numeric 30 N (custom resource to trigger elim to<br />

start up)<br />

End Resource<br />

5 Map the myrsc resource to hosts in lsf.cluster.cluster_name. In this<br />

case, we want this resource to reside only on hostA.<br />

<strong>Administering</strong> <strong>Platform</strong> <strong>LSF</strong> 161

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!