# Frequently Asked Questions (FAQ)
# Maintained by Anthony Sulistio (anthony@cs.mu.oz.au)
# $Id: faq.txt,v 1.3 2003/07/02 02:32:02 anthony Exp $


Questions related to GridSim
============================

Q: How do you compile and run GridSim application?

A: For example, if you want to run Example1

   In Unix/Linux:
   * go to the directory of where Example1 resides, i.e.
     at command prompt type: cd $GRIDSIM/examples/gridsim/Example1
   * to compile type:  javac -classpath $GRIDSIM/gridsim.jar:. Example1.java
   * to run type: java -classpath gridsim.jar:. Example1

   In Windows:
   * go to the directory of where Example1 resides, i.e.
     at command prompt type: cd %GRIDSIM%\examples\gridsim\Example1
   * to compile type:  javac -classpath %GRIDSIM%\gridsim.jar:. Example1.java
   * to run type: java -classpath gridsim.jar:. Example1


   The main difference is the use of ":" for Unix/Linux, and ";" for Windows
   NOTE: $GRIDSIM or %GRIDSIM% is the location of the GridSim Toolkit package.

---------------------------------------------------------
Q: When I run GridSim application, I have the following error message:
        Exception in thread "main" java.lang.NoClassDefFoundError: Example1

A: You need the classpath to refer to the directory where Example1.java
   located. For Example, to run in Windows:
        java -classpath gridsim.jar;. Example1

   where Example1 is the classname you want to execute

---------------------------------------------------------
Q: My GridSim application runs perfectly, however, after the end of simulation
   it just hang without exiting properly.

A: The problem may be caused by not closing GridSim entities, such as
   GridStatistics, I/O, etc. Each class that extends GridSim with
   a networked I/O ports must use terminate the I/O entities by using
   terminateIOEntities() before exiting body() method.

   Another cause for this problem is the number of Grid user entities.
   Before the start of a GridSim application, you need to intialize the GridSim
   package using GridSim.init(). The method requires to have the number of
   Grid user entities. If the number is different from the actual Grid user
   entities, your GridSim application will hang or can't exit properly.

---------------------------------------------------------

Q: When running GridSim Example 4, 5 and 6 I got an infinite loop
   saying: "Waiting to get list of resources".

A: In GridSim 2.1, GridSim.getGridResourceList() uses a message event
   to tell GIS (GridInformationService) entity to send the GridResource
   list. This causes a significant delay and a bit redundant.

   In GridSim 2.2, GridSim.getGridResourceList() directly uses a
   method call to GIS entity rather than a message passing.
   This makes the operation a lot faster. However, during the early stage
   of simulation, a GridResource might be slow in registering its service
   to GIS. Hence, the GridResource list is always empty and causing
   an infinite loop.

   To solve this problem, inside the while() loop, put the following
   code:
            // need to pause for a while to wait GridResources finish
            // registering to GIS
            super.gridSimHold(1.0);    // hold by 1 second

   So, you wait 1 second later to get GridResource list.

---------------------------------------------------------

Q: When I tried to run GridSim Example4, I have the following error message:
    java.lang.IncompatibleClassChangeError
        at Example4.body(Example4.java:70)
        at eduni.simjava.Sim_entity.run(Sim_entity.java:603)

A: I am not sure what is the exact problem. However, this is mainly
   caused by older release of SimJava. GridSim Toolkit 2.2 now uses
   SimJava2. Simply recompile the Example4.java will solve this
   problem.

   NOTE: This problem is also effected GridSim Example6.

---------------------------------------------------------
Q: When I tried to run GridSim Example1, I have the following error message:
    Exception in thread "main" eduni.simjava.Sim_exception:
    Sim_entity: Entity names can't contain spaces.
        at eduni.simjava.Sim_entity.<init>(Sim_entity.java:154)
        at gridsim.GridSim.<init>(GridSim.java:149)
        at gridsim.GridResource.<init>(GridResource.java:93)
        at Example1.createGridResource(Example1.java:188)
        at Example1.main(Example1.java:57)

A: GridSim Toolkit 2.2 now uses SimJava2. SimJava2 is more strict about
   a valid entity name compare to previous release. Hence, to fix this
   problem is to remove the unnecessary empty space, i.e.
   "GridResource 0" becomes "GridResource_0"

---------------------------------------------------------
Q: Are there any type of applications that I can simulate with GridSim?

A: GridSim provides the grid simulation environment (with resources and
   users), but you need to write codes specifically for the application you
   want to simulate, e.g. a resource broker Nimrod/G is written to call
   GridSim classes.

---------------------------------------------------------
Q: How do I create Gridlets with compute I/O requirements?

A: Gridlets with compute I/O requirements are simulated through their file
   sizes (input) and output sizez (output) parameters.
   See Figure 16 of the GridSim paper.

---------------------------------------------------------
Q: I have a question on network simulation in Gridsim.
   In my understanding, entities with networking capability must define
   input and output port. Both ports are "connected" to a simulated network.
   How does Gridsim models network link and its characteristics, especially
   bandwidth, since I couldn't find class that models this network link?
   Does Gridsim also simulate bandwidth-sharing if there are several IOdata
   are sent using the same link?

A: Not supported in the current version 2.2 as currently GridSim uses very
   simple network model.

