8.4 Legion object management

The following section contains functions which are used to manage actual Legion Objects (create, activate, destroy, etc.).

int
ObjectActive(LegionIdType, char *Name);

Indicates whether the given object is currently active or inert.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
Name = Either a context path name or a LOID.

Return Values:
1 if the object is active
0 if the object is inert

Error Return:
-1

User Responsibility: None

char*
Ping(LegionIdType, char *Name);

Ping a given object to see if it is responsive.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
Name = Either a context path name or a LOID.

Return Values:
LOID of the object pinged.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing the LOID returned.

char**
Create(int NumObjects, LegionIdType, char* ClassName);

Create a vector of new Legion objects by vector instantiating the given class.

Parameters:
NumObjects = Number of object to vector instantiate.
IdType = Flag indicating whether the ClassName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the class to instantiate.

Return Values:
NULL terminated array of LOIDs indicating the objects that were instantiated. Each element of the
array is a char* which is the LOID of one object created.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing each LOID in the array as well as the array itself.

char**
ScheduledCreate(int NumObjects,
LegionIdType CIDType, char* ClassName,
LegionIdType SIDType, char *SchedName
);

Create a vector of new Legion objects by vector instantiating the given class. Used the given scheduler to schedule this vector instantiation.

Parameters:
NumObjects = Number of object to vector instantiate.
CIdType = Flag indicating whether the ClassName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the class to instantiate.
SIdType = Flag indicating whether the SchedName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the Scheduler to use when instantiating the class.

Return Values:
NULL terminated array of LOIDs indicating the objects that were instantiated. Each element of the
array is a char* which is the LOID of one object created.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing each LOID in the array as well as the array itself.

char**
CreateRestricted(int NumObjects,
LegionIdType CIDType, char *ClassName,
LegionIdType HIDType, char *HostName,
LegionIdType VIDType, char *VaultName,
LegionIdType IIDType, char *ImplName)
;

Create a vector of new Legion objects by vector instantiating the given class. The user also indicates any combination of restrictions which may include restrictions to hosts, vaults or implementations.

Parameters:
NumObjects = Number of object to vector instantiate.
CIdType = Flag indicating whether the ClassName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the class to instantiate.
HIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
HostName = LOID or context path name of the Host to which the instantiation is restricted.
VIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
VaultName = LOID or context path name of the Vault to which the instantiation is restricted.
IIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
ImplName = LOID or context path name of the implementation to which the instantiation is
restricted.

Return Values:
NULL terminated array of LOIDs indicating the objects that were instantiated. Each element of the
array is a char* which is the LOID of one object created.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing each LOID in the array as well as the array itself.

char**
ScheduledCreateRestricted(int NumObjects,
LegionIdType CIDType, char *ClassName,
LegionIdType HIDType, char *HostName,
LegionIdType VIDType, char *VaultName
LegionIdType IIDType, char *ImplName,
LegionIdType SIDType, char *SchedName
);

Create a vector of new Legion objects by vector instantiating the given class. The user also indicates any combination of restrictions which may include restrictions to hosts, vaults or implementations. This command also uses the given scheduler to schedule the instantiation.

Parameters:
NumObjects = Number of object to vector instantiate.
CIdType = Flag indicating whether the ClassName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the class to instantiate.
HIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
HostName = LOID or context path name of the Host to restrict the instantiation to.
VIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
VaultName = LOID or context path name of the Vault to which the instantiation is restricted.
IIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
ImplName = LOID or context path name of the Implementation which the instantiation is restricted.
SIdType = Flag indicating whether the SchedName parameter is a context path name or a LOID.
ImplName = LOID or context path name of the Scheduler to use when scheduling the instantiation.

Return Values:
NULL terminated array of LOIDs indicating the objects that were instantiated. Each element of the
array is a char* which is the LOID of one object created.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing each LOID in the array as well as the array itself.

char**
ComplxCreateRestricted(int NumObjects,
LegionIdType CIDType, char *ClassName,
LegionIdType HIDType, char **HostName,
LegionIdType VIDType, char **VaultName,
LegionIdType IIDType, char **ImplName
);

