Unlock a host in a cluster

Hosts that have been indefinitely locked by assigning the value 0 to the duration parameter of ls_lockhost() can only be manually unlocked.

To manually unlock a host, use ls_unlockhost():

int ls_unlockhost(void)

Note:

By unlocking a host, the master LIM can choose the host for task or job placement.

Example

The following code example demonstrates how to use ls_unlockhost() to manually unlock a host:

/****************************************************** 
* LSLIB -- Examples 
* 
* ls_unlockhost() 
* Unlocks an indefinitely locked local host. 
******************************************************/
#include <lsf/lsf.h> 
#include <stdlib.h> 
#include <stdio.h>
int main(int argc, char ** argv) 
{
/* Checking for the correct format*/ 
   if (argc !=1) 
{ 
     fprintf(stderr, "usage: sudo %s\n", argv[0]); 
     exit(-1); 
}
/* Call ls_unlockhost(). If an error occurs, print an error msg and exit.*/
   if (ls_unlockhost() <0) 
{ 
       ls_perror("ls_lockhost"); 
       exit(-1); 
}
/* Indicate a successful ls_unlockhost() call and exit.*/
       printf("Host is unlocked\n"); 
       exit(0); 
}