System and method for compiling a source code supporting data parallel variables
First Claim
1. A method of generating a target code from a source code, the source code written using a high level language supporting data parallel processing, the target code to be executed in a data parallel computer having a plurality of processing nodes for processing data in parallel, the method being executable in a data processing apparatus and comprising the steps of:
- (a) maintaining a shapes defined table which includes a list of shapes which are declared and defined in a compilation unit of the source code;
(b) determining whether a source code declaration statement exists in said compilation unit of the source code which declares a shape having P positions organized among R dimensions, said shape being a template for use in declaring parallel variables each having P data instances distributed among P processing nodes logically organized among R dimensions, said statement specifying a symbol that identifies said shape;
(c) emitting to the target code, in response to said determination, at least one target code declaration statement which when executed in the data parallel computer enables the data parallel computer to declare said shape, said target code declaration statement including a definition field, a symbol field, and an initializer field;
(d) setting said symbol field equal to said symbol of said shape;
(e) ascertaining, in response to said determination, whether said source code declaration statement also defines said shape; and
(f) if it is determined that said source code declaration statement also defines said shape, then adding said symbol of said shape to said shapes defined table.
5 Assignments
0 Petitions
Accused Products
Abstract
A compiler for compiling a computer program which is adapted for use with a data parallel computer. The compiler supports variables which involve parallelism. Variables which involve parallelism are parallel variables, templates for parallel variables called shapes, and pointers to parallel variables. For each variable involving parallelism declared globally in the source code, the compiler of the present invention emits in the target code a declaration of a global scalar variable. It further emits in the target code a start trap. When executed, the start trap allocates memory and a data structure for the global variables involving parallelism. The start trap also initializes the data structures and global variables involving parallelism. Finally, the compiler of the present invention emits in the target code one or more statements which, at run time, will cause the start trap to be invoked before the execution of any statement in which one of the global variables involving parallelism is read from or written to.
-
Citations
19 Claims
-
1. A method of generating a target code from a source code, the source code written using a high level language supporting data parallel processing, the target code to be executed in a data parallel computer having a plurality of processing nodes for processing data in parallel, the method being executable in a data processing apparatus and comprising the steps of:
-
(a) maintaining a shapes defined table which includes a list of shapes which are declared and defined in a compilation unit of the source code; (b) determining whether a source code declaration statement exists in said compilation unit of the source code which declares a shape having P positions organized among R dimensions, said shape being a template for use in declaring parallel variables each having P data instances distributed among P processing nodes logically organized among R dimensions, said statement specifying a symbol that identifies said shape; (c) emitting to the target code, in response to said determination, at least one target code declaration statement which when executed in the data parallel computer enables the data parallel computer to declare said shape, said target code declaration statement including a definition field, a symbol field, and an initializer field; (d) setting said symbol field equal to said symbol of said shape; (e) ascertaining, in response to said determination, whether said source code declaration statement also defines said shape; and (f) if it is determined that said source code declaration statement also defines said shape, then adding said symbol of said shape to said shapes defined table. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method of generating a target code from a source code, the source code written using a high level language supporting data parallel processing, the target code to be executed by a data parallel computer comprising a plurality of processing nodes for processing data in parallel, the method being executable in a data processing apparatus and comprising the steps of:
-
(a) maintaining a parallel variables defined table which includes a list of parallel variables which are declared and defined in a compilation unit of the source code; (b) determining whether a source code declaration statement exists in said compilation unit of the source code which declares a parallel variable comprising a plurality of data instances each processed by one of the processing nodes when the target code is executed by the data parallel computer, said source code declaration statement specifying a symbol that identifies said parallel variable; (c) emitting to the target code, in response to said determination, at least one target code declaration statement which when executed in the data parallel computer enables the data parallel computer to declare said parallel variable, said target code declaration statement including a definition field, a symbol field, and an initializer field; (d) setting said symbol field equal to said symbol of said parallel variable; (e) ascertaining, in response to said determination, whether said source code declaration statement also defines said parallel variable; and (f) if it is determined that said source code declaration statement also defines said parallel variable, then adding said symbol of said parallel variable to said parallel variables defined table. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
Specification