Create a vector of new Legion objects by vector instantiating the given class. The user also indicates any combination of restrictions which may include restrictions to hosts, vaults or implementations.

Parameters:
NumObjects = Number of object to vector instantiate.
CIdType = Flag indicating whether the ClassName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the class to instantiate.
HIdType = Flag indicating whether the HostName parameter is a NULL terminated list of context
path names or a NULL terminated list of LOIDs.
HostName = NULL terminated array of LOIDs or context path names of the Hosts to which the
instantiation is limited.
VIdType = Flag indicating whether the VaultName parameter is a NULL terminated list of context
path names or a NULL terminated list of LOIDs.
VaultName = NULL terminated array of LOIDs or context path names of the Vaults to which the
instantiation is restricted.
IIdType = Flag indicating whether the ImplName parameter is a NULL terminated list of context
path names or a NULL terminated list of LOIDs.
ImplName = NULL terminated array of LOIDs or context path names of the Impls to which the
instantiation is restricted.

Return Values:
NULL terminated array of LOIDs indicating the objects that were instantiated. Each element of the
array is a char* which is the LOID of one object created.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing each LOID in the array as well as the array itself.

char**
ComplxScheduledCreateRestricted(int NumObjects,
LegionIdType CIDType, char *ClassName,
LegionIdType HIDType, char **HostName,
LegionIdType VIDType, char **VaultName,
LegionIdType IIDType, char **ImplName,
LegionIdType SIDType, char *SchedName
);

Create a vector of new Legion objects by vector instantiating the given class. The user also indicates any combination of restrictions which may include restrictions to hosts, vaults or implementations. In addition, the user may specify a scheduler to use for the instantiation

Parameters:
NumObjects = Number of object to vector instantiate.
CIdType = Flag indicating whether the ClassName parameter is a context path name or a LOID.
ClassName = LOID or context path name of the class to instantiate.
HIdType = Flag indicating whether the HostName parameter is a NULL terminated list of context
path names, or a NULL terminated list of LOIDs.
HostName = NULL terminated array of LOIDs or context path names of the Hosts to which the
instantiation is restricted.
VIdType = Flag indicating whether the VaultName parameter is a NULL terminated list of context
path names, or a NULL terminated list of LOIDs.
VaultName = NULL terminated array of LOIDs or context path names of the Vaults to which the
instantiation is restricted.
IIdType = Flag indicating whether the ImplName parameter is a NULL terminated list of context
path names, or a NULL terminated list of LOIDs.
ImplName = NULL terminated array of LOIDs or context path names of the Impls to which the
instantiation is restricted.
SIdType = Flag indicating whether the SchedName parameter is a context path name or a LOID.
SchedName = Context path name or LOID of the scheduler to use when instantiating the class.

Return Values:
NULL terminated array of LOIDs indicating the objects that were instantiated. Each element of the
array is a char* which is the LOID of one object created.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing each LOID in the array as well as the array itself.

int
Activate(LegionIdType IType, char *ObjectName);

Activate an inert Legion object.

Parameters:
IdType = Flag indicating whether the ObjectName
ObjectName = LOID or context path name of the object to activate.

Return Values:
1 on Success
0 on failure

User Responsibility: None

int
ScheduledActivate(LegionIdType OIDType, char *ObjectName,
LegionIdType SIDType, char *SchedName
);

Activate an inert Legion object (using the indicated scheduler to schedule the activation).

Parameters:
OIDType = Flag indicating whether the ObjectName parameter is a context path name or a LOID.
ObjectName = LOID or context path name of the object to activate.
SIdType = Flag indicating whether the SchedName parameter is a context path name or a LOID.
SchedName = LOID or context path name of the scheduler to use when doing the activation.

Return Values:
1 on Success
0 on failure

User Responsibility: None

int
ActivateRestricted(LegionIdType OIDType, char *ObjectName,
LegionIdType HIDType, char *HostName,
LegionIdType VIDType, char *VaultName,
LegionIdType IIDType, char *ImplName
);

Activate an inert Legion object, but subject to the restrictions indicated by the user.

