# US 2014/0196018 A1 · Compiler optimization based on collectivity analysis

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2014/0196018 A1
- Document ID: US20140196018A1
- Status: Published application
- Kind: A1
- Application number: 14/217,983
- Filed: 2014-03-18
- Published: 2014-07-10
- Earliest claimed: 2012-11-07
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Yaxun Liu; Ilie G. Tanase; Ettore Tiotto
- Web page: https://patentgrep.com/patent/US20140196018A1

## CPC

- G06F 8/443: {Optimisation}
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/458: {Synchronisation, e.g. post-wait, barriers, locks (synchronisation among tasks G06F9/52)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An embodiment is directed to determining, by a compiler, that a call to a named barrier is matched across all of a plurality of threads, and based at least in part on determining that the call to the named barrier is matched across all of the plurality of threads, replacing, by the compiler, the named barrier with an unnamed barrier.

## Claims

### Claim 1

A method for optimizing a barrier comprising:
determining, by a compiler, that a call to a named barrier is matched across all of a plurality of threads; and
based at least in part on determining that the call to the named barrier is matched across all of the plurality of threads, replacing, by the compiler, the named barrier with an unnamed barrier.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining, by the compiler, that the named barrier is executed by all of the plurality of threads consistently.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining that the named barrier is executed by all of the plurality of threads consistently comprises:
determining, by the compiler, that the named barrier is entered by all of the plurality of threads the same number of times; and
determining, by the compiler, that all of the plurality of threads have executed the same number of barriers before entering the named barrier.

### Claim 4 (depends on 1)

The method of claim 1, wherein the named barrier and the unnamed barrier are associated with a Unified Parallel C (UPC) program.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
executing, by a plurality of parallel computing devices, the UPC program.

### Claim 6

A computer program product comprising a computer readable storage medium having computer readable program code stored thereon that, when executed by a compiler, performs a method for optimizing a barrier, the method comprising:
determining that a call to a named barrier is matched across all of a plurality of threads; and
based at least in part on determining that the call to the named barrier is matched across all of the plurality of threads, replacing the named barrier with an unnamed barrier.

### Claim 7 (depends on 6)

The computer program product of claim 6, wherein the method further comprises:
determining that the named barrier is executed by all of the plurality of threads consistently.

### Claim 8 (depends on 7)

The computer program product of claim 7, wherein determining that the named barrier is executed by all of the plurality of threads consistently comprises:
determining that the named barrier is entered by all of the plurality of threads the same number of times; and
determining that all of the plurality of threads have executed the same number of barriers before entering the named barrier.

### Claim 9 (depends on 6)

The computer program product of claim 6, wherein the named barrier and the unnamed barrier are associated with a Unified Parallel C (UPC) program.

### Claim 10 (depends on 6)

The computer program product of claim 6, wherein determining that the call to the named barrier is matched across all of the plurality of threads comprises determining that an expression included in the named barrier is common across all of the plurality of threads.