---------------------------------------------------------
Q: Is GridSim tool kit provides any help in solving problems for dynamical
   resource allocation upon failure?

A: GridSim provides mechanism to reserve, but policy of reservation and
   how to handle failures etc. is up to server provider and consumers to define.

---------------------------------------------------------
Q: How do you model the gridlet execution in time_shared resource?

A: Just creating a Gridlet is sufficient. It runs on both time and space
   shared machines.

---------------------------------------------------------
Q: Does each gridlet can only be processed by only one PE?

A: Yes, it runs one PE.

---------------------------------------------------------
Q: Is the model for parallel job included inside the GridSim?

A: It is up users to model parallel application job at the higher level
   (develop on top of gridsim).

---------------------------------------------------------
Q: When I run GridSim, I have the following error message:
        Sim_system:Error - past event detected!
        Time: 0.0, event time: -XXXXX.X event type: 1
        Where XXXXX.X is a negative number that varies.

A: It appears like this error comes up for one of the following scenarios:
   - an entity or object waits for a specific event. However, the response
     event type is different.
   - some events are not captured.
   - GridSim runs under multi-threaded environment. Hence, some events might
     be accidentally deleted or being changed by other thread to wait for
     a different response that doesn't exist, etc ...

---------------------------------------------------------


Questions related to GridBroker
===============================

Q: How do you compile and run GridBroker application?

A: For example, if you want to run Example1

   In Unix/Linux:
   * go to the directory of where Example1 resides, i.e.
     at command prompt type: cd $GRIDSIM/examples/gridbroker/Example1
   * to compile type:  javac -classpath $GRIDSIM/all.jar:. Example1.java
   * to run type: java -classpath gridsim.jar:. Example1

   In Windows:
   * go to the directory of where Example1 resides, i.e
     at command prompt type: cd %GRIDSIM%\examples\gridbroker\Example1
   * to compile type:  javac -classpath %GRIDSIM%\all.jar:. Example1.java
   * to run type: java -classpath gridsim.jar:. Example1


   The main difference is the use of ":" for Unix/Linux, and ";" for Windows
   Also, instead of using "all.jar", you can use
   "gridbroker.jar and gridsim.jar". It's up to you.
   NOTE: $GRIDSIM or %GRIDSIM% is the location of the GridSim Toolkit package.

---------------------------------------------------------
Q: I want to create one application. Is it necessary to know Nimrod/G ?

A: You don't need to know Nimrod/G in detail.  Reading the GridSim paper
   from http://www.cs.mu.oz.au/~raj/papers/gridsim.pdf
   should be sufficient to get a basic idea of Nimrod/G.

   GridBroker, as part of GridSim toolkit, is used to simulate the Grid
   environment and a Nimrod/G like deadline and budget constraint scheduling
   system.

---------------------------------------------------------
Q: The application generates the files: tracefile, stat.txt, g14.sched1,
   g14.sched2, g14.sched3, g14.sched31, g14.sched4, g14.sched5, g14.sched6.
   What are the meaning of these files?

A: These files contains statistical results of the simulation that are of
   interest to the GridSim user (ie. you).

   When running a GridBroker application, it will produce the following files:

        stat.txt -> created by GridSim class during GridSim.init() to create
                    a GridStatistics object for statistical purposes

        tracefile -> created by the SimJava package to trace every events
                     that are performed by SimJava, GridSim and GridBroker
                     during the simulation.

        g14.sched* -> All of these files are created by Broker class.
                      When we create an UserEntity object, it will
                      automatically creates a Broker object.

    Description on the g14.sched* files:
        g14.sched1 is about Gridlets finished report.
        g14.sched2 is about Gridlets processing expenses report.
        g14.sched3 is about Gridlets on resource report.
        g14.sched31 is about Gridlets committed for resource report.
        g14.sched4 is same as g14.sched1, however this file only
            displays the overall result or summary of g14.sched1 file.

        g14.sched5 is same as g14.sched2, however this file only
            displays the overall result or summary of g14.sched2 file.

        g14.sched6 is same as g14.sched3, however this file only
            displays the overall result or summary of g14.sched3 file.

    NOTE: Explanations about the content of each file are mentioned in
          GridBroker example section.

---------------------------------------------------------


Questions related to VisualModeler
==================================

Q: How do I run VisualModeler?

A: To run it, just type:
        java -jar visualmodeler.jar

---------------------------------------------------------
Q: I have the following warning message when trying to run VisualModeler.
   Jun 29, 2003 5:36:56 PM java.util.prefs.FileSystemPreferences$3 run
   WARNING: Could not create system preferences directory.
            System preferences are unusable.

A: That's the JDK1.4 Preferences API, used to manage system-wide and per-user
   preferences. On Windows, the implementation uses the Windows Registry;
   on Unix/Linux, it uses the file system.

   The warning means Java (used under a user) tries to write preference files
   in the root-owned directory that contains Java. This may be caused
   by the way Java installed.

   To solve this problem is run VisualModeler under root. Java will
   automatically creates system preferences directory. Possibly in
   /etc/.java/.systemPrefs

   Go to the following website to know more about this:
        http://java.sun.com/j2se/1.4.1/install-linux.html

---------------------------------------------------------



