IP Library Granted Patent US 9,158,587
Granted Patent B2
US 9,158,587 · App. 13/353,877 · Granted Oct 13, 2015

Flexible task and thread binding with preferred processors based on thread layout

Inventors: James Abeles (Burtonsville, MD); Farid A. Parpia (Lake Katrine, NY)
Assignee: International Business Machines Corporation
G06F9/5005G06F9/5011G06F2209/5018
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,158,587
App. No.
13/353,877
Granted
Oct 13, 2015
Kind
B2
Abstract

Embodiments of thread binding are provided. An aspect includes generating a thread layout for an application. Another aspect includes determining a task count for the application; determining a task rank for each task of the task count; determining a thread count for each task associated with the application, wherein a thread count for a first task associated with the application is unequal to a thread count of a second task associated with the application; and indicating one or more preferred processors of a plurality of processors for each task associated with the application. Another aspect includes allocating system for each of the tasks of the application based on the thread layout. Another aspect includes affinitizing the tasks by generating child threads for each of the tasks, wherein a number of threads generated for each task corresponds to the thread count for the task in the thread layout.

Claims (21)

1. A computer program product for thread binding, the computer program product comprising:

a non-transitory tangible storage medium readable by a processing circuit of a computer system and storing instructions for execution by the processing circuit for performing a method comprising:

before starting execution of an application, generating a thread layout for the application, wherein generating the thread layout for the application before starting execution of the application comprises:

determining a task count comprising a number of tasks required to execute the application, wherein a plurality of tasks is required to execute the application, and the task count corresponds to the number of the plurality of tasks;

determining a task rank for each task of the plurality of tasks;

determining a thread count for each task of the plurality of tasks, each thread count comprising a number of threads required to execute the thread count's respective task, wherein a thread count for a first task of the plurality of tasks is unequal to a thread count of a second task of the plurality of tasks; and

indicating one or more preferred processors of a plurality of processors in the computer system for each task of the plurality of tasks, wherein a first task of the plurality of tasks requires a plurality of threads to execute, wherein a first processor is indicated as a preferred processor for a first thread of the plurality of threads required to execute the first task of the plurality of tasks, and wherein a second processor that is distinct from the first processor is indicated as a preferred processor for a second thread of the plurality of threads required to execute the first task;

allocating system resources, the system resources comprising the plurality of processors, for each of the tasks of the plurality of tasks based on the generated thread layout by affinitizing the tasks of the plurality of tasks, the affinitizing comprising generating threads for each of the tasks of the plurality of tasks, wherein a number of threads generated for each task of the plurality of tasks corresponds to the thread count for the task in the thread layout, and wherein each of the threads is assigned to a processor of the one or more respective preferred processors that are specified for the thread's task in the generated thread layout, wherein the first thread of the plurality of threads required to execute the first task is assigned to the first processor, and the second thread of the plurality of threads required to execute the first task is assigned to the second processor that is distinct from the first processor; and

executing each of the tasks required to execute the application by the generated threads in parallel using the plurality of processors, wherein the first thread of the plurality of threads required to execute the first task is executed on the first processor, and the second thread of the plurality of threads required to execute the first task is executed on the second processor that is distinct from the first processor,

wherein the first processor is not indicated as a preferred processor for the second thread of the plurality of threads required to execute the first task of the plurality of tasks, and wherein the second processor that is distinct from the first processor is not indicated as a preferred processor for the first thread of the plurality of threads required to execute the first task.

2. The computer program product as claimed in claim 1 wherein the thread layout is generated based on a specification of the application and a specification of the computer system.

3. A computer-implemented method for thread binding, the method comprising:

before starting execution of an application, generating, by a computer system, a thread layout for the application, wherein generating the thread layout for the application before starting execution of the application comprises:

determining a task count comprising a number of tasks required to execute the application, wherein a plurality of tasks is required to execute the application, and the task count corresponds to the number of the plurality of tasks;

determining a task rank for each task of the plurality of tasks;

determining a thread count for each task of the plurality of tasks, each thread count comprising a number of threads required to execute the thread count's respective task, wherein a thread count for a first task of the plurality of tasks is unequal to a thread count of a second task of the plurality of tasks; and

indicating one or more preferred processors of a plurality of processors in the computer system for each task of the plurality of tasks, wherein a first task of the plurality of tasks requires a plurality of threads to execute, wherein a first processor is indicated as a preferred processor for a first thread of the plurality of threads required to execute the first task of the plurality of tasks, and wherein a second processor that is distinct from the first processor is indicated as a preferred processor for a second thread of the plurality of threads required to execute the first task;

allocating system resources, the system resources comprising the plurality of processors, for each of the tasks of the plurality of tasks based on the generated thread layout by affinitizing the tasks of the plurality of tasks, the affinitizing comprising generating threads for each of the tasks of the plurality of tasks, wherein a number of threads generated for each task of the plurality of tasks corresponds to the thread count for the task in the thread layout, and wherein each of the threads is assigned to a processor of the one or more preferred processors that are specified for the thread's task in the generated thread layout, wherein the first thread of the plurality of threads required to execute the first task is assigned to the first processor, and the second thread of the plurality of threads required to execute the first task is assigned to the second processor that is distinct from the first processor; and

executing each of the tasks required to execute the application by the generated threads in parallel using the plurality of processors, wherein the first thread of the plurality of threads required to execute the first task is executed on the first processor, and the second thread of the plurality of threads required to execute the first task is executed on the second processor that is distinct from the first processor,

wherein the first processor is not indicated as a preferred processor for the second thread of the plurality of threads required to execute the first task of the plurality of tasks, and wherein the second processor that is distinct from the first processor is not indicated as a preferred processor for the first thread of the plurality of threads required to execute the first task.

4. The method as claimed in claim 3 wherein the thread layout is generated based on a specification of the application and a specification of the computer system.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 24, 2012
From: ABELES, JAMES; PARPIA, FARID A.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 027582/0582 →
Continuity (1)
Related Publication 20130191837A1 · Jul 25, 2013