
Below we provide selected parts of the interface from selected objects that make up the Legion Library implementation.
| Parameters: | UVaL_Reference<LegionInvocation> |
Add an invocation to the program graph. Returns the invocation if successful, NULL if not.
| Parameters: | UVaL_Reference<LegionInvocation> target
UVaL_Reference<LegionParameter> parameter int parameter_number |
Adds the given parameter to the specified invocation as the `parameter_number'th parameter. The parameter is a LegionParameter, which means that it contains an already computed value. The other possible is that it is an invocation parameter. This means that the parameter itself is a LegionInvocation, thus representing a computation that has yet to be performed.
| Parameters: | UVaL_Reference<LegionInvocation> source
UVaL_Reference<LegionInvocation> target int source_parameter_number int target_parameter_number |
Adds the given source parameter as a parameter to the given target parameter. This call creates what is called a LegionContinuation, and adds the continuation to the continuation list for the source parameter. When an invocation request is eventually executed, the invokee must know where to send the results of the execution. Each LegionContinuation identifies a destination LOID to which a result should be sent.
| Parameters: | UVaL_Reference<LegionInvocation> source
int parameter_number |
The current implementation always sends the return value of a method request back to the invoker. If the invoker wishes to receive other result values that e.g. might correspond to in/out parameters to the method invocation, then those values must be explicitly asked for using add_result_dependency. This call then creates a LegionContinuation corresponding to the requested parameter.
| Parameters: | UVaL_Reference<LegionInvocation> inv
int parameter_number |
Gets the specified return value for the given LegionInvocation out of the program graph. This is essentially a call through the program graph to the underlying message database. If the result is not available, get_value blocks until it is. A LegionBuffer is returned.
| Parameters: | int func_num
int priority |
Enables the supplied function so that the LIS will accept method requests for it. Method requests for disabled functions are not accepted. High values for priority mean high priority.
| Parameters: | int func_num; |
Check to see if any method requests for the given function are ready.
| Parameters: | UVaL_Reference<LegionWorkUnit> new_work_unit |
Insert the provided work unit into the invocation store. This work unit may be a method request or it may be a result from a previous method invocation.
| Parameters: | UVaL_Reference<LegionComputationTag> tag
int parameter_number |
Returns the work unit with the given tag and parameter number. Typically, this function is called by a higher layer (e.g. LegionProgramGraph) which will unwrap the returned work unit to get the parameter inside.
| Parameters: | None |
The default constructor is for the common case; it creates an empty buffer with a LegionStorageScat storage, and default implementations of the packer, compressor, and encryptor function sets.
| Parameters: | UVaL_Reference<LegionStorage> |
The simple constructor wraps a default buffer around a given storage object. It uses default implementations for the packer, encryptor, and compressor.
A LegionStorage exports member functions to read and write untyped characters from and to a logical buffer. These operations are also exported by LegionBuffer, but the user should be warned that the "better" way to put data into a buffer is through the LegionPacker interface; read() and write() will not perform appropriate data format conversions, but put_int() and get_int() will.
| Parameters: | size_t num_bytes
void *data |
Reads num_bytes bytes from the buffer starting at the current location of the buffer pointer. Copies the bytes into the space pointed to by data_dest. Returns the number of bytes actually read, and positions the buffer pointer immediately after the last byte that was read. Read() will not read past the end of the buffer.
| Parameters: | size_t num_bytes
void *data |
Writes num_bytes bytes pointed to by data into the buffer starting at current position of the buffer pointer (overwriting existing data). Returns the number of bytes actually written, and positions the buffer pointer immediately after the last byte that was written. Writing past the end of the buffer causes it to expand.
| Parameters: | seek_start whence
int bytes_away |
Changes the position of the buffer pointer. "Whence " can be BEGINNING (0), CURRENT (1), or END (2), and bytes_away tells how many bytes away from whence to set the pointer. Seeking past the end of the buffer causes it to expand and to be filled with NULL bytes. Seeking to negative logical positions the buffer does not cause the buffer to expand; the buffer pointer is placed at logical position 0.
| Parameters: | None |
Returns the number of the byte to which the buffer pointer currently points. Current_byte() returns 0 when the buffer pointer is at the beginning of the buffer, and current_byte() == size() when the buffer pointer is at the end of the buffer.
| Parameters: | int pack_metadata=0 |
Returns a pointer to the beginning of the buffer's data. This pointer is guaranteed to point to data that is contiguous in memory. Depending on the implementation of the LegionStorage, this function may or may not need to return a pointer to a copy of the data.
A LegionPacker exports operations for packing and unpacking the basic C++ data types into and out of a LegionBuffer in a particular data format. A LegionPacker exports put_ZZZ() and get_ZZZ() for all ZZZ in {char, short, ushort, int, long, ulong, float, double}.
| Parameters: | ZZZ *source
int how_many |
Assumes that source points to an array of how_many instances of type ZZZ. Copies this data into the buffer after first performing the appropriate data conversion operation if necessary and appropriate for the type of LegionPacker that is instantiated.
| Parameters: | ZZZ *source
int how_many |
Assumes that source points to enough space for an array of how_many instances of type ZZZ. Copies the next data from the LegionBuffer into this space after first performing the appropriate data conversion operation if necessary and appropriate for the type of LegionPacker that is instantiated.
LegionLOID is intended to be a base class for LOID's that enforce a particular structure on the fields of the LOID. An LOID contains four private data members, (1) an integer that holds the type of LOID, (2) an integer that indicates how many fields the LOID contains, (3) an array field_size[] of integers that holds the sizes in bytes of the LOID fields, and (4) an array field_value[] of pointers to the field data. Currently, the only derived class is called LegionGeneralPurposeLOID, which simply exposes the protected members to the public interface.
| Parameters: | int ltype,
short nfields |
Sets the type to ltype. Sets num_fields to nfields. Allocates the field_size[] and field_value[] arrays. Sets all field_size[]'s to 0 , sets all field_value[]'s to NULL.
| Parameters: | int ltype,
short nfields, short *fld_size |
Sets the type to ltype. Sets num_fields to nfields. Allocates the field_size[] and field_value[] arrays. Sets all field_size[]'s to the values contained in the fld_size[] array. Allocates the field_value[] entries to the right size and zeros them out. This constructor assumes the fld_size array has at least nfields elements.
| Parameters: | int ltype
short nfields short *fld_size char **fld_value |
Sets the type to ltype. Sets num_fields to nfields. Allocates the field_size[] and field_value[] arrays. Sets all field_size[]'s to the values contained in the fld_size[] array. Allocates the field_value[] entries to the right size and copies the values from fld_value[] array into the field_value[] array. This constructor assumes that the fld_size[] and fld_value[] arrays have at least nfields elements, and that each fld_value[i] points to at least fld_size[i] bytes of space.
| Parameters: | short field_num
short fsize |
Sets the appropriate field_size element to fsize and makes sure that the corresponding field_value element is at least fsize bytes. If it is not, it deletes the old field_value entry and allocates a new one. Only derived classes should be allowed to call this member.
| Parameters: | int new_type |
Sets the type entry to be new_type. Can only be called from within the code of derived classes.
| Parameters: | LegionBuffer &lb
LegionLOID() Parameters: | LegionLOID &otherLOID |
These two constructors are public because neither allows the caller to violate the structure of any particular type of LOID--both just copy the LOID from the parameter, either a LegionBuffer or another LegionLOID.
| Parameters: | None |
Not a very useful constructor, so it prints a warning and assigns all data members to zero. Useful constructors should at least say what the type is.
Methods for getting and setting the type and all field values, by field number and field name, exist.
The ==, !=, and = operators are overloaded appropriately. An LOID is equal to another only if all fields are identical in size and value.
| Parameters: | None |
Returns 1 only if the LOID is of type UVaL_LegionLOID_type_EMPTY (zero).
| Parameters: | None |
Returns 1 only if the LOID seems to refer to a class object, i.e. the instance number field is empty.
| LegionBuffer &lb |
Type and num_fields are packed first, in network order. Next num_fields shorts are packed, in network order. Next, num_fields values are packed.
The LegionMessage constructor creates a LegionMessage from the constituent parts passed as parameters.
LegionMessage exports public member functions to get and set all of its constituent parts.
| Parameters: | int param_number
UVaL_Reference<LegionBuffer> lb |
Constructs a new parameter whose value is assumed to be in lb, and whose number is set to param_number.
The default constructor creates a parameter with a negative parameter number and an empty LegionBuffer. A constructor that takes only a LegionBuffer as a parameter unpacks the contents of the LegionParameter from that buffer. The copy constructor is also overloaded.
LegionParameter exports public member functions to get and set both the parameter number and the buffer that contains the value of the parameter.
The default constructor creates an empty parameter list, and a constructor that takes a LegionBuffer as an argument unpacks the contents of the LegionParameterList from that buffer.
LegionParameterList is derived from templated class UVaL_PackableSet_LinkedList, and therefore exports the full interface of UVaL_PackableSet.
LegionComputationTag simply maintains a glorified interface to a long integer. The Library also contains a class--LegionComputationTagGenerator--that creates random computation tags. See the source code or on-line documentation for a description of that class.
The default constructor creates a LegionComputationTag with an uninitialized initial value. A constructor that takes a LegionBuffer as an argument unpacks the contents of the computation tag from that buffer.
A LegionMessage also contains a LegionContinuationList, and a LegionEnvironment. A LegionContinuationList is simply a UVaL_PackableSet of LegionContinuations, and a LegionEnvironment is a UVaL_PackableSet of LegionEnvironmentItems. Please refer to the on-line documentation and source code for the interface to these classes.

Back to Reference Manual Table of Contents