US20040221276A1 - Method and computer program for data conversion in a heterogeneous communications network - Google Patents
Method and computer program for data conversion in a heterogeneous communications network Download PDFInfo
- Publication number
- US20040221276A1 US20040221276A1 US10/860,838 US86083804A US2004221276A1 US 20040221276 A1 US20040221276 A1 US 20040221276A1 US 86083804 A US86083804 A US 86083804A US 2004221276 A1 US2004221276 A1 US 2004221276A1
- Authority
- US
- United States
- Prior art keywords
- data structure
- data
- program
- embedded
- byte
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/76—Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
- G06F7/768—Data position reversal, e.g. bit reversal, byte swapping
Definitions
- the invention relates to a method and computer program for data conversion in a heterogeneous communications network. More particularly, the present invention converts data for computer systems having different data storage architectures so that these computer systems may simply and easily communicate over a network.
- Examples of differing processor and memory architectures may be seen in big endian versus little endian architectures.
- a big endian architecture the most significant byte is placed in a lower memory address. This is typically the way humans deal with arithmetic functions and the method employed by a MotorolaTM 680 ⁇ 0 system.
- There is also a little endian architecture in which the least significant byte is placed in a lower memory address. This is done since numbers are calculated by a processor starting with least significant digits and little endian data structures are already set up to facilitate this operation.
- This type of little endian architecture is employed by the IntelTM ⁇ 86 line of systems.
- a bi-endian machine has been developed, such as the PowerPCTM, which can handle both types of byte ordering.
- FIG. 1 is an example of an overall InfiniBand systems diagram
- FIG. 2 is an example of a InfiniBand subnet management packet (SMP) header
- FIG. 3 is a flowchart of the logic used to create an InfiniBand subnet management packet (SMP) header data structure in the example embodiments of the present invention
- FIG. 4 is a flowchart of a compiler expansion of embedded macros used to create the SMP header data structure in the embodiments of the present invention.
- FIG. 5 is a flowchart of the logic involved in converting data used in the example embodiments of the present invention.
- FIG. 1 is an example of an overall InfiniBand systems diagram which may be used by the embodiments of the present invention.
- Using such an InfiniBand architecture it may be possible to link together a processor based system 10 , through switches 50 to several Input/Output (I/O) controllers 70 , and other processor based systems 20 , 30 and 40 .
- Each processor based system 10 , 20 , 30 and 40 may be composed of one or more central processing units (CPU) (not shown), dynamic random access memory (DRAM) (not shown), memory controller (not shown) and a channel adapter 60 .
- a switch 50 may be used to interconnect serial ports to achieve transfer rates of more than one gigabit-per-second.
- the InfiniBand architecture defines interfaces that move data between two “memory” regions or nodes. Access to an I/O controller 70 and processor based system 10 , 20 , 30 and 40 , may be accomplished by send or receive operations, as well as, remote direct memory access (RDMA) read and RDMA write operations.
- Cluster or channel adapters provide the control and logic that allows nodes to communicate to each other over the InfiniBand network.
- a processor based system 10 , 20 , 30 or 40 may have one or more channel adapters 60 connected to it.
- an I/O controller 70 may have one or more channel adapters 60 connected to it. Communications in an InfiniBand architecture may be accomplished through these cluster or channel adapters 60 directly or through switches 50 .
- the InfiniBand architecture enables redundant communications links between channel adapters 60 and switches 50 . Further, it may be possible to create a routing and distance table to identify the shortest paths between nodes in the network. In this case, distance is defined as being the shortest time between to points and not the physical distance.
- a node or cluster adapter may be a channel adapter 60 . Therefore, when data is sent to a memory location in a node it will take the shortest path available and arrive as fast as possible. However, if a failure occurs to a switch 50 then an alternate path may have to be configured and the distance table would have to be computed again.
- FIG. 2 is an example of an InfiniBand subnet management packet (SMP) header 200 .
- SMP subnet management packet
- Each InfiniBand architecture is divided into subnets having at least one subnet manager (SM).
- SM may reside on a switch 50 and is responsible for configuring the subnet.
- Communications between the SM and other subnet management agents (SMA) is done through subnet management packet (SMP). Therefore, whenever a computer resides on the subnet it is necessary to be able to reformat data so that it meets the requirements of either big endian or little endian data format. This also applied to the SMP header 200 illustrated in FIG. 2.
- the SMP header 200 illustrated in FIG. 2 is composed of several 64-bit fields.
- the SMP header 200 defines the base version which is a one byte field indicating the version of management datagram based format.
- a one byte field for management class is provided which represents a subnet management class value.
- a one byte field for class version is provided which indicates the version field for the management class.
- a one bit field R is provided to indicate a request/response field.
- a 7 bit field is provided for method representing the method of subset management being used.
- a two byte status field is provided which encodes the status of the method.
- a hop pointer is provided to indicate the current byte of the initial/return path field.
- a hop counter is used to contain the number of valid bites in the initial/return that indicates how many direct route hops to take.
- a transaction identification (ID) is provided indicative of a transaction specific identifier.
- a 2 byte attribute identification (ID) is provided indicating the attributes for the SMP.
- Attributes for SMP's are typically data objects that are composite structures having registers in subnet nodes and these attributes may be read or written.
- the SMP method uses the attribute ID and attribute modifier to re-define or modify specific registers within a given node. Thereafter, two additional bytes are reserved for future use.
- an attribute modifier having four bytes is provided for an SMP to use as the index value to further specify data to be obtained or modified.
- a management key (M_KEY) having eight bytes is provided for SMP authentication.
- SLID source local identifier
- DLID destination local identifier
- FIGS. 3 through 5 are flowcharts representing the logic employed by the example embodiments of the present invention.
- the blocks illustrated in FIGS. 3 through 5 represent modules, code, code segments, commands, firmware, hardware, instructions and data that are executable by a processor-based system(s) and may be written in a programming language, such as, but not limited, to C++.
- FIG. 3 is a flowchart of the logic used to create an InfiniBand subnet management packet (SMP) header 200 , shown in FIG. 2, data structure in the example embodiments of the present invention.
- the logic shown in FIG. 3 may be implemented in the sample C++ program illustrated in Table 1 provided ahead. It should be noted that the C++ program illustrated in Table 1 is provided by way of example only and as one of ordinary skill in the art would appreciate this program may be implemented using any language and different commands.
- execution begins in operation 300 where the variables are set to byte positions of the subnet management packet (SMP) header 200 , shown in FIG. 2. Thereafter, processing proceeds operation 305 where it is determined if the little endian byte order is desired. If little endian byte order is desired processing proceeds operation 310 where bits 0 through 6 of byte three are stored in an eight-bit variable. Thereafter, processing proceeds to operation 315 where the highest bit of byte three is stored into bit 7 of the of the eight-bit variable. However, if in operation 305 it is determined that little endian byte order is not desired then processing proceeds to operation 320 where the highest bit of byte three is stored into bit zero of the eight-bit variable. Processing then proceeds to operation 325 where bits 0 through 6 of byte 3 are stored into bits 1 through 7 of the eight-bit variable.
- SMP subnet management packet
- processing proceeds to operation 330 where the eight-bit variable determined in operation 310 through 325 is stored as sbyte 3 . Thereafter, processing proceeds to operation 335 where again it is determined if little endian byte order is desired. If little endian byte order is desired then processing proceeds to operation 340 where the first 15 bits of bytes 4 and 5 are stored in a variable. Thereafter in operation 345 bit 31 of byte 5 is stored into bit 15 of the variable. However, if in operation 335 it is determined that little endian byte order is not desired then processing proceeds to operation 350 . In operation 350 , bit 31 of byte 5 is stored into bit 15 of a variable. In operation 355 the first 15 bits of bytes 4 and 5 are stored in the variable. Regardless of whether little endian byte order is desired in operation 335 , in operation 360 , the remaining portion of the SMP header 200 data structure is defined.
- FIG. 4 is a flowchart of a compiler expansion of embedded macros used to create the SMP header 200 data structure in the embodiments of the present invention.
- the processes shown in FIG. 4 compile the embedded macros and code contained in Table II discusses further detail ahead.
- the operations shown in FIG. 4 begin in operation 400 by executing a standard C++ compiler. Thereafter, in operation 410 , the C++ compiler expands embedded macros shown in Table I which define the data structure for the SMP header 200 shown in Table I. These embedded macros takes the place of the logic shown and discussed in reference to FIG. 3.
- the embedded macros create the SMP header 200 data structure as shown and discussed in FIG. 3.
- the advantage of using the embedded macros shown in Table II and compiled in operation 410 is that the data structure is generated during compilation rather than during execution.
- the savings in terms of processor power is enormous when the data structure can be generated during compilation time which is in constant usage by application programs.
- these embedded macros may be incorporated in every application program that utilizes the SMP header 200 .
- the C++ compiler compiles the function swap contents shown in Table III.
- Table III is an example of the expansion of the embedded macros illustrated in Table II and executed in operation 410 . This expansion is only for the data structure referred to as “define _struct _start” and is only provided by way of example. As would be appreciated by one of ordinary skill in the art, the expansion of the macros performed by the compiler is three levels deep and further expansion in Table III is not required. It should be again noted that the expansion of the data structure is accomplished by the C++ compiler rather than during program execution as illustrated in FIG. 3. TABLE III // Expanded form after pre-compilation.
- swap_struct_t swap_SMP_DIR_HDR[] // Defined by DEFINE_STRUCT_START ⁇ ⁇ 2, 4 ⁇ , // sbyte4: size 2, offset 4 ⁇ 8, 8 ⁇ , // transaction id: size 8, offset 8 ⁇ 2, 16 ⁇ ,// attribute_id: size 2, offset 16 ⁇ 4,20 ⁇ ,// attribute mod: size 4, offset 20 ⁇ 8,24 ⁇ ,// m_key: size 8, offset 24 ⁇ 2,32 ⁇ ,/// slid: size 2, offset 32 ⁇ 2,34 ⁇ ,/// dlid: size 2, offset 34 ⁇ 0,0 ⁇ // placed by DEFINE_STRUCT_END ⁇ ;
- FIG. 5 is a flowchart of the logic involved in converting data used in the example embodiments of the present invention as performed by the swap_contents function module.
- the swap_contents function module begins execution in operation 500 where a variable I is set to zero.
- operation 520 it is determined if the size of the swap structure variable is equal to two bytes. If the swap structure variable has a size equal to two bytes then processing proceeds to operation 530 .
- operation 530 the swap function is called and passed a 16-bit variable and pointer to every 16 bits. Thereafter, processing loops back to operation 510 from operation 530 .
- operation 520 if the size of the swap structure variable is not two bytes then processing proceeds to operation 550 .
- operation 550 it is determined whether the swap structure variable has a size equal to 4 bytes. If the swap structure variable has a size equal to 4 bytes then processing proceeds to operation 540 .
- operation 540 the swap function is called and passed a 32-bit variable and a pointer to every 32 bits. Thereafter, processing loops back from operation 540 to operation 510 .
- operation 550 if the size of the swap variable is not equal to four bytes in length then processing proceeds to operation 560 .
- operation 560 it is determined if the size of the swap structure variable is equal to 8 bytes in length. If the size of the swap structure variable is equal to 8 bytes in length, then processing proceeds to operation 570 .
- operation 570 the swap function is called and passed a 64-bit variable and pointers to every 64 bits. Thereafter, processing loops back to operation 510 from operation 570 .
- processing proceeds to operation 580 .
- operation 580 it is determined whether the size swap structure variable is equal to 16 bytes in length. If the swap structure variable is equal to 16 bytes in length then processing proceeds to operation 585 .
- operation 585 the swap function is called and passed a 128 bit variable with a pointer to every 128 bits. Thereafter, processing loops back to operation 510 from operation 585 .
- processing proceeds to operation 590 and processing terminates.
- the benefit resulting from the present invention is that a simple, reliable, fast method and computer program is provided that will convert from little endian data format to big endian data format and back again.
- the data structure required to accomplish this is generated using embedded macros during compilation. Therefore, no runtime processing power is wasted creating the data structure for each application. This allows for extremely fast execution of the conversion.
Abstract
A method and computer program for data conversion in a heterogeneous communications network. This method and computer program converts data for computer systems having different data storage architectures so that these computer systems may simply and easily communicate over a network. This is most useful when converting data store in little endian and big endian format. This method relies on creating the data structure used to convert the data using embedded macros that are not executed at run time. These embedded macros are expanded by the compiler to generate the data structure and thereby saves substantial time during execution.
Description
- The invention relates to a method and computer program for data conversion in a heterogeneous communications network. More particularly, the present invention converts data for computer systems having different data storage architectures so that these computer systems may simply and easily communicate over a network.
- In the rapid development of computers many advancements have been seen in the areas of processor speed, throughput, communications, and fault tolerance. Initially computer systems were standalone devices in which a processor, memory and peripheral devices all communicated through a single bus. Later, in order to improve performance, several processors and were interconnected to memory and peripherals using one or more buses. In addition, separate computer systems were linked together through different communications mechanisms such as, shared memory, serial and parallel ports, local area networks (LAN) and wide area networks (WAN). However, these mechanisms have proven to be relatively slow and subject to interruptions and failures when a critical communications component fails. Further, in the case where a high speed direct memory access communications method is used, all to often these communications systems are limited in the types of computers that may access and exchange information on the network.
- Examples of differing processor and memory architectures may be seen in big endian versus little endian architectures. In a big endian architecture the most significant byte is placed in a lower memory address. This is typically the way humans deal with arithmetic functions and the method employed by a Motorola™ 680×0 system. There is also a little endian architecture in which the least significant byte is placed in a lower memory address. This is done since numbers are calculated by a processor starting with least significant digits and little endian data structures are already set up to facilitate this operation. This type of little endian architecture is employed by the Intel™ ×86 line of systems. In addition, a bi-endian machine has been developed, such as the PowerPC™, which can handle both types of byte ordering.
- However, when a big endian machine and a little endian machine attempt to communicate through memory reads and writes to each other, the data must be re-formatted to be accessible by the other machine. In order to accomplish this programmer's have developed code that swaps bits and bytes of data within words being accessed. However, this development of code by different programmers is time-consuming and prone to error. Further, this code is often specific to each specific application generated. Therefore, one of the purposes of direct memory access for communications is defeated by the lengthy time requirements for this conversion process. Also, time involved in developing and debugging software for each application may be substantial and thus expensive.
- Therefore, what is needed is a method and computer program which will create a data structure to enable the conversion from one memory storage format to another. This method and computer program must be generally applicable to all applications programs and all types of data. This method and computer program must also be efficient in the generation of the data structure and the re-formatting of the data. Thus, this method and computer program must be easily usable by all applications and programmers and must execute in run-time very quickly so as to facilitate the rapid exchange of information.
- The foregoing and a better understanding of the present invention will become apparent from the following detailed description of exemplary embodiments and the claims when read in connection with the accompanying drawings, all forming a part of the disclosure of this invention. While the foregoing and following written and illustrated disclosure focuses on disclosing example embodiments of the invention, it should be clearly understood that the same is by way of illustration and example only and the invention is not limited thereto. The spirit and scope of the present invention are limited only by the terms of the appended claims.
- The following represents brief descriptions of the drawings, wherein:
- FIG. 1 is an example of an overall InfiniBand systems diagram;
- FIG. 2 is an example of a InfiniBand subnet management packet (SMP) header;
- FIG. 3 is a flowchart of the logic used to create an InfiniBand subnet management packet (SMP) header data structure in the example embodiments of the present invention;
- FIG. 4 is a flowchart of a compiler expansion of embedded macros used to create the SMP header data structure in the embodiments of the present invention; and
- FIG. 5 is a flowchart of the logic involved in converting data used in the example embodiments of the present invention.
- Before beginning a detailed description of the subject invention, mention of the following is in order. When appropriate, like reference numerals and characters may be used to designate identical, corresponding or similar components in differing figure drawings. Further, in the detailed description to follow, exemplary sizes/models/values/ranges may be given, although the present invention is not limited to the same. As a final note, well-known components of computer networks may not be shown within the FIGS. for simplicity of illustration and discussion, and so as not to obscure the invention.
- FIG. 1 is an example of an overall InfiniBand systems diagram which may be used by the embodiments of the present invention. Using such an InfiniBand architecture it may be possible to link together a processor based
system 10, throughswitches 50 to several Input/Output (I/O)controllers 70, and other processor basedsystems system channel adapter 60. Aswitch 50 may be used to interconnect serial ports to achieve transfer rates of more than one gigabit-per-second. - Referring to FIG. 1, the InfiniBand architecture defines interfaces that move data between two “memory” regions or nodes. Access to an I/
O controller 70 and processor basedsystem system more channel adapters 60 connected to it. Further, an I/O controller 70 may have one ormore channel adapters 60 connected to it. Communications in an InfiniBand architecture may be accomplished through these cluster orchannel adapters 60 directly or throughswitches 50. - As can be seen in FIG. 1, the InfiniBand architecture enables redundant communications links between
channel adapters 60 and switches 50. Further, it may be possible to create a routing and distance table to identify the shortest paths between nodes in the network. In this case, distance is defined as being the shortest time between to points and not the physical distance. A node or cluster adapter may be achannel adapter 60. Therefore, when data is sent to a memory location in a node it will take the shortest path available and arrive as fast as possible. However, if a failure occurs to aswitch 50 then an alternate path may have to be configured and the distance table would have to be computed again. - FIG. 2 is an example of an InfiniBand subnet management packet (SMP)
header 200. Each InfiniBand architecture is divided into subnets having at least one subnet manager (SM). Each SM may reside on aswitch 50 and is responsible for configuring the subnet. Communications between the SM and other subnet management agents (SMA) is done through subnet management packet (SMP). Therefore, whenever a computer resides on the subnet it is necessary to be able to reformat data so that it meets the requirements of either big endian or little endian data format. This also applied to theSMP header 200 illustrated in FIG. 2. - The
SMP header 200 illustrated in FIG. 2 is composed of several 64-bit fields. TheSMP header 200 defines the base version which is a one byte field indicating the version of management datagram based format. A one byte field for management class is provided which represents a subnet management class value. A one byte field for class version is provided which indicates the version field for the management class. A one bit field R is provided to indicate a request/response field. Further, a 7 bit field is provided for method representing the method of subset management being used. In the second 64-bit field a two byte status field is provided which encodes the status of the method. In addition, a hop pointer is provided to indicate the current byte of the initial/return path field. A hop counter is used to contain the number of valid bites in the initial/return that indicates how many direct route hops to take. In the third 64-bit field a transaction identification (ID) is provided indicative of a transaction specific identifier. In the fourth 64-bit field a 2 byte attribute identification (ID) is provided indicating the attributes for the SMP. Attributes for SMP's are typically data objects that are composite structures having registers in subnet nodes and these attributes may be read or written. The SMP method uses the attribute ID and attribute modifier to re-define or modify specific registers within a given node. Thereafter, two additional bytes are reserved for future use. In the fifth field an attribute modifier having four bytes is provided for an SMP to use as the index value to further specify data to be obtained or modified. In the sixth field a management key (M_KEY) having eight bytes is provided for SMP authentication. Thereafter, in the seventh field a source local identifier (SLID) and a destination local identifier (DLID) is provided for directed routing. - FIGS. 3 through 5 are flowcharts representing the logic employed by the example embodiments of the present invention. The blocks illustrated in FIGS. 3 through 5 represent modules, code, code segments, commands, firmware, hardware, instructions and data that are executable by a processor-based system(s) and may be written in a programming language, such as, but not limited, to C++.
- FIG. 3 is a flowchart of the logic used to create an InfiniBand subnet management packet (SMP)
header 200, shown in FIG. 2, data structure in the example embodiments of the present invention. The logic shown in FIG. 3 may be implemented in the sample C++ program illustrated in Table 1 provided ahead. It should be noted that the C++ program illustrated in Table 1 is provided by way of example only and as one of ordinary skill in the art would appreciate this program may be implemented using any language and different commands.TABLE 1 typedef struct_SMP_DIR_HDR { uint8 base_ver; // byte 0uint8 mgmt_class; // byte 1uint8 class_version; // byte 2struct { // byte 3#ifdef LITTLE_ENDIAN uint8 method:7; // bits 0-7 of byte 3uint8 req_resp:1; // high bit of byte 3#else uint8 req_resp:1; // high bit of byte 3uint8 method:7; // bits 0-7 of byte 3#endif }sbyte3; struct { #ifdef LITTLE_ENDIAN uint16 Status:15; // byte 4-5 15 bits uint16 direction:1; // bit 31 ofbyte 5#else uint16 direction:1; // bit 31 ofbyte 5uint16 Status:15; // byte 4-5 15 bits #endif }sbyte4 uint8 hop_pointer; // byte 6 uint8 hop_count; // byte 7uint64 transaction_id; // bytes 8-15 uint16 attribute_id; // bytes 16-17 uint16 resv1; // bytes 18-19 uint32 attribute_mod; // bytes 20-23 uint64 m_key; // bytes 24-31 uint16 dr_slid; // bytes 32-33 uint16 dr_dlid; // bytes 34-35 } SMP_DIR_HDR; - Referring to FIG. 3, execution begins in
operation 300 where the variables are set to byte positions of the subnet management packet (SMP)header 200, shown in FIG. 2. Thereafter,processing proceeds operation 305 where it is determined if the little endian byte order is desired. If little endian byte order is desiredprocessing proceeds operation 310 wherebits 0 through 6 of byte three are stored in an eight-bit variable. Thereafter, processing proceeds tooperation 315 where the highest bit of byte three is stored intobit 7 of the of the eight-bit variable. However, if inoperation 305 it is determined that little endian byte order is not desired then processing proceeds tooperation 320 where the highest bit of byte three is stored into bit zero of the eight-bit variable. Processing then proceeds tooperation 325 wherebits 0 through 6 ofbyte 3 are stored intobits 1 through 7 of the eight-bit variable. - Regardless of whether the little endian byte order is selected in
operation 305 processing proceeds tooperation 330 where the eight-bit variable determined inoperation 310 through 325 is stored as sbyte3. Thereafter, processing proceeds tooperation 335 where again it is determined if little endian byte order is desired. If little endian byte order is desired then processing proceeds tooperation 340 where the first 15 bits ofbytes operation 345bit 31 ofbyte 5 is stored intobit 15 of the variable. However, if inoperation 335 it is determined that little endian byte order is not desired then processing proceeds tooperation 350. Inoperation 350,bit 31 ofbyte 5 is stored intobit 15 of a variable. Inoperation 355 the first 15 bits ofbytes operation 335, inoperation 360, the remaining portion of theSMP header 200 data structure is defined. - FIG. 4 is a flowchart of a compiler expansion of embedded macros used to create the
SMP header 200 data structure in the embodiments of the present invention. The processes shown in FIG. 4 compile the embedded macros and code contained in Table II discusses further detail ahead. The operations shown in FIG. 4 begin inoperation 400 by executing a standard C++ compiler. Thereafter, inoperation 410, the C++ compiler expands embedded macros shown in Table I which define the data structure for theSMP header 200 shown in Table I. These embedded macros takes the place of the logic shown and discussed in reference to FIG. 3. The embedded macros create theSMP header 200 data structure as shown and discussed in FIG. 3. The advantage of using the embedded macros shown in Table II and compiled inoperation 410 is that the data structure is generated during compilation rather than during execution. The savings in terms of processor power is enormous when the data structure can be generated during compilation time which is in constant usage by application programs. Further, once tested these embedded macros may be incorporated in every application program that utilizes theSMP header 200. Thereafter, inoperation 420, the C++ compiler compiles the function swap contents shown in Table III.#define field_offset(struct_name, field) \ ((uint16) ((char *)& ((struct_name *) 0)->field)) #define DEFINE_STRUCT_START(name) \ swap_struct_t swap_##name[] = { #define DEFINE_STRUCT_FIELD(struct_name, field) \ { \ sizeof(((struct_name *) 0)->field), \ field_offset(struct_name, field) \ }, #define DEFINE_STRUCT_END (struct_name) {0,0}}; #define SWAP_STRUCT_NAME(struct_name) swap_##name // Now the definition that describes this structure // the same definition and function are used both while sending // and receiving a stucture that needs transformation. DEFINE_STRUCT_START (SMP_DIR_HDR) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, sbyte4) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, transaction_id) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, attribute_id) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, attribute_mod) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, m_key) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, dr_slid) DEFINE_STRUCT_FIELD(SMP_DIR_HDR, dr_dlid) DEFINE_STRUCT_END - Table III is an example of the expansion of the embedded macros illustrated in Table II and executed in
operation 410. This expansion is only for the data structure referred to as “define _struct _start” and is only provided by way of example. As would be appreciated by one of ordinary skill in the art, the expansion of the macros performed by the compiler is three levels deep and further expansion in Table III is not required. It should be again noted that the expansion of the data structure is accomplished by the C++ compiler rather than during program execution as illustrated in FIG. 3.TABLE III // Expanded form after pre-compilation. swap_struct_t swap_SMP_DIR_HDR[] = // Defined by DEFINE_STRUCT_START { {2, 4}, // sbyte4: size 2, offset 4{8, 8}, // transaction id: size 8, offset 8{2, 16},// attribute_id: size 2, offset 16{4,20},// attribute mod: size 4, offset 20{8,24},// m_key: size 8, offset 24{2,32},// slid: size 2, offset 32{2,34},// dlid: size 2, offset 34{0,0} // placed by DEFINE_STRUCT_END }; - FIG. 5 is a flowchart of the logic involved in converting data used in the example embodiments of the present invention as performed by the swap_contents function module. The swap_contents function module begins execution in
operation 500 where a variable I is set to zero. Inoperation 510, it is determined whether I is equal to the size of the swap structure variable to be converted. If the value of I=the size of the swap structure variable then processing proceeds tooperation 590 where processing terminates. However, if the value of I is not equal of the size of the swap structure variable, then processing proceeds tooperation 520. Inoperation 520, it is determined if the size of the swap structure variable is equal to two bytes. If the swap structure variable has a size equal to two bytes then processing proceeds tooperation 530. Inoperation 530, the swap function is called and passed a 16-bit variable and pointer to every 16 bits. Thereafter, processing loops back tooperation 510 fromoperation 530. - However, in
operation 520 if the size of the swap structure variable is not two bytes then processing proceeds tooperation 550. Inoperation 550, it is determined whether the swap structure variable has a size equal to 4 bytes. If the swap structure variable has a size equal to 4 bytes then processing proceeds tooperation 540. Inoperation 540, the swap function is called and passed a 32-bit variable and a pointer to every 32 bits. Thereafter, processing loops back fromoperation 540 tooperation 510. - However, in
operation 550 if the size of the swap variable is not equal to four bytes in length then processing proceeds tooperation 560. Inoperation 560 it is determined if the size of the swap structure variable is equal to 8 bytes in length. If the size of the swap structure variable is equal to 8 bytes in length, then processing proceeds tooperation 570. Inoperation 570, the swap function is called and passed a 64-bit variable and pointers to every 64 bits. Thereafter, processing loops back tooperation 510 fromoperation 570. - However, if in
operation 560 it is determined that the swap structure variable is not equal 8 bytes in size, then processing proceeds tooperation 580. Inoperation 580 it is determined whether the size swap structure variable is equal to 16 bytes in length. If the swap structure variable is equal to 16 bytes in length then processing proceeds tooperation 585. Inoperation 585, the swap function is called and passed a 128 bit variable with a pointer to every 128 bits. Thereafter, processing loops back tooperation 510 fromoperation 585. However, if the swap structure variable does not have a size of 16 bytes, then processing proceeds tooperation 590 and processing terminates. - The benefit resulting from the present invention is that a simple, reliable, fast method and computer program is provided that will convert from little endian data format to big endian data format and back again. The data structure required to accomplish this is generated using embedded macros during compilation. Therefore, no runtime processing power is wasted creating the data structure for each application. This allows for extremely fast execution of the conversion.
- While we have shown and described only a few examples herein, it is understood that numerous changes and modifications as known to those skilled in the art could be made to the example embodiment of the present invention. Therefore, we do not wish to be limited to the details shown and described herein, but intend to cover all such changes and modifications as are encompassed by the scope of the appended claims.
Claims (13)
1. A method of converting the format of a data structure, comprising:
generating a plurality of embedded macros, wherein each embedded macro defines a portion of the data structure;
incorporating the plurality of embedded macros into an application program;
expanding the embedded macros to create the data structure by compiling the application program;
executing a swap function module to reformat the data structure to conform to a memory architecture specified; and
transmitting the data structure to a machine that has the ability to manipulate data contained in the data structure.
2. The method recited in claim 1 , wherein the embedded macros and the application program are written in C++.
3. The method recited in claim 1 , wherein the data structure is a subnet management packet.
4. The method recited in claim 3 , wherein the memory architecture specified is either little endian or big endian.
5. The method recited in claim 4 , wherein the swap function module modifies the data structure so as to conform to a little endian memory architecture.
6. The method recited in claim 4 , wherein the swap function module modifies the data structure so as to conform to a big endian memory architecture.
7. A program embodied in a storage medium and executable by a machine, the program, when executed, resulting in performance of operations comprising:
generating a plurality of embedded macros, wherein each embedded macro defines a portion of the data structure;
incorporating the plurality of embedded macros into an application program;
expanding the embedded macros to create the data structure by compiling the application program;
executing a swap function module to reformat the data structure to conform to a memory architecture specified; and
transmitting the data structure to a machine that has the ability to manipulate data contained in the data structure.
8. The program recited in claim 7 , wherein the embedded macros and the application program are written in C++.
9. The program recited in claim 7 , wherein the data structure is a subnet management packet.
10. The program recited in claim 9 , wherein the memory architecture specified is either little endian or big endian.
11. The program recited in claim 10 , wherein the swap function module modifies the data structure so as to conform to a little endian memory architecture.
12. The program recited in claim 10 , wherein the swap function module modifies the data structure so as to conform to a big endian memory architecture.
13-16. (Cancelled).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US10/860,838 US20040221276A1 (en) | 2000-11-17 | 2004-06-03 | Method and computer program for data conversion in a heterogeneous communications network |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US09/714,647 US6772320B1 (en) | 2000-11-17 | 2000-11-17 | Method and computer program for data conversion in a heterogeneous communications network |
US10/860,838 US20040221276A1 (en) | 2000-11-17 | 2004-06-03 | Method and computer program for data conversion in a heterogeneous communications network |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US09/714,647 Continuation US6772320B1 (en) | 2000-11-17 | 2000-11-17 | Method and computer program for data conversion in a heterogeneous communications network |
Publications (1)
Publication Number | Publication Date |
---|---|
US20040221276A1 true US20040221276A1 (en) | 2004-11-04 |
Family
ID=32772379
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US09/714,647 Expired - Fee Related US6772320B1 (en) | 2000-11-17 | 2000-11-17 | Method and computer program for data conversion in a heterogeneous communications network |
US10/860,838 Abandoned US20040221276A1 (en) | 2000-11-17 | 2004-06-03 | Method and computer program for data conversion in a heterogeneous communications network |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US09/714,647 Expired - Fee Related US6772320B1 (en) | 2000-11-17 | 2000-11-17 | Method and computer program for data conversion in a heterogeneous communications network |
Country Status (1)
Country | Link |
---|---|
US (2) | US6772320B1 (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020172195A1 (en) * | 2001-03-23 | 2002-11-21 | Pekkala Richard E. | Apparatus amd method for disparate fabric data and transaction buffering within infiniband device |
US20060242629A1 (en) * | 2005-03-10 | 2006-10-26 | Siemens Communications, Inc. | Systems and methods for remote cross-platform instructions |
US20070165672A1 (en) * | 2006-01-19 | 2007-07-19 | Neteffect, Inc. | Apparatus and method for stateless CRC calculation |
US20080043750A1 (en) * | 2006-01-19 | 2008-02-21 | Neteffect, Inc. | Apparatus and method for in-line insertion and removal of markers |
US7849232B2 (en) | 2006-02-17 | 2010-12-07 | Intel-Ne, Inc. | Method and apparatus for using a single multi-function adapter with different operating systems |
US20110264819A1 (en) * | 2010-04-24 | 2011-10-27 | Sudharshan Srinivasan | Binary data serialization system using machine dependant data alignement |
US8078743B2 (en) | 2006-02-17 | 2011-12-13 | Intel-Ne, Inc. | Pipelined processing of RDMA-type network transactions |
US8316156B2 (en) | 2006-02-17 | 2012-11-20 | Intel-Ne, Inc. | Method and apparatus for interfacing device drivers to single multi-function adapter |
US8458280B2 (en) | 2005-04-08 | 2013-06-04 | Intel-Ne, Inc. | Apparatus and method for packet transmission over a high speed network supporting remote direct memory access operations |
US9563534B1 (en) * | 2015-09-04 | 2017-02-07 | International Business Machines Corporation | Debugger display of vector register contents after compiler optimizations for vector instructions |
US9588746B2 (en) | 2014-12-19 | 2017-03-07 | International Business Machines Corporation | Compiler method for generating instructions for vector operations on a multi-endian processor |
US9619214B2 (en) | 2014-08-13 | 2017-04-11 | International Business Machines Corporation | Compiler optimizations for vector instructions |
US9880821B2 (en) | 2015-08-17 | 2018-01-30 | International Business Machines Corporation | Compiler optimizations for vector operations that are reformatting-resistant |
US10169014B2 (en) | 2014-12-19 | 2019-01-01 | International Business Machines Corporation | Compiler method for generating instructions for vector operations in a multi-endian instruction set |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7039922B1 (en) | 1999-11-29 | 2006-05-02 | Intel Corporation | Cluster with multiple paths between hosts and I/O controllers |
US20040216138A1 (en) * | 2001-04-20 | 2004-10-28 | Microsoft Corporation | Method and system for processing input from a command line interface |
US20030208572A1 (en) * | 2001-08-31 | 2003-11-06 | Shah Rajesh R. | Mechanism for reporting topology changes to clients in a cluster |
US6950885B2 (en) * | 2001-09-25 | 2005-09-27 | Intel Corporation | Mechanism for preventing unnecessary timeouts and retries for service requests in a cluster |
US7194540B2 (en) * | 2001-09-28 | 2007-03-20 | Intel Corporation | Mechanism for allowing multiple entities on the same host to handle messages of same service class in a cluster |
US20030101158A1 (en) * | 2001-11-28 | 2003-05-29 | Pinto Oscar P. | Mechanism for managing incoming data messages in a cluster |
US7099337B2 (en) * | 2001-11-30 | 2006-08-29 | Intel Corporation | Mechanism for implementing class redirection in a cluster |
US7290277B1 (en) * | 2002-01-24 | 2007-10-30 | Avago Technologies General Ip Pte Ltd | Control of authentication data residing in a network device |
US20050216896A1 (en) * | 2004-03-26 | 2005-09-29 | Santera Systems, Inc. | Data communication via tanslation map exchange |
US8228926B2 (en) * | 2005-04-12 | 2012-07-24 | Genband Us Llc | Dynamic loading for signaling variants |
US8595452B1 (en) | 2005-11-30 | 2013-11-26 | Sprint Communications Company L.P. | System and method for streaming data conversion and replication |
US8667250B2 (en) | 2007-12-26 | 2014-03-04 | Intel Corporation | Methods, apparatus, and instructions for converting vector data |
US8661421B2 (en) * | 2009-12-21 | 2014-02-25 | Intel Corporation | Methods and apparatuses for endian conversion |
US8578357B2 (en) * | 2009-12-21 | 2013-11-05 | Intel Corporation | Endian conversion tool |
US8953782B2 (en) | 2011-05-09 | 2015-02-10 | Bae Systems Information And Electronic Systems Integration Inc. | Crypto arrangement with mixed endian |
US9935848B2 (en) | 2011-06-03 | 2018-04-03 | Oracle International Corporation | System and method for supporting subnet manager (SM) level robust handling of unkown management key in an infiniband (IB) network |
US9332005B2 (en) | 2011-07-11 | 2016-05-03 | Oracle International Corporation | System and method for providing switch based subnet management packet (SMP) traffic protection in a middleware machine environment |
CN104205778B (en) * | 2012-05-10 | 2017-10-03 | 甲骨文国际公司 | System and method for supporting subnet manager (SM) main negotiation in a network environment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5717911A (en) * | 1995-01-23 | 1998-02-10 | Tandem Computers, Inc. | Relational database system and method with high availability compliation of SQL programs |
US5754858A (en) * | 1996-05-01 | 1998-05-19 | Microsoft Corporation | Customizable application project generation process and system |
US6081883A (en) * | 1997-12-05 | 2000-06-27 | Auspex Systems, Incorporated | Processing system with dynamically allocatable buffer memory |
US6128771A (en) * | 1996-02-09 | 2000-10-03 | Sun Microsystems, Inc. | System and method for automatically modifying database access methods to insert database object handling instructions |
US6138274A (en) * | 1998-01-23 | 2000-10-24 | Lucent Technologies, Inc. | Method and apparatus for updating an online computer program |
US6199137B1 (en) * | 1999-01-05 | 2001-03-06 | Lucent Technolgies, Inc. | Method and device for controlling data flow through an IO controller |
US6314501B1 (en) * | 1998-07-23 | 2001-11-06 | Unisys Corporation | Computer system and method for operating multiple operating systems in different partitions of the computer system and for allowing the different partitions to communicate with one another through shared memory |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5519842A (en) | 1993-02-26 | 1996-05-21 | Intel Corporation | Method and apparatus for performing unaligned little endian and big endian data accesses in a processing system |
-
2000
- 2000-11-17 US US09/714,647 patent/US6772320B1/en not_active Expired - Fee Related
-
2004
- 2004-06-03 US US10/860,838 patent/US20040221276A1/en not_active Abandoned
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5717911A (en) * | 1995-01-23 | 1998-02-10 | Tandem Computers, Inc. | Relational database system and method with high availability compliation of SQL programs |
US6128771A (en) * | 1996-02-09 | 2000-10-03 | Sun Microsystems, Inc. | System and method for automatically modifying database access methods to insert database object handling instructions |
US5754858A (en) * | 1996-05-01 | 1998-05-19 | Microsoft Corporation | Customizable application project generation process and system |
US6081883A (en) * | 1997-12-05 | 2000-06-27 | Auspex Systems, Incorporated | Processing system with dynamically allocatable buffer memory |
US6138274A (en) * | 1998-01-23 | 2000-10-24 | Lucent Technologies, Inc. | Method and apparatus for updating an online computer program |
US6314501B1 (en) * | 1998-07-23 | 2001-11-06 | Unisys Corporation | Computer system and method for operating multiple operating systems in different partitions of the computer system and for allowing the different partitions to communicate with one another through shared memory |
US6199137B1 (en) * | 1999-01-05 | 2001-03-06 | Lucent Technolgies, Inc. | Method and device for controlling data flow through an IO controller |
Cited By (34)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7401126B2 (en) * | 2001-03-23 | 2008-07-15 | Neteffect, Inc. | Transaction switch and network interface adapter incorporating same |
US20020172195A1 (en) * | 2001-03-23 | 2002-11-21 | Pekkala Richard E. | Apparatus amd method for disparate fabric data and transaction buffering within infiniband device |
US20060242629A1 (en) * | 2005-03-10 | 2006-10-26 | Siemens Communications, Inc. | Systems and methods for remote cross-platform instructions |
US8458280B2 (en) | 2005-04-08 | 2013-06-04 | Intel-Ne, Inc. | Apparatus and method for packet transmission over a high speed network supporting remote direct memory access operations |
US7889762B2 (en) | 2006-01-19 | 2011-02-15 | Intel-Ne, Inc. | Apparatus and method for in-line insertion and removal of markers |
US7782905B2 (en) | 2006-01-19 | 2010-08-24 | Intel-Ne, Inc. | Apparatus and method for stateless CRC calculation |
US9276993B2 (en) | 2006-01-19 | 2016-03-01 | Intel-Ne, Inc. | Apparatus and method for in-line insertion and removal of markers |
US8699521B2 (en) | 2006-01-19 | 2014-04-15 | Intel-Ne, Inc. | Apparatus and method for in-line insertion and removal of markers |
US20080043750A1 (en) * | 2006-01-19 | 2008-02-21 | Neteffect, Inc. | Apparatus and method for in-line insertion and removal of markers |
US20110099243A1 (en) * | 2006-01-19 | 2011-04-28 | Keels Kenneth G | Apparatus and method for in-line insertion and removal of markers |
US20070165672A1 (en) * | 2006-01-19 | 2007-07-19 | Neteffect, Inc. | Apparatus and method for stateless CRC calculation |
US8078743B2 (en) | 2006-02-17 | 2011-12-13 | Intel-Ne, Inc. | Pipelined processing of RDMA-type network transactions |
US8271694B2 (en) | 2006-02-17 | 2012-09-18 | Intel-Ne, Inc. | Method and apparatus for using a single multi-function adapter with different operating systems |
US8316156B2 (en) | 2006-02-17 | 2012-11-20 | Intel-Ne, Inc. | Method and apparatus for interfacing device drivers to single multi-function adapter |
US8032664B2 (en) | 2006-02-17 | 2011-10-04 | Intel-Ne, Inc. | Method and apparatus for using a single multi-function adapter with different operating systems |
US8489778B2 (en) | 2006-02-17 | 2013-07-16 | Intel-Ne, Inc. | Method and apparatus for using a single multi-function adapter with different operating systems |
US20100332694A1 (en) * | 2006-02-17 | 2010-12-30 | Sharp Robert O | Method and apparatus for using a single multi-function adapter with different operating systems |
US7849232B2 (en) | 2006-02-17 | 2010-12-07 | Intel-Ne, Inc. | Method and apparatus for using a single multi-function adapter with different operating systems |
US20110264819A1 (en) * | 2010-04-24 | 2011-10-27 | Sudharshan Srinivasan | Binary data serialization system using machine dependant data alignement |
US8332539B2 (en) * | 2010-04-24 | 2012-12-11 | Sudharshan Srinivasan | Binary data serialization system using machine dependant data alignment |
US10489129B2 (en) | 2014-08-13 | 2019-11-26 | International Business Machines Corporation | Layered vector architecture compatibility for cross-system portability |
US9619214B2 (en) | 2014-08-13 | 2017-04-11 | International Business Machines Corporation | Compiler optimizations for vector instructions |
US9626168B2 (en) | 2014-08-13 | 2017-04-18 | International Business Machines Corporation | Compiler optimizations for vector instructions |
US9996326B2 (en) | 2014-08-13 | 2018-06-12 | International Business Machines Corporation | Layered vector architecture compatibility for cross-system portability |
US9959102B2 (en) | 2014-08-13 | 2018-05-01 | International Business Machines Corporation | Layered vector architecture compatibility for cross-system portability |
US9588746B2 (en) | 2014-12-19 | 2017-03-07 | International Business Machines Corporation | Compiler method for generating instructions for vector operations on a multi-endian processor |
US10169014B2 (en) | 2014-12-19 | 2019-01-01 | International Business Machines Corporation | Compiler method for generating instructions for vector operations in a multi-endian instruction set |
US9606780B2 (en) | 2014-12-19 | 2017-03-28 | International Business Machines Corporation | Compiler method for generating instructions for vector operations on a multi-endian processor |
US9886252B2 (en) | 2015-08-17 | 2018-02-06 | International Business Machines Corporation | Compiler optimizations for vector operations that are reformatting-resistant |
US9880821B2 (en) | 2015-08-17 | 2018-01-30 | International Business Machines Corporation | Compiler optimizations for vector operations that are reformatting-resistant |
US10169012B2 (en) | 2015-08-17 | 2019-01-01 | International Business Machines Corporation | Compiler optimizations for vector operations that are reformatting-resistant |
US10642586B2 (en) | 2015-08-17 | 2020-05-05 | International Business Machines Corporation | Compiler optimizations for vector operations that are reformatting-resistant |
US9594668B1 (en) * | 2015-09-04 | 2017-03-14 | International Business Machines Corporation | Debugger display of vector register contents after compiler optimizations for vector instructions |
US9563534B1 (en) * | 2015-09-04 | 2017-02-07 | International Business Machines Corporation | Debugger display of vector register contents after compiler optimizations for vector instructions |
Also Published As
Publication number | Publication date |
---|---|
US6772320B1 (en) | 2004-08-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6772320B1 (en) | Method and computer program for data conversion in a heterogeneous communications network | |
JP3515985B2 (en) | Method and system for temporarily setting a dedicated pipeline in a processor device | |
US7376547B2 (en) | Systems and methods that facilitate quantum computer simulation | |
CN100412848C (en) | Computer architecture and software cells for broadband networks | |
US5841973A (en) | Messaging in distributed memory multiprocessing system having shell circuitry for atomic control of message storage queue's tail pointer structure in local memory | |
JP3836838B2 (en) | Method and data processing system for microprocessor communication using processor interconnections in a multiprocessor system | |
JP3836840B2 (en) | Multiprocessor system | |
JP3411273B2 (en) | Data processing method and data processing system in processor | |
US20090016355A1 (en) | Communication network initialization using graph isomorphism | |
US9557734B2 (en) | Control network system, master apparatus, control data processing method, and control data processing program | |
US20070283127A1 (en) | Method and apparatus for indirectly addressed vector load-add-store across multi-processors | |
US20070192762A1 (en) | Method to analyze and reduce number of data reordering operations in SIMD code | |
EP1934782A2 (en) | Apparatus, method and system for building software by composition | |
JP2021501947A (en) | Memory network processor | |
JP3836837B2 (en) | Method, processing unit, and data processing system for microprocessor communication in a multiprocessor system | |
US5450313A (en) | Generating local addresses and communication sets for data-parallel programs | |
RU2598594C2 (en) | Delay-insensitive buffer for communication with acknowledgement | |
Hoefler et al. | Group operation assembly language-a flexible way to express collective communication | |
JP3836839B2 (en) | Method and data processing system for microprocessor communication in a cluster-based multiprocessor system | |
Suhaib et al. | Dataflow architectures for GALS | |
US11934832B2 (en) | Synchronization instruction insertion method and apparatus | |
US7133959B2 (en) | Data-driven information processing device and method to access multiple bank memories according to multiple addresses | |
WO2004003794A1 (en) | Method and device for quickly processing communication protocol by replacing software with hardware | |
Herman et al. | Self-stabilizing agent traversal | |
Yasumoto et al. | A compiler to implement LOTOS specifications in distributed environments |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION |