**Gram42 and HEAD Fake Local Resource Manager**

Fake LRM is a very simple simulation of a local resource manager (LRM).
It takes job submission requests from Gram4 and simulates jobs in a LRM
by putting them in state Pending, Active and Done. The state changes are
reported to Gram4 by a Fake scheduler event generator (SEG).

# Components

Fake LRM consists of

-   Fake Perl module for submitting, polling and canceling the jobs.

-   Fake scheduler provider. Without the Fake provider the Container
    indicates errors in the start up phase. The information provided is
    only dummy information

-   Fake SEG module for communicating state changes of the actual fake
    jobs back to Gram.

-   A Java daemon program that simulates the local resource manager

# Functioning

For Gram4 Fake is just another local resource manager, with another JNDI
configuration, another job factory resource, another SEG and another
Perl module.

The Fake LRM itself is a Java daemon program that handles fake jobs.
Fake jobs are empty files stored in the file-system, named with a
randomly generated local job id.

The base directory is \$GLOBUS_LOCATION/tmp/FakeLrm with subdirectories
new, pending, active, cancelled.

The Fake Perl module creates a file for a newly submitted jobs in
\$GLOBUS_LOCATION/tmp/FakeLRM/new and a file for cancelled jobs in

\$GLOBUS_LOCATION/tmp/FakeLRM/cancelled.

The fake LRM daemon program periodically checks for files in the
directories 'new' and 'cancelled'. If a file is found in 'new' a SEG log
entry is made that the job is now in state *Pending* and the related
file is moved to the directory 'pending'. The job is then scheduled for
the state change to *Active*. If the fake job becomes *Active* another
SEG log entry is written and the related file is moved to the directory
'active'. The job is then scheduled for the state *Done*. If the fake
job is *Done* the related file is removed and a SEG log entry is
written.

The fake LRM works with Gram4. I don't see why it cannot run with Gram2,
but no tests had been performed with Gram2.

# Installation

Fake LRM has components in the cvs components gram and ws-gram. It is
not installed as part of a regular GT installation. To install it,
download the modules gram and ws-gram from CVS (set then enironment
variable CVSROOT to

:pserver:anonymous@cvs.globus.org:/home/globdev/CVS/globus-packages)

cvs co --r globus_4_2_branch gram

cvs co --r globus_4_2_branch ws-gram

And install it as described in the following sections

## gram

### jobmanager/setup/fake

cd gram/jobmanager/setup/fake

gpt-build \--force

## ws-gram

### discovery/providers/setup/fake

cd ws-gram/discovery/providers/setup/fake

gpt-build \--force

### job_management/fake/java/source

cd ws-gram/job_management/fake/java/source

gpt-build \--force

### job_monitoring/fake

cd ws-gram/job_monitoring/fake/c/setup

./bootstrap && gpt-build ---force

cd ws-gram/job_monitoring/fake/c/source

./bootstrap && gpt-build ---force gcc32dbg

### service/java/setup/fake

cd ws-gram/service/java/setup/fake

gpt-build ---force

\$GLOBUS_LOCATION/setup/globus/setup-gram-service-fake

# Configuration

The configuration for the Fake LRM is stored in
\$GLOBUS_LOCATION/etc/globus-fake.conf. It is read and used by the Fake
SEG, the Fake Perl module and the Fake LRM Java daemon program

\# File where the fake SEG looks for events

log_path=/opt/gt42branch/var/globus-fake.log

\# The Perl module stores newly submitted jobs here as a

\# file named with the local id of the job

new_jobs_dir=/opt/gt42branch/tmp/FakeLrm/new

\# Jobs in state Pending are moved to here

pending_jobs_dir=/opt/gt42branch/tmp/FakeLrm/pending

\# Jobs in state Active are stored here

active_jobs_dir=/opt/gt42branch/tmp/FakeLrm/active

\# The Perl module stores newly cancelled jobs here as a

\# file named with the local id of the job

cancelled_jobs_dir=/opt/gt42branch/tmp/FakeLrm/cancelled

\# Min time in millis a job stays in state Pending

min_pending_time=3000

\# Max time in millis a job stays in state Pending.

\# The actual pending time is a random value between\
\# min_pending_time and max_pending_time

max_pending_time=4000

\# Min time in millis a job stays in state Active

min_active_time=1000

\# Max time in millis a job stays in state Active

\# The actual active time is a random value between\
\# min_active_time and max_active_time

max_active_time=2000

\# Print status in fake daemon. unit is millis

\# To enable logging add the following line in

\# \$GLOBUS_LOCATION/log4j.properties:

\# log4j.category.org.globus.exec.management=INFO

status_print_interval=2000

# Run the Fake LRM Java daemon

The fake LRM daemon must run, otherwise the jobs will not change their
states, and all newly submitted jobs will stay in state *Pending*. To
start the fake LRM daemon, call
\$GLOBUS_LOCATION/libexec/globus-run-fake-lrm

If you want periodical status prints that indicate how many jobs are
currently pending and active, add
log4j.category.org.globus.exec.management=INFO to
\$GLOBUS_LOCATION/log4j.properties. The interval of these periodical
prints can be configured in \$GLOBUS_LOCATION/etc/globus-fake.conf in
the parameter status_print_interval, as described above.