Parameters:
OIDType = Flag indicating whether the ObjectName parameter is a context path name or a LOID.
ObjectName = LOID or context path name of the object to activate.
HIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
HostName = LOID or context path name of the Host to which the activation is restricted.
VIDType = Flag indicating whether the VaultName parameter is a context path name or a LOID.
VaultName = LOID or context path name of the Vault to which the activation is restricted.
IIDType = Flag indicating whether the ImplName parameter is a context path name or a LOID.
ImplName = LOID or context path name of the Impl to which the activation is restricted.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
ScheduledActivateRestricted(
LegionIdType OIDType, char *ObjectName,
LegionIdType HIDType, char *HostName,
LegionIdType VIDType, char *VaultName,
LegionIdType IIDType, char *ImplName,
LegionIdType SIDType, char *SchedName
);

Activate an inert Legion object, but subject to the restrictions indicated by the user. Also, use the indicated scheduler to schedule the activation.

Parameters:
OIDType = Flag indicating whether the ObjectName parameter is a context path name or a LOID.
ObjectName = LOID or context path name of the object to activate.
HIdType = Flag indicating whether the HostName parameter is a context path name or a LOID.
HostName = LOID or context path name of the Host to which the activation is restricted.
VIDType = Flag indicating whether the VaultName parameter is a context path name or a LOID.
VaultName = LOID or context path name of the Vault to which the activation is restricted.
IIDType = Flag indicating whether the ImplName parameter is a context path name or a LOID.
ImplName = LOID or context path name of the Impl to which the activation is restricted.
SIDType = Flag indicating whether the SchedName parameter is a context path name or a LOID.
SchedName = LOID or context path name of the Scheduler to use when doing the activation.

Return Values:
1 on Success
0 on failure

User Responsibility: None

int
ComplxActivateRestricted(
LegionIdType OIDType, char *ObjectName,
LegionIdType HIDType, char **HostName,
LegionIdType VIDType, char **VaultName,
LegionIdType IIDType, char **ImplName
);

Activate an inert Legion object, but subject to the restrictions indicated by the user.

Parameters:
OIDType = Flag indicating whether the ObjectName parameter is a context path name or a LOID.
ObjectName = LOID or context path name of the object to activate.
HIdType = Flag indicating whether the HostName parameter is a list of context path names or
LOIDs.
HostName = A NULL terminated array of LOIDs or context path names of Hosts to which the
activation is restricted.
VIdType = Flag indicating whether the VaultName parameter is a list of context path names or
LOIDs.
VaultName = A NULL terminated array of LOIDs or context path names of Vaults to which the
activation is restricted.
IIdType = Flag indicating whether the ImplName parameter is a list of context path names or
LOIDs.
ImpleName = A NULL terminated array of LOIDs or context path names of Implementations to
which the activation is restricted.

Return Values:
1 on Success
0 on failure

User Responsibility: None

int
ComplxScheduledActivateRestricted(
LegionIdType OIDType, char *ObjectName,
LegionIdType HIDType, char **HostName,
LegionIdType VIDType, char **VaultName,
LegionIdType IIDType, char **ImplName,
LegionIdType SIDType, char *SchedName
);

Activate an inert Legion object, but subject to the restrictions indicated by the user and using the given scheduler.

Parameters:
OIDType = Flag indicating whether the ObjectName parameter is a context path name or a LOID.
ObjectName = LOID or context path name of the object to activate.
HIdType = Flag indicating whether the HostName parameter is a list of context path names or
LOIDs.
HostName = A NULL terminated array of LOIDs or context path names of Hosts to which the
activation is restricted.
VIdType = Flag indicating whether the VaultName parameter is a list of context path names or
LOIDs.
VaultName = A NULL terminated array of LOIDs or context path names of Vaults to which the
activation is restricted.
IIdType = Flag indicating whether the ImplName parameter is a list of context path names or
LOIDs.
ImpleName = A NULL terminated array of LOIDs or context path names of Implementations to
which the activation is restricted.
SIDType = A flag indicating whether the SchedName parameter is a context path name or a LOID.
SchedName = A context path name or LOID indicating the scheduler to use when doing the
activation.

