uka.gm
Class GM

java.lang.Object
  extended byuka.gm.GM

public class GM
extends java.lang.Object

Author:
Bernhard Haumacher, Thomas Moschny

Nested Class Summary
(package private) static class GM.HPort
           
static class GM.UID
           
static class GM.VPort
           
 
Field Summary
static boolean AVAILABLE
           
static int DEFAULT_HPORT
           
(package private) static GM.HPort firstHPort
           
(package private) static GM.HPort[] hports
           
(package private) static int[] hportsInUse
           
(package private) static int hportsInUseCnt
           
(package private) static int KNOWN_VPORTS
          Note: an array of size MAX_VPORTS is statically allocated, so do not increase the amount of available vports to infinity!
(package private) static int lastAllocatedVPort
           
(package private) static int MAX_HPORTS
           
static int MAX_MESSAGE_SIZE
           
static int RECEIVES_BEFORE_WAIT
           
static int SENDS_BEFORE_WAIT
           
(package private) static GM.VPort[] vports
          Array of already allocated virtual ports.
(package private) static int VPORTS
           
(package private) static int vportsInUseCnt
           
 
Constructor Summary
GM()
           
 
Method Summary
private static void createHPort(int device, int hportNr)
           
static GM.VPort createVPort(int vportNr)
          Create a new virtual port object for communication over the GM network interface.
private static void gmClose(int hport)
           
static void gmDump()
           
private static void gmFinalize()
           
private static java.lang.String gmGetHostName(int hport)
           
private static int gmGetNodeID(int hport)
           
private static int gmGetNodeID(int hport, byte[] uid)
           
private static int gmGetNodeID(int hport, java.lang.String name)
           
private static byte[] gmGetUID(int hport, int node)
           
private static void gmInit()
           
private static int gmMaxMessageSize()
           
private static int gmMaxThreads(int hport)
           
private static int gmNumPorts(int hport)
           
private static void gmOpen(int device, int port_id, java.lang.String name)
           
private static long gmReceive(int hport, int vport, byte[] buffer, int offset, int cnt)
           
private static long gmSend(int hport, int vport, int hportTo, int nodeTo, int vportTo, byte[] buffer, int offset, int cnt)
           
(package private) static int mapVPortToHPort(int vportNr)
           
static java.lang.String usedHPorts()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HPORT

public static final int DEFAULT_HPORT
See Also:
Constant Field Values

RECEIVES_BEFORE_WAIT

public static final int RECEIVES_BEFORE_WAIT
See Also:
Constant Field Values

SENDS_BEFORE_WAIT

public static final int SENDS_BEFORE_WAIT
See Also:
Constant Field Values

AVAILABLE

public static final boolean AVAILABLE

KNOWN_VPORTS

static final int KNOWN_VPORTS
Note: an array of size MAX_VPORTS is statically allocated, so do not increase the amount of available vports to infinity!

See Also:
Constant Field Values

VPORTS

static final int VPORTS
See Also:
Constant Field Values

vportsInUseCnt

static int vportsInUseCnt

lastAllocatedVPort

static int lastAllocatedVPort

vports

static GM.VPort[] vports
Array of already allocated virtual ports. The port number zero reserved.


MAX_HPORTS

static final int MAX_HPORTS
See Also:
Constant Field Values

hportsInUseCnt

static int hportsInUseCnt

firstHPort

static GM.HPort firstHPort

hports

static GM.HPort[] hports

hportsInUse

static int[] hportsInUse

MAX_MESSAGE_SIZE

public static final int MAX_MESSAGE_SIZE
Constructor Detail

GM

public GM()
Method Detail

createVPort

public static GM.VPort createVPort(int vportNr)
                            throws java.io.IOException
Create a new virtual port object for communication over the GM network interface. The port number must be in the range 1..MAX_VPORTS. If the port number zero is specified, an arbitrary free virtual port is allocated with a port number >= KNOWN_VPORTS.

Throws:
java.io.IOException

usedHPorts

public static java.lang.String usedHPorts()

mapVPortToHPort

static int mapVPortToHPort(int vportNr)
                    throws java.io.IOException
Throws:
java.io.IOException

createHPort

private static void createHPort(int device,
                                int hportNr)
                         throws java.io.IOException
Throws:
java.io.IOException

gmInit

private static void gmInit()
                    throws java.io.IOException
Throws:
java.io.IOException

gmFinalize

private static void gmFinalize()

gmOpen

private static void gmOpen(int device,
                           int port_id,
                           java.lang.String name)
                    throws java.io.IOException
Throws:
java.io.IOException

gmClose

private static void gmClose(int hport)
                     throws java.io.IOException
Throws:
java.io.IOException

gmReceive

private static long gmReceive(int hport,
                              int vport,
                              byte[] buffer,
                              int offset,
                              int cnt)
                       throws java.io.IOException
Throws:
java.io.IOException

gmSend

private static long gmSend(int hport,
                           int vport,
                           int hportTo,
                           int nodeTo,
                           int vportTo,
                           byte[] buffer,
                           int offset,
                           int cnt)
                    throws java.io.IOException
Throws:
java.io.IOException

gmNumPorts

private static int gmNumPorts(int hport)

gmMaxMessageSize

private static int gmMaxMessageSize()

gmMaxThreads

private static int gmMaxThreads(int hport)

gmGetNodeID

private static int gmGetNodeID(int hport)

gmGetNodeID

private static int gmGetNodeID(int hport,
                               java.lang.String name)

gmGetNodeID

private static int gmGetNodeID(int hport,
                               byte[] uid)

gmGetHostName

private static java.lang.String gmGetHostName(int hport)

gmGetUID

private static byte[] gmGetUID(int hport,
                               int node)

gmDump

public static void gmDump()