Mechanism to restrict parallelization of loops
AssigneeInternational Business Machines Corporation
InventorsRaul Silvera, Priya Unnikrishnan, Guansong Zhang
Life of this patent
Estimating the term…
Abstract
A computer implemented method, computer usable program code, and a system for parallelizing a loop. A parameter that will be used to limit parallelization of the loop is identified to limit parallelization of the loop. The parameter specifies a minimum number of loop iterations that a thread should execute. The parameter can be adjusted based on a parallel performance factor. A parallel performance factor is a factor that influences the performance of parallel code. A number of threads from a plurality of threads is selected for processing iterations of the loop based on the parameter. The number of threads is selected prior to execution of the first iteration of the loop.
Claims20
A computer implemented method for parallelizing a loop, the computer implemented method comprising:
- identifying a parameter used to limit parallelization of the loop, wherein the parameter specifies a minimum number of loop iterations that a thread should execute;
- and
- selecting a number of threads from a plurality of threads for processing iterations of the loop based on the parameter, wherein the number of threads is selected prior to execution of a first iteration of the loop.
A computer program product comprising:
- a computer usable medium having computer usable program code for parallelizing a loop, said computer program product including:
- computer usable program code for identifying a parameter used to limit parallelization of the loop, wherein the parameter specifies a minimum number of loop iterations that a thread should execute;
- and
- computer usable program code for selecting a number of threads from a plurality of threads for processing iterations of the loop based on the parameter, wherein the number of threads is selected prior to execution of a first iteration of the loop.
A system for parallelizing a loop, comprising:
- a storage device coupled to a bus, wherein the storage device contains a computer usable program product;
- a communications unit coupled to the bus;
- and
- a processor unit coupled to the bus, wherein the processor unit executes the computer usable program code to identify a parameter used to limit parallelization of the loop, wherein the parameter specifies a minimum number of loop iterations that a thread should execute;
- and selects a number of threads from a plurality of threads for processing iterations of the loop based on the parameter, wherein the number of threads is selected prior to execution of a first iteration of the loop.
A computer implemented method for parallelizing a loop, the computer implemented method comprising:
- identifying a parameter used to limit parallelization of the loop, wherein the parameter specifies a minimum number of loop iterations that a thread should execute;
- adjusting the parameter based on at least one parallel performance factor to form an adjusted parameter, wherein each at least one parallel performance factor is a factor that influences the performance of parallel code, and wherein the parameter is adjusted prior to execution of a first iteration of the loop to form an adjusted parameter;
- selecting a number of threads from a plurality of threads for processing iterations of the loop based on the adjusted parameter;
- and
- parallelizing the loop over the selected number of threads.
Dependencies are inferred from the claim text.