Return Values:
1 on Success
0 on failure

User Responsibility: None

int
DeleteObject(LegionIdType IdType, char *ObjName);

Deletes or Destroys a given object by asking its class to get destroy it. This function is identical to DestroyObject

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
Name = Either the context path name or the LOID of the object to delete.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
DestroyObject(LegionIdType IdType, char *ObjName);

Deletes or Destroys a given object by asking its class to get destroy it. This function is identical to DeleteObject

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
Name = Either the context path name or the LOID of the object to destroy.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
DeactivateObject(LegionIdType IdType, char *ObjName);

Deactivates a given object.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
Name = Either the context path name or the LOID of the object to deactivate.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
ForcedDeactivateObject(LegionIdType IdType, char *ObjName);

Deactivates a given object. The forced in this call means that if the object is going up or going down, then an error is returned.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
Name = Either the context path name or the LOID of the object to deactivate.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
GetObjectType(LegionIdType IdType, char *ObjName);

Returns an integer which indicates as specifically as possible what type of object the user is talking about.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path.
ObjName = Either the context path name or the LOID of the object to be described.

Return Values:
Returns an integer indicating the type of the object (from the list above).

User Responsibility: None


#define	LEGION_OBJ_CONTEXT			1	/* These constants are used	*/
#define	LEGION_OBJ_FILE			2	/* to indicate what type of	*/
#define	LEGION_OBJ_RUNNABLE			3	/* object one is talking	*/
#define	LEGION_OBJ_CLASS			4	/* about. These are the 	*/
#define	LEGION_OBJ_HOST			5	/* values that can be 	*/
#define	LEGION_OBJ_VAULT			6	/* by GetObjectType().	*/
#define	LEGION_OBJ_TTY				7
#define	LEGION_OBJ_IMPLEMENTATION		8
#define	LEGION_OBJ_IMPLEMENTATION_CACHE	9
#define	LEGION_OBJ_LEGION_CLASS		10
#define	LEGION_OBJ_BINDING_AGENT		11
#define	LEGION_OBJ_MPI				12
#define	LEGION_OBJ_PVM3			13
#define	LEGION_OBJ_UNKNOWN			14

int
isContext(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a context object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a context
0 if the object is not a context

User Responsibility: None

int
isFile(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a File object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a File
0 if the object is not a File

User Responsibility: None

int
isRunnable(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a Runnable object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = Either the context path name or the LOID of the object to test.

Return Values:
1 if the object is a Runnable
0 if the object is not a Runnable

User Responsibility: None

int
isClass(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a Class object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a Class
0 if the object is not a Class

User Responsibility: None

int
isHost(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a Host object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a Host
0 if the object is not a Host

User Responsibility: None

int
isVault(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a Vault object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a Vault
0 if the object is not a Vault

User Responsibility: None

int
isTTY(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a TTY object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a TTY
0 if the object is not a TTY

User Responsibility: None

int
isImplementation(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a Implementation object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a Implementation
0 if the object is not a Implementation

User Responsibility: None

int
isImplementationCache(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a ImplementationCache object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a ImplementationCache
0 if the object is not a ImplementationCache

User Responsibility: None

int
isLegionClass(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a LegionClass object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a LegionClass
0 if the object is not a LegionClass

User Responsibility: None

int
isBindingAgent(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a BindingAgent object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a BindingAgent
0 if the object is not a BindingAgent

User Responsibility: None

int
isMPI(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a MPI object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a MPI
0 if the object is not a MPI

User Responsibility: None

int
isPVM3(LegionIdType IdType, char *ObjName);

Determines if the indicated object is a PVM3 object or not.

Parameters:
IdType = Flag indicating whether parameter is a LOID or a context path name.
ObjName = The context path name or the LOID of the object to test.

Return Values:
1 if the object is a PVM3
0 if the object is not a PVM3

User Responsibility: None

Directory of Legion 1.8 Manuals
[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]

Free JavaScripts provided by The JavaScript Source

legion@Virginia.edu
http://legion.virginia.edu/