KR20120079957A - Method and apparatus for searching parallelization point of array - Google Patents

Method and apparatus for searching parallelization point of array Download PDF

Info

Publication number
KR20120079957A
KR20120079957A KR1020110001327A KR20110001327A KR20120079957A KR 20120079957 A KR20120079957 A KR 20120079957A KR 1020110001327 A KR1020110001327 A KR 1020110001327A KR 20110001327 A KR20110001327 A KR 20110001327A KR 20120079957 A KR20120079957 A KR 20120079957A
Authority
KR
South Korea
Prior art keywords
array
elements
loop
updated
data structure
Prior art date
Application number
KR1020110001327A
Other languages
Korean (ko)
Other versions
KR101245494B1 (en
Inventor
임을규
홍준모
홍유덕
송창근
이재범
Original Assignee
한양대학교 산학협력단
대한민국(환경부 국립환경과학원장)
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 한양대학교 산학협력단, 대한민국(환경부 국립환경과학원장) filed Critical 한양대학교 산학협력단
Priority to KR1020110001327A priority Critical patent/KR101245494B1/en
Publication of KR20120079957A publication Critical patent/KR20120079957A/en
Application granted granted Critical
Publication of KR101245494B1 publication Critical patent/KR101245494B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE: A method and an apparatus for searching the parallelization point of an array are provided to divide calculation about the array by nodes based on a parallelization point. CONSTITUTION: A monitoring code is inserted into the loop of a source code(S130). When the implementation of the loop is completed, the result of a monitoring data structure is acquired(S150). N sections for the loop are determined(S160). Whether overlapped updating elements are in the elements of a first array is verified based on the result(S170). The source code is updated by dividing the loop into loops for the n sections(S180).

Description

배열의 병렬화 포인트 탐색 방법 및 장치{METHOD AND APPARATUS FOR SEARCHING PARALLELIZATION POINT OF ARRAY}METHOD AND APPARATUS FOR SEARCHING PARALLELIZATION POINT OF ARRAY}

아래의 실시예들은 배열의 병렬화 포인트를 탐색하기 위한 방법 및 장치에 관한 것이다.The following embodiments are directed to a method and apparatus for searching for parallelization points of an array.

배열의 병렬화 포인트를 탐색하여, 병렬화 포인트를 기준으로 배열에 대한 연산을 노드별로 분할하는 방법 및 장치가 개시된다.A method and apparatus for searching for parallelization points of an array and dividing operations on the array by node based on the parallelization point are disclosed.

소프트웨어의 병렬화(parallelization)는 기존의 순차(sequential) 프로그램을 병렬화함으로써 멀티코어(multi-core) 또는 복수 개의 노드(node)에서 실행될 수 있는 병렬 소프트웨어를 구축하는 것이다.The parallelization of software is to build parallel software that can be executed on a multi-core or a plurality of nodes by parallelizing existing sequential programs.

소프트웨어를 병렬화하기 위해서, 다양한 방법론 및 이러한 방법론들에 기반한 라이브러리들이 사용된다. 일반적으로, 소켓을 이용한 분산처리 방법론 및 스레드 프로그래밍 방법론 등이 병렬화를 위해 사용된다. 이러한 방법론은 서적, 기술 문서, 논문, 프로그래밍 라이브러리, 프로그래밍 프레임워크 등의 형태로 배표된다.To parallelize software, various methodologies and libraries based on these methodologies are used. In general, distributed processing methodologies using sockets and thread programming methodologies are used for parallelism. These methodologies are distributed in the form of books, technical documents, papers, programming libraries, programming frameworks, and the like.

예컨대, 유닉스(unix) 시스템에서는 pthread에 관련된 시스템 콜(system call)들을 이용함으로써 병렬 프로그램이 구현될 수 있다.For example, in a Unix system, parallel programs can be implemented by using system calls related to pthreads.

또한, 개발자용 프레임워크(framework) 기술로서, 오픈 앰피 라이브러리(OpenMP Library), 메시지 패싱 인터페이스(Massage Passing Interface), 테스트 페러럴 라이브러리(Task Parallel Library) 등이 있다.Also, framework technologies for developers include an OpenMP Library, a Message Passing Interface, a Test Parallel Library, and the like.

이러한 프레임워크 기술들은, 개발자가 명시적인 선언을 할 경우, 병렬 처리를 수행할 수 있는 스레드를 생성한다.These framework technologies create threads that can perform parallel processing when developers make explicit declarations.

기존의 기술들은 매우 추상적인 방법론에 기반하여 이루어졌거나, 개발자가 이미 병렬화가 가능한지 여부를 알고 있는 경우에 한해서만(즉, 개발자가 명시적으로 병렬화를 위한 선언을 한 경우에만), 병렬화를 구현할 수 있는 방법을 제공해준다.Existing techniques are based on a very abstract methodology, or only if the developer already knows if it can be parallelized (ie, if the developer explicitly declares it for parallelism). Provide a way.

본 발명의 일 실시에는 배열의 병렬화 포인트를 탐색하는 장치 및 방법을 제공할 수 있다.One embodiment of the present invention can provide an apparatus and method for searching for parallelization points in an array.

본 발명의 일 실시에는 탐색된 병렬화 포인트에 기반하여 배열에 대한 연산을 병렬화하는 장치 및 방법을 제공할 수 있다.An embodiment of the present invention may provide an apparatus and method for parallelizing an operation on an array based on a found parallelization point.

본 발명의 일 측에 따르면, 소스 코드 내의 루프 내부에 모니터링 코드를 삽입하는 단계 - 상기 루프는 제1 배열의 복수 개의 요소들에게 값을 할당함. 상기 모니터링 코드는 모니터링 데이터 구조를 포함하고, 상기 모니터링 데이터 구조는 상기 루프의 각 반복에서 상기 제1 배열의 복수 개의 요소들 중 어떤 요소가 갱신되었는지를 기록함. -, 상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는 단계, 상기 루프에 대한 n 개의 구간들을 결정하는 단계 - 상기 n은 2 이상의 정수임, 상기 루프의 각 반복은 상기 n 개의 구간들 중 하나의 구간에 포함됨. -, 상기 결과 값에 기반하여, 상기 제1 배열의 복수 개의 요소들 중 중복 갱신 요소가 있는지 여부를 판단하는 단계 - 상기 중복 갱신 요소는 상기 n 개의 구간들 중 2 개 이상의 구간들에서 갱신되는 요소임. - 및 상기 중복 갱신 요소가 발견되지 않은 경우, 상기 루프를 병렬로 실행되는 상기 n 개의 구간들 각각에 대한 루프들로 분할하여 상기 소스 코드를 갱신하는 단계를 포함하는, 배열의 요소들에 대한 연산의 병렬화 방법이 제공된다.According to one aspect of the invention, inserting a monitoring code inside a loop in source code, the loop assigning a value to a plurality of elements of a first array. The monitoring code comprises a monitoring data structure, the monitoring data structure recording which of the plurality of elements of the first array has been updated at each iteration of the loop. Obtaining a result value of the monitoring data structure after execution of the loop ends, determining n intervals for the loop, where n is an integer greater than or equal to 2, each iteration of the loop being the n number of loops Included in one of the sections. Determining, based on the result value, whether there is a duplicate update element among a plurality of elements of the first array, wherein the duplicate update element is updated in at least two of the n periods. being. And if the duplicate update element is not found, dividing the loop into loops for each of the n intervals executed in parallel to update the source code. A parallelization method of is provided.

상기 배열의 요소들에 대한 연산의 병렬화 방법은, 상기 소스 코드 내에서 상기 제1 배열을 선택하는 단계 및 상기 소스 코드 내에서 상기 루프를 선택하는 단계를 더 포함할 수 있다.The method of parallelizing the operation on the elements of the array may further include selecting the first array in the source code and selecting the loop in the source code.

상기 n은 2일 수 있고, 제1 구간은 상기 루프가 수행하는 반복들 중 앞부분이고, 제2 구간은 상기 반복들 중 뒷부분일 수 있다.The n may be 2, the first interval may be the front of the iterations performed by the loop, the second interval may be the rear of the iterations.

상기 제1 배열은 k 차원일 수 있고, 상기 모니터링 데이터 구조는 상기 k 차원의 요소들 각각이 상기 루프의 몇 번째 반복들에서 갱신되었는지를 나타낼 수 있다.The first arrangement may be k-dimensional and the monitoring data structure may indicate at which iterations of the loop each of the k-dimensional elements has been updated.

상기 루프의 반복 횟수는 L일 수 있다.The number of iterations of the loop may be L.

상기 모니터링 데이터 구조는 상기 제1 배열의 복수 개의 요소들 각각에 대한 제2 배열을 포함할 수 있고, 상기 제2 배열은 크기가 L인 1차원 배열이고, 상기 제2 배열의 요소들 각각은 L개의 불리언(Boolean) 값들의 배열일 수 있다.The monitoring data structure may comprise a second array for each of a plurality of elements of the first array, the second array being a one-dimensional array of size L, each of the elements of the second array being L It may be an array of four Boolean values.

상기 모니터링 코드는, 상기 루프의 i 번째 반복에서 상기 제1 배열의 복수 개의 요소들 중 특정 요소가 갱신되면, 상기 갱신된 요소에 대응하는 제2 배열의 i 번째 요소의 i 번째 불리언 값을 참(ture)으로 세트할 수 있다.The monitoring code is set to true if the i-th Boolean value of the i-th element of the second array corresponding to the updated element is updated when a particular element of the plurality of elements of the first array is updated in the i-th iteration of the loop. ture).

상기 제1 배열의 복수 개의 요소들 중 제x 요소가 상기 k 개의 구간들 중 제y 구간에서 갱신되었는지 여부는, 상기 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 상기 제y 구간이 포함하는 반복들에 대응하는 인덱스들의 요소들의 값들을 논리합 한 값에 기반하여 판단될 수 있다.Whether the xth element of the plurality of elements of the first array is updated in the yth period of the k periods, the yth period of the elements of the second array corresponding to the xth element may be The values of the elements of the indices corresponding to the repetitions may be determined based on a logical OR.

상기 제1 배열의 복수 개의 요소들 중 제x 요소가 상기 k 개의 구간들 중 제y 구간 및 제z 구간에서 중복 갱신되었는지 여부는, 상기 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 상기 제y 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제1 논리합을 계산하고, 상기 제z 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제2 논리합을 계산하고, 상기 제1 논리합 및 상기 제2 논리합을 논리곱(and)함으로써 판단될 수 있다.Among the elements of the second array corresponding to the xth element, whether the xth element of the plurality of elements of the first array is duplicated and updated in the yth and zth periods of the k periods, Compute the first logical sum of the values of the elements of the index corresponding to the iterations included in the y th interval, and the second logical sum of the values of the elements of the index corresponding to the iterations included in the z th interval It may be determined by calculating and ANDing the first AND and the second AND.

상기 모니터링 데이터 구조는 상기 제1 배열 및 상기 제1 배열의 복수 개의 요소들 각각에 대한 상기 제2 배열에 대응하는 k+1 차원의 배열일 수 있다.The monitoring data structure may be an array of k + 1 dimensions corresponding to the second array for each of the first array and a plurality of elements of the first array.

상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는 단계는, 상기 소스 코드에 기반한 실행 코드를 생성하는 단계, 상기 실행 코드를 실행함으로써 상기 루프의 실행이 종료된 후의 상기 결과 값을 획득하는 단계를 포함할 수 있다.Acquiring a result value of the monitoring data structure after the execution of the loop ends, generating an execution code based on the source code, executing the execution code, and executing the result value after the execution of the loop ends. It may include the step of obtaining.

본 발명의 다른 일 측에 따르면, 소스 코드 내의 루프 내부에 모니터링 코드를 삽입하는 모니터링 코드 삽입부 - 상기 루프는 제1 배열의 복수 개의 요소들에게 값을 할당함. 상기 모니터링 코드는 모니터링 데이터 구조를 포함하고, 상기 모니터링 데이터 구조는 상기 루프의 각 반복에서 상기 제1 배열의 복수 개의 요소들 중 어떤 요소가 갱신되었는지를 기록함. -, 상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는 결과 값 획득부, 상기 루프에 대한 n 개의 구간들을 결정하는 구간 결정부 - 상기 n은 2 이상의 정수임, 상기 루프의 각 반복은 상기 n 개의 구간들 중 하나의 구간에 포함됨. -, 상기 결과 값에 기반하여, 상기 제1 배열의 복수 개의 요소들 중 중복 갱신 요소가 있는지 여부를 판단하는 중복 갱신 요소 판단부 - 상기 중복 갱신 요소는 상기 n 개의 구간들 중 2 개 이상의 구간들에서 갱신되는 요소임. - 및 상기 중복 갱신 요소가 발견되지 않은 경우, 상기 루프를 병렬로 실행되는 상기 n 개의 구간들 각각에 대한 루프들로 분할하여 상기 소스 코드를 갱신하는 소스 코드 갱신부를 포함하는, 배열의 요소들에 대한 연산의 병렬화 장치.According to another aspect of the invention, a monitoring code inserter for inserting a monitoring code inside a loop in the source code-the loop assigns a value to a plurality of elements of the first array. The monitoring code comprises a monitoring data structure, the monitoring data structure recording which of the plurality of elements of the first array has been updated at each iteration of the loop. A result value obtaining unit obtaining a result value of the monitoring data structure after the execution of the loop is finished, an interval determining unit determining n sections for the loop, n being an integer of 2 or more, each of the loops Repetition is included in one of the n intervals. A duplicate update element determiner that determines whether there is a duplicate update element among a plurality of elements of the first array based on the result value, wherein the duplicate update element is two or more of the n periods; The element to update on. And a source code updater for dividing the loop into loops for each of the n intervals executed in parallel to update the source code if the duplicate update element is not found. Parallelism device for operation.

상기 배열의 요소들에 대한 연산의 병렬화 장치는 상기 소스 코드 내에서 상기 제1 배열을 선택하고, 상기 소스 코드 내에서 상기 루프를 선택하는 병렬화 대상 객체 선택부를 더 포함할 수 있다.The apparatus for parallelizing operations on the elements of the array may further include a parallelization object selection unit that selects the first array in the source code and selects the loop in the source code.

상기 중복 갱신 요소 판단부는, 상기 제1 배열의 복수 개의 요소들 중 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 제y 구간이 포함하는 반복들에 대응하는 인덱스들의 요소들의 값들을 논리합 한 값에 기반하여, 상기 제x 요소가 상기 k 개의 구간들 중 상기 제y 구간에서 갱신되었는지 여부를 판단할 수 있다.The redundancy update element determiner is configured to OR the values of the elements of the indices corresponding to the repetitions included in the y th interval among the elements of the second array corresponding to the x th element among the plurality of elements of the first array. Based on a value, it may be determined whether the x th element is updated in the y th period among the k periods.

상기 중복 갱신 요소 판단부는, 상기 제1 배열의 복수 개의 요소들 중 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 제y 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제1 논리합을 계산하고, 제z 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제2 논리합을 계산하고, 상기 제1 논리합 및 상기 제2 논리합을 논리곱(and)함으로써, 상기 제x 요소가 상기 k 개의 구간들 중 상기 제y 구간 및 상기 제z 구간에서 중복 갱신되었는지 여부를 판단할 수 있다.The redundancy update element determiner is configured to OR the values of the elements of the index corresponding to the repetitions included in the y th interval among the elements of the second array corresponding to the x th element among the plurality of elements of the first array. By calculating a first logical sum, calculating a second logical sum of the values of the elements of the index corresponding to the iterations included in the z interval, and ANDing the first logical sum and the second logical sum It may be determined whether the x th element is duplicated and updated in the y th section and the z th section among the k sections.

상기 결과 값 획득부는, 상기 소스 코드에 기반한 실행 코드를 생성하고, 상기 실행 코드를 실행함으로써, 상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득할 수 있다.The result value obtaining unit may generate an execution code based on the source code and execute the execution code to obtain a result value of the monitoring data structure after the execution of the loop ends.

배열의 병렬화 포인트를 탐색하는 장치 및 방법이 제공된다.An apparatus and method for searching for parallelization points of an array are provided.

탐색된 병렬화 포인트에 기반하여 배열에 대한 연산을 병렬화하는 장치 및 방법이 제공된다.An apparatus and method are provided for parallelizing operations on arrays based on the retrieved parallelization points.

도 1은 본 발명의 일 실시예에 따른 배열의 요소들에 대한 연산을 병렬화하는 방법의 흐름도이다.
도 2는 본 발명의 일 예에 따른 병렬화의 대상이 되는 원본(source) 배열이다.
도 3은 본 발명의 일 예에 따른 원본 배열을 갱신하는 루프를 포함하는 슈도 코드이다.
도 4는 본 발명의 일 예에 따른 모니터링 데이터 구조를 나타낸다.
도 5는 본 발명의 일 예에 따른 모니터링 코드를 나타낸다.
도 6은 본 발명의 일 예에 따른 루프 실행 중의 모니터링 데이터 구조의 갱신을 나타낸다.
도 7은 본 발명의 일 예에 따른 루프 실행이 완료된 후의 모니터링 데이터 구조를 나타낸다.
도 8은 본 발명의 일 예에 따른 병렬화된 루프를 나타낸다.
도 9는 본 발명의 일 실시예에 따른 배열의 요소들에 대한 연산의 병렬화 장치의 구조도이다.
1 is a flow diagram of a method for parallelizing an operation on elements of an array in accordance with one embodiment of the present invention.
2 is a source arrangement that is subject to parallelism according to an example of the present invention.
3 is a pseudo code including a loop for updating an original arrangement according to an embodiment of the present invention.
4 illustrates a monitoring data structure according to an embodiment of the present invention.
5 shows a monitoring code according to an example of the present invention.
6 illustrates an update of the monitoring data structure during loop execution according to an example of the present invention.
7 illustrates a monitoring data structure after loop execution is completed according to an embodiment of the present invention.
8 illustrates a parallelized loop according to an example of the present invention.
9 is a structural diagram of an apparatus for parallelizing an operation on elements of an array according to an embodiment of the present invention.

이하에서, 본 발명의 일 실시예를, 첨부된 도면을 참조하여 상세하게 설명한다. 그러나, 본 발명이 실시예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.
Hereinafter, an embodiment of the present invention will be described in detail with reference to the accompanying drawings. However, the present invention is not limited to or limited by the embodiments. Like reference symbols in the drawings denote like elements.

도 1은 본 발명의 일 실시예에 따른 배열의 요소들에 대한 연산을 병렬화하는 방법의 흐름도이다.1 is a flow diagram of a method for parallelizing an operation on elements of an array in accordance with one embodiment of the present invention.

단계(S110)에서, 소스 코드 내에서 원본 배열이 선택된다.In step S110, the original arrangement is selected in the source code.

원본 배열은 병렬화의 대상이 되는 배열이다.The original array is the array to be parallelized.

단계(S120)에서, 소스 코드 내에서 병렬화의 대상이 되는 루프(loop)가 선택된다. 루프는 원본 배열의 복수 개의 요소들에게 값을 할당한다.In step S120, a loop to be parallelized in the source code is selected. The loop assigns values to multiple elements of the original array.

즉, 루프가 반복됨(iterated)에 따라, 각 반복(iteration)에서 원본 배열의 복수 개의 요소들 중 특정 요소의 값이 갱신(또는, 생성)된다.That is, as the loop is iterated, the value of a specific element of the plurality of elements of the original array is updated (or generated) in each iteration.

단계(S130)에서, 선택된 루프 내부에 모니터링 코드(monitoring code)가 삽입된다.In step S130, a monitoring code is inserted inside the selected loop.

모니터링 코드는 모니터링 데이터 구조(data structure)를 포함한다.The monitoring code includes a monitoring data structure.

모니터링 데이터 구조는 루프의 각 반복에서 원본 배열의 요소들 중 어떤 요소가 갱신되었는지를 기록한다. 즉, 모니터링 데이터 구조에 의해 원본 배열의 요소들 중 어떤 요소가 루프의 몇 번째 반복에서 갱신되었는지가 식별될 수 있다.The monitoring data structure records which of the elements of the original array were updated at each iteration of the loop. That is, the monitoring data structure can identify which element of the original array has been updated at which iteration of the loop.

단계(S140)에서, 모니터링 코드가 삽입된 소스 코드에 기반한 실행 코드가 생성된다.In step S140, the execution code based on the source code into which the monitoring code is inserted is generated.

단계(S150)에서, 생성된 실행 코드를 실행함으로써, 루프의 실행이 종료된 후의 모니터링 데이터 구조의 결과 값이 획득된다.In step S150, by executing the generated executable code, a result value of the monitoring data structure after the execution of the loop ends is obtained.

단계(S160)에서, 루프에 대한 n 개의 구간들이 결정된다.In step S160, n intervals for the loop are determined.

n은 2 이상의 정수이다. 루프의 각 반복은 n 개의 구간들 중 하나의 구간에 포함된다.n is an integer of 2 or more. Each iteration of the loop is included in one of n intervals.

n이 2일 경우, 제1 구간은 루프가 수행하는 반복들 중 앞부분이고, 제2 구간은 루프가 수행하는 반복들 중 뒷부분일 수 있다.When n is 2, the first section may be the front of the repetitions performed by the loop, and the second section may be the rear of the repetitions performed by the loop.

단계(S170)에서, 모니터링 데이터 구조의 결과 값에 기반하여 원본 배열의 복수 개의 요소들 중 중복 갱신 요소가 있는지 여부가 판단된다.In step S170, it is determined whether there is a duplicate update element among the plurality of elements of the original array based on the result value of the monitoring data structure.

중복 갱신 요소는, k 개의 구간들 중 2 개 이상의 구간들에서 갱신되는 요소를 의미한다.The duplicate update element refers to an element that is updated in at least two sections of k sections.

즉, 원본 배열의 요소들 중 특정 요소가 제1 구간 및 제2 구간에서 갱신될 경우 상기의 특정 요소는 중복 갱신 요소이다.That is, when a specific element of the elements of the original arrangement is updated in the first section and the second section, the specific element is a duplicate update element.

만약, 원본 배열의 요소들 중 중복 갱신 요소가 있다면, k 개의 구간들은 병렬화될 수 없다. If there are duplicate update elements among the elements of the original array, k intervals cannot be parallelized.

예컨대, 제1 중복 갱신 요소가 루프의 a 번째 반복 및 b 번째 반복에서 갱신될 경우를 가정한다. 여기서 a < b이다. a 번째 반복은 k 개의 구간들 중 제c 구간에 속하는 반복이고, b 번째 반복은 k 개의 구간들 중 제d 구간에 속하는 반복이다.For example, assume a case where the first redundant update element is updated at the a iteration and the b iteration of the loop. Where a <b. The a th iteration is a repetition belonging to the c section of the k sections, and the b th iteration is a iteration belonging to the d section of the k sections.

원래의 루프가 실행될 경우, a < b이므로, 제1 중복 갱신 요소가 갖는 값은 b 번째 반복에 의해 갱신(또는, 생성)된 값이다.When the original loop is executed, since a <b, the value of the first redundant update element is the value updated (or generated) by the b th iteration.

그러나, k 개의 구간들이 모두 병렬로 실행된다면, a 번째 반복은 c 구간에 대해 분할된 루프에서 실행되고, b 번째 반복은 d 구간에 대해 분할된 루프에서 실행되기 때문에, a 번째 반복 및 b 번째 반복 중 b 번째 반복이 최종적으로 실행된다는 것이 보장될 수 없다.However, if k intervals are all executed in parallel, then the a iteration is executed in the loop divided for the interval c, and the b iteration is executed in the loop divided for the interval d, so that the a iteration and the b iteration It is not guaranteed that the b th iteration is executed finally.

반면, 원본 배열의 요소들 중 중복 갱신 요소가 없다면, k 개의 구간들은 병렬화될 수 있다.On the other hand, if there are no duplicate update elements among the elements of the original array, k intervals may be parallelized.

원본 배열의 요소들 중 특정한 요소가 루프의 a' 번째 반복 및 b' 번째 반복에서 갱신될 경우를 가정한다. 여기서 a' < b'이다. a' 번째 반복 및 b' 번째 반복은 모두 k 개의 구간들 중 제c' 구간에 속하는 반복이다.Suppose that one of the elements of the original array is updated at the a 'and b' iterations of the loop. Where a '<b'. The a 'th iteration and the b' th iteration are both iterations belonging to the 'c' section of k intervals.

원래의 루프가 실행될 경우, a' < b'이므로, 요소가 갖는 값은 b' 번째 반복에 의해 갱신(또는, 생성)된 값이다.When the original loop is executed, since a '<b', the value of the element is the value updated (or generated) by the b 'th iteration.

k 개의 구간들이 모두 병렬로 실행되더라도, a' 번째 반복 및 b' 번째 반복은 모드 c' 구간에 대해 분할된 루프에서 실행된다. 따라서, a' 번째 반복 및 b' 번째 반복 중 b' 번째 반복이 최종적으로 실행된다는 것이 보장될 수 있다.Although the k intervals are all executed in parallel, the a'th iteration and the b'th iteration are executed in the divided loop for the mode c 'interval. Thus, it can be ensured that the b 'th iteration of the a' th iteration and the b 'th iteration is finally executed.

즉, 원본 배열의 복수 개의 요소들에 대해서, 각 요소가 k 개의 구간들 중 단지 하나의 구간에서만 갱신되거나 또는 어떤 구간에서도 갱신되지 않으면, k 개의 구간들은 병렬화될 수 있다.That is, for a plurality of elements of the original arrangement, the k intervals can be parallelized if each element is updated in only one of the k intervals or in no interval.

중복 갱신 요소가 발견되지 않은 경우 단계(S180)가 수행된다.If no duplicate update element is found, step S180 is performed.

단계(S180)에서, 루프는 n 개의 구간들 각각에 대한 루프들로 분할된다.In step S180, the loop is divided into loops for each of the n intervals.

분할된 루프들은 병렬로 실행된다. 분할된 루프들은 시스템 내의 복수 개의 노드들에 의해 병렬로 실행될 수 있다.The divided loops run in parallel. The divided loops may be executed in parallel by a plurality of nodes in the system.

루프는 n 개의 구간들 각각에 대한 루프들로 분할함으로써 소스 코드가 갱신된다.
The source code is updated by dividing the loop into loops for each of the n intervals.

도 2는 본 발명의 일 예에 따른 병렬화의 대상이 되는 원본(source) 배열이다.2 is a source arrangement that is subject to parallelism according to an example of the present invention.

도시된 원본 배열(200)은 2 차원(dimension)의 배열이다. 원본 배열(200)의 첫 번째 차원(x)의 크기는 size_X이고, 원본 배열의 두 번째 차원(y)의 크기는 size_Y이다.The original arrangement 200 shown is an array of two dimensions. The size of the first dimension x of the original array 200 is size_X, and the size of the second dimension y of the original array 200 is size_Y.

즉, 원본 배열(200)은 하기의 표 1의 슈도 코드(pseudo code)에 의해 선언될 수 있다.That is, the original array 200 may be declared by the pseudo code of Table 1 below.

element_type matrix(size_X, size_Y);element_type matrix (size_X, size_Y);

여기서, matrix는 원본 배열(200)의 명칭이고, element_type은 원본 배열(200)이 element_type 형식(type)의 요소들의 배열임을 나타낸다.Here, matrix is a name of the original array 200, and element_type indicates that the original array 200 is an array of elements of the element_type type.

본 실시예에서, 원본 배열(200)이 2 차원인 것은, 단지 예시적인 것이다. 원본 배열은 k 차원일 수 있다. k는 1 이상의 정수이다.In this embodiment, it is merely exemplary that the original arrangement 200 is two-dimensional. The text array can be k dimension. k is an integer of 1 or more.

도 3은 본 발명의 일 예에 따른 원본 배열을 갱신하는 루프를 포함하는 슈도 코드이다.3 is a pseudo code including a loop for updating an original arrangement according to an embodiment of the present invention.

루프(300)는 1부터 LOOP_MAX_INDEX(310)(이하, L(310)로 표시한다.)까지, L 번 반복된다.The loop 300 is repeated L times from 1 to LOOP_MAX_INDEX 310 (hereinafter, denoted by L 310).

루프(300)의 각 반복(iteration)에서, 원본 배열(200) "matrix"의 요소 matrix(x,y)에게 함수 ex_function()(330)의 결과 값이 할당(assign)된다. 즉, matrix(x, y)의 값이 갱신된다.In each iteration of the loop 300, the result value of the function ex_function () 330 is assigned to the element matrix (x, y) of the original array 200 "matrix". That is, the value of matrix (x, y) is updated.

ex_function()(330)은 임의의 함수일 수 있다.ex_function () 330 may be any function.

변수 x 및 변수 y는 원본 배열(200)의 하나 이상의 요소들 중 하나의 요소를 특정한다. 즉, 변수 x 및 변수 y는 원본 배열(200)의 요소를 특정하는 인덱스(index)(320)이다.Variable x and variable y specify one element of one or more elements of original array 200. In other words, the variables x and y are indexes 320 that specify the elements of the original array 200.

인덱스(320)의 값, 즉 x의 값 및 y의 값은 루프(300)가 반복되면서 계속적으로 변경될 수 있다. 따라서, 루프(300)가 반복되면서, 인덱스에 의해 특정되는, 원본 배열(200)의 특정 요소들이 점차 변경된다.The value of the index 320, that is, the value of x and the value of y, may change continuously as the loop 300 repeats. Thus, as the loop 300 repeats, certain elements of the original array 200, which are specified by indexes, gradually change.

즉, 루프(300)가 반복됨에 따라, 원본 배열(200)의 요소들 중 하나의 요소가 선택되고, 선택된 요소의 값이 갱신된다.That is, as the loop 300 repeats, one element of the elements of the original array 200 is selected and the value of the selected element is updated.

원본 배열(200) 내의 요소들 중 특정한 요소 e는 루프(300)의 반복들(즉 제1 반복 내지 제L 반복) 중 갱신되지 않을 수 있다. 반면, 원본 배열(200)의 요소들 중 특정한 요소 f는 루프(300)가 반복되면서 2 회 이상 갱신될 수 있다.
A particular element e of the elements in the original arrangement 200 may not be updated during the iterations of the loop 300 (ie, the first to Lth iterations). On the other hand, a particular element f of the elements of the original array 200 may be updated two or more times as the loop 300 repeats.

도 4는 본 발명의 일 예에 따른 모니터링 데이터 구조를 나타낸다.4 illustrates a monitoring data structure according to an embodiment of the present invention.

전술된 것처럼, 루프(300)를 n 개의 구간들 각각에 대한 루프들로 분할하기 위해서는 원본 배열(200)의 요소들 중 중복 요소가 있는지 여부가 판단되어야 한다.As described above, in order to divide the loop 300 into loops for each of the n sections, it may be determined whether there are overlapping elements among the elements of the original array 200.

원본 배열(200)의 특정 요소가 중복 여부인지 여부를 판단하기 위해서는, 원본 배열(200)의 각 요소가 루프(300)의 어떤 반복(iteration)에서 갱신되었는지가 기록되어야 한다. 예컨대, 원본 배열(200)의 요소들이 k 차원의 배열이면, 모니터링 데이터 구조는 k 차원의 요소들 각각이 루프(200)의 몇 번째 반복들에서 갱신되었는지를 나타낼 수 있다.In order to determine whether a particular element of the original array 200 is redundant, it must be recorded at which iteration of the loop 300 each element of the original array 200 has been updated. For example, if the elements of original array 200 are k-dimensional arrays, the monitoring data structure may indicate at which iterations of loop 200 each of the k-dimensional elements has been updated.

또는, 루프(300)의 특정 구간에서 원본 배열(200)의 요소들 중 어떤 요소들이 갱신되었는지가 기록되어야 한다. 예컨대, 원본 배열(200)이 L 번 반복되면, 모니터링 데이터 구조는 각 반복에서 원본 배열(200)의 어떤 요소들이 갱신되었는지를 나타낼 수 있다.Or, it should be recorded which of the elements of the original array 200 has been updated in a particular section of the loop 300. For example, if the original array 200 is repeated L times, the monitoring data structure may indicate which elements of the original array 200 have been updated at each iteration.

예컨대, 모니터링 데이터 구조는 원본 배열(200)의 복수 개의 요소들 각각에 대해 반복 배열을 할당할 수 있다. 반복 배열의 길이는 L이다. 전술된 것과 같이, L은 루프(300)의 반복 횟수이다. 즉, 원본 배열(200)의 복수 개의 요소들 각각에 대해 길이 L인 1 차원의 반복 배열이 할당된다.For example, the monitoring data structure may assign a repeating arrangement to each of a plurality of elements of the original arrangement 200. The length of the repeat array is L. As mentioned above, L is the number of iterations of the loop 300. That is, a one-dimensional repetitive array of length L is assigned to each of the plurality of elements of the original array 200.

반복 배열의 요소들 각각은 L 개의 불리언(Boolean) 값들의 배열일 수 있다. 또는, 반복 배열의 요소들은 길이가 L인 비트(bit) 스트링(string)일 수 있다.Each element of the repeating array may be an array of L Boolean values. Alternatively, the elements of the repeating array may be bit strings of length L.

루프(300)의 i 번째 반복에서 원본 배열(200)의 요소들 중 한 요소가 갱신될 경우, 루프(300) 내의 모니터링 코드는, 상기 갱신된 요소의 반복 배열의 i 번째 요소의 값을 갱신한다. 즉, 상기 갱신된 요소의 반복 배열의 i 번째 요소의 값인, L 개의 불리언 값들 중(또는, 비트 스트링 중), i 번째 불리언 값(또는, i 번째 비트가)이 참(true)(또는, 1)로 세트된다. 따라서, 원본 배열(200)의 특정 요소에 대응하는 반복 배열은, 그 요소가 몇 번째 반복에서 갱신되었는지를 기록할 수 있다.If one of the elements of the original array 200 is updated in the i th iteration of the loop 300, the monitoring code in the loop 300 updates the value of the i th element of the iterative array of the updated element. . That is, among the L boolean values (or bit strings), the i th Boolean value (or i th bit), which is the value of the i th element of the iterative array of updated elements, is true (or 1). Set to). Thus, a repeating arrangement corresponding to a particular element of the original array 200 may record at which iteration the element was updated.

또한, 반복 배열의 값들을 모두 논리 합(OR)함으로써 논리 합된 반복 배열을 생성하면, 논리합된 반복 배열의 요소들은 1부터 L까지의 반복들 중 특정 요소가 갱신된 반복을 참으로, 그렇지 않은 반복을 거짓(false)으로 순서대로 나타낸다.In addition, if a logical sum is generated by ORing all the values of the repeating array, the elements of the ORed array are true that the specific element of the 1 to L iterations is updated. Are listed in false order.

모니터링 데이터 구조는 하나의 배열로서 구성될 수 있다. 모니터링 데이터 구조는 원본 배열(200) 및 상기 원본 배열(200)의 각 요소에 대한 반복 배열들을 포함하는 단일한 배열을 포함할 수 있다. 즉, 모니터링 데이터 구조는 원본 배열(200) 및 상기 원본 배열(200)의 복수 개의 요소들 각각에 대한 반복 배열에 대응하는 단일한 배열 k+1 차원의 배열일 수 있다.The monitoring data structure may be configured as one array. The monitoring data structure may comprise a single array including the original array 200 and repeating arrays for each element of the original array 200. That is, the monitoring data structure may be a single array k + 1 dimension array corresponding to the original array 200 and a repeating array for each of the plurality of elements of the original array 200.

예컨대, 원본 배열이 k 차원의 배열이라면, 모니터링 데이터 구조는 k+1 차원의 배열일 수 있다.For example, if the original array is an array of k dimensions, the monitoring data structure may be an array of k + 1 dimensions.

도 4의 모니터링 데이터 구조(400)는 단일한 배열을 포함하는 모니터링 데이터 구조(400)의 일 예를 나타낸다.Monitoring data structure 400 of FIG. 4 shows an example of monitoring data structure 400 that includes a single arrangement.

원본 배열(200)이 2 차원 배열일 때, 모니터링 데이터 구조(400)는 3차원의 배열일 수 있다.When the original array 200 is a two dimensional array, the monitoring data structure 400 may be a three dimensional array.

모니터링 데이터 구조(400)의 제1 차원(410)의 범위(range)는 원본 배열의 제1 차원의 범위(range)와 동일하다. 또한, 모니터링 데이터 구조(400)의 제2 차원(420)의 범위(range)는 원본 배열의 제2 차원의 범위(range)와 동일하다.The range of the first dimension 410 of the monitoring data structure 400 is the same as the range of the first dimension of the original arrangement. Also, the range of the second dimension 420 of the monitoring data structure 400 is the same as the range of the second dimension of the original arrangement.

즉, 원본 배열(200)이 k 차원의 배열일 때, 모니터링 데이터 구조(400)의 제1 내지 제k 차원의 범위들은 각각 원본 배열(200)의 대응하는 차원의 범위와 동일하다.That is, when the original array 200 is a k-dimensional array, the ranges of the first through k-th dimensions of the monitoring data structure 400 are each the same as the range of the corresponding dimension of the original array 200.

모니터링 데이터 구조(400)의 제3 차원(430)은 전술된 반복 배열에 대응한다. 모니터링 데이터 구조(400)의 제3 차원의 범위는 1 내지 L이다. 도 4에서, L = 4이다.The third dimension 430 of the monitoring data structure 400 corresponds to the iterative arrangement described above. The third dimension of the monitoring data structure 400 ranges from 1 to L. FIG. In FIG. 4, L = 4.

도 4에서, 모니터링 데이터 구조(400)의 제1 차원(410)의 크기는 2이고, 제2 차원(420)의 크기는 2이고, 제3 차원(430)의 크기는 4이다. 모니터링 데이터 구조(400)의 요소는 4 개의 불리언 값들이다.In FIG. 4, the size of the first dimension 410 of the monitoring data structure 400 is two, the size of the second dimension 420 is two, and the size of the third dimension 430 is four. The element of monitoring data structure 400 is four Boolean values.

이 중, 원본 배열(200)의 matrix(1, 1)에 대응하는 모니터링 데이터 구조(400)의 요소는 제1 차원이 1이고, 제2 차원이 2인 4 개의 요소들(440, 442, 444 및 446)이다.Among them, the elements of the monitoring data structure 400 corresponding to the matrix (1, 1) of the original array 200 have four elements 440, 442, 444 having a first dimension of 1 and a second dimension of 2. And 446).

모니터링 데이터 구조(400)의 각 요소는 전술된 반복 배열의 요소들이다. 즉, 모니터링 데이터 구조(400)의 각 요소는 L 개의 불리언 값들의 배열(또는, 길이가 L인 비트 스트링)이다.Each element of the monitoring data structure 400 is an element of the repeating arrangement described above. That is, each element of the monitoring data structure 400 is an array of L Boolean values (or a bit string of length L).

즉, 모니터링 데이터 구조(400)는 하기의 표 2의 슈도 코드에 의해 선언될 수 있다.That is, the monitoring data structure 400 may be declared by the pseudo code of Table 2 below.

bool[L] matrix_monitor(index 1, index 2, ... , index k, L);bool [L] matrix_monitor (index 1, index 2, ..., index k, L);

여기서, matrix_monitor는 모니터링 데이터 구조(400)의 명칭이다.Here, matrix_monitor is the name of the monitoring data structure 400.

index 1 내지 index k는 k 차원인 원본 배열의 각 차원의 범위를 나타낸다.index 1 to index k represent the range of each dimension of the original array that is k-dimensional.

L은, 전술된 것처럼, 루프(300)의 반복 횟수이다.L is the number of iterations of the loop 300, as described above.

여기서, 모니터링 구조(400)는, bool 값을 요소로 갖는 k+2 차원의 배열으로서 선언될 수 있다. k+2 차원의 배열은 하기의 표 3의 슈도 코드에 의해 선언될 수 있다.Here, the monitoring structure 400 can be declared as an array of k + 2 dimensions with bool values as elements. An array of k + 2 dimensions may be declared by the pseudo code of Table 3 below.

bool matrix_monitor(index 1, index 2, ... , index k, L, L);bool matrix_monitor (index 1, index 2, ..., index k, L, L);

도 5는 본 발명의 일 예에 따른 모니터링 코드를 나타낸다.5 shows a monitoring code according to an example of the present invention.

도 5에서, 모니터링 코드(510)가 삽입된 루프(500)가 도시되었다.In FIG. 5, the loop 500 with the monitoring code 510 inserted is shown.

모니터링 코드(510) 내에서, matrix_monitor(x, y, i)(520)의 값이 갱신된다.Within the monitoring code 510, the value of matrix_monitor (x, y, i) 520 is updated.

즉, 원본 배열(200) 요소들 중 인덱스 x 및 y에 의해 특정되는 요소(320)가 "ex_function()"(330)에 의해 갱신되고, 모니터링 데이터 구조(400)의 요소들 중 인덱스 x, y 및 i에 의해 특정되는 요소(520)가 "mark(i)"(530)에 의해 갱신된다.That is, the element 320 specified by the indexes x and y of the elements of the original array 200 is updated by the "ex_function ()" 330, and the indexes x and y of the elements of the monitoring data structure 400. And the element 520 specified by i is updated by " mark (i) "

"mark(i)"(530)는 길이가 L인 불리언 배열 중 i 번째 요소의 값을 참으로 변경하는 함수이다. 즉, "mark(i)" 함수(530)에 의해, 모니터링 데이터 구조(400)의 요소들 중 인덱스 x, y 및 i에 의해 특정되는 요소(520)의 i 번째 불리언 값이 참으로 갱신된다."mark (i)" 530 is a function that changes the value of the i th element of a Boolean array of length L to true. That is, by the " mark (i) " function 530, the i &lt; th &gt; Boolean value of the element 520 specified by the indexes x, y, and i of the elements of the monitoring data structure 400 is updated to true.

도 6은 본 발명의 일 예에 따른 루프 실행 중의 모니터링 데이터 구조의 갱신을 나타낸다.6 illustrates an update of the monitoring data structure during loop execution according to an example of the present invention.

루프(300)를 포함하는 실행 코드가 실행되면, 루프(300)가 반복된다.When the executable code including the loop 300 is executed, the loop 300 is repeated.

루프(300)가 2 번째 반복될 때, 원본 배열(200)의 요소들 중 matrix(1, 1)이 갱신된다. 즉, 루프(300)가 2 번째 반복될 때, x = 1, y = 1가 된다.When the loop 300 repeats a second time, the matrix (1, 1) of the elements of the original array 200 is updated. That is, when loop 300 is repeated a second time, x = 1 and y = 1.

이 때, 모니터링 코드(510)에 의해 모니터링 데이터 구조(400) 중 matrix_monitor(1, 1, 2)(442)이 갱신된다. 즉, matrix_monitor(1, 1, 2)이 가리키는 불리언 배열(610) 중 2 번째 요소(620)의 값이 참으로 갱신된다. 만일, 모니터링 데이터 구조(400)의 요소가 비트 스트링이면, matrix_monitor(1, 1, 2)이 가리키는 비트 스트링이 "0010"으로 갱신된다.
At this time, the matrix_monitor (1, 1, 2) 442 of the monitoring data structure 400 is updated by the monitoring code 510. That is, the value of the second element 620 of the Boolean array 610 pointed to by matrix_monitor (1, 1, 2) is true updated. If the element of the monitoring data structure 400 is a bit string, the bit string pointed to by matrix_monitor (1, 1, 2) is updated to "0010".

도 7은 본 발명의 일 예에 따른 루프 실행이 완료된 후의 모니터링 데이터 구조를 나타낸다.7 illustrates a monitoring data structure after loop execution is completed according to an embodiment of the present invention.

도 7에서, 루프(300)의 제1 반복에서 matrix(2, 2)가 갱신되고, 제2 반복에서 matrix(1, 1)이 갱신되고, 제3 반복에서 matrix(2, 1)가 갱신되고, 제4 반복에서 matrix(1, 2)가 갱신되었을 때, 모니터링 데이터 구조(400)의 값이 표현되었다.In FIG. 7, matrix (2, 2) is updated at the first iteration of loop 300, matrix (1, 1) is updated at the second iteration, matrix (2, 1) is updated at the third iteration, and When the matrix (1, 2) is updated in the fourth iteration, the value of the monitoring data structure 400 is represented.

모니터링 데이터 구조(400)의 요소인 불리언 배열에서, 사선이 그어진 부분이 값이 참인 불리언 요소를 나타내고, 빈 부분이 값이 거짓인 불리언 요소를 나타낸다.
In the Boolean array that is an element of the monitoring data structure 400, the hatched portion represents the Boolean element whose value is true, and the blank portion represents the Boolean element whose value is false.

도 8은 본 발명의 일 예에 따른 병렬화된 루프를 나타낸다.8 illustrates a parallelized loop according to an example of the present invention.

우선, 병렬화 포인트를 기준으로 루프의 병렬화를 설명한다.First, the parallelism of the loop will be described based on the parallelization point.

병렬화 포인트는 루프(300)를 2 개의 서브 루프(810 및 820)들로 분할하는 지점이다.The parallelization point is the point at which loop 300 divides into two sub-loops 810 and 820.

도 7에서, 병렬화 포인트에 의해 루프(300)는 범위가 1 내지 2인 제1 서브 루프(810) 및 범위가 3 내지 4인 제2 서브 루프(820)로 분할되었다.In FIG. 7, by the parallelization point, the loop 300 is divided into a first sub-loop 810 in a range of 1 to 2 and a second sub-loop 820 in a range of 3 to 4.

병렬화된 루프들(810 및 820)을 포함하는 소스 코드는 컴파일 등을 통해 실행 코드로 변환될 수 있다. 변환된 실행 코드는 다중 노드(node) 환경의 복수 개의 노드들에 의해 수행된다.Source code including the parallelized loops 810 and 820 may be converted into executable code through compilation or the like. The converted executable code is executed by a plurality of nodes in a multi-node environment.

상단의 "if" 문(statement)(830)에 의해, 제1 서브 루프(810)는 제1 노드에 의해 실행된다. 또한, 중단의 "else if" 문(840)에 의해, 제2 서브 루프(820)는 제2 노드에 의해 실행된다.By means of the upper "if" statement 830, the first sub-loop 810 is executed by the first node. Also, with an abort " else if " statement 840, the second sub-loop 820 is executed by the second node.

마지막 "merge()" 함수(850)에 의해 제1 노드에 의해 갱신된 원본 행렬(200) 및 제2 노드에 의해 갱신된 원본 행렬(200)이 병합된다.The last " merge () " function 850 merges the original matrix 200 updated by the first node and the original matrix 200 updated by the second node.

병렬화 포인트는 특정한 예측 방법에 의해서 결정될 수 있고, 임의로 결정될 수 있다. 즉, 임의로 수 개의 병렬화 포인트들이 설정될 수 있고, 그 중 특정 조건을 만족시키는 병렬화 포인트를 기준으로 루프(300)가 분할될 수 있다.The parallelization point may be determined by a particular prediction method, and may be arbitrarily determined. That is, several parallelization points may be arbitrarily set, and the loop 300 may be divided based on the parallelization point that satisfies a specific condition.

특정 병렬화 포인트에 의해 루프(300)가 병렬화될 수 있는지 여부는 모니터링 데이터 구조(400)의 결과 값에 기반하여 판단될 수 있다.Whether the loop 300 may be parallelized by a particular parallelization point may be determined based on the result value of the monitoring data structure 400.

즉, 모니터링 데이터 구조(400)의 요소에 대한 OR 연산을 통해, 구간에 포함되는 반복들 내에서 어떤 요소가 갱신되었는지가 판별될 수 있다. 또한, 병렬화 포인트에 의해 구분되는 제1 구간 및 제2 구간 각각에서 어떤 요소들이 갱신되었는지가 판별될 수 있다.That is, an OR operation on an element of the monitoring data structure 400 may determine which element is updated within the iterations included in the interval. In addition, it may be determined which elements are updated in each of the first section and the second section divided by the parallelization point.

만약, 제1 구간에서 갱신된 요소들 및 제2 구간에서 갱신된 요소들 중 겹치는 것이 있다면(즉, 특정 요소가 제1 구간 및 제2 구간 양자에서 갱신되었으면), 제1 구간 및 제2 구간은 병렬로 수행될 수 없다.If there is an overlap between the elements updated in the first section and the elements updated in the second section (that is, if a specific element is updated in both the first section and the second section), the first section and the second section It cannot be done in parallel.

반면, 제1 구간에서 갱신된 요소들 및 제2 구간에서 갱신된 요소들 중 겹치는 것이 없다면(즉, 원본 배열(200) 내의 모든 요소가 최대 1 개의 구간(즉, 제1 구간 및 제2 구간 중 단지 하나의 구간)에서만 갱신되었으면, 제1 구간 및 제2 구간은 병렬로 수행될 수 있다. 따라서, 제1 구간 및 제2 구간을 나눈 병렬화 포인트에 의해 루프(300)는 제1 서브 루프(810) 및 제2 서브 루프(820)로 분할될 수 있다.On the other hand, if there is no overlap among the elements updated in the first section and the elements updated in the second section (that is, all elements in the original array 200 are at most one section (that is, among the first section and the second section). If only one section is updated, the first section and the second section may be performed in parallel, so that the loop 300 is divided into the first sub-loop 810 by the parallelization point that divides the first section and the second section. ) And the second sub-loop 820.

도 6에서, 제1 구간에 속하는 제1 반복 및 제2 반복에서, matrix(2, 2) 및 matrix(1, 1)이 갱신되었다. 제2 구간에 속하는 제3 반복 및 제4 반복에서, matrix(2, 1) 및 matrix(1, 2)가 갱신되었다. 따라서, 제1 구간 및 제2 구간은 병렬화되어 수행될 수 있다.In FIG. 6, in the first iteration and the second iteration belonging to the first section, the matrix (2, 2) and the matrix (1, 1) have been updated. In the third and fourth iterations belonging to the second interval, the matrix (2, 1) and matrix (1, 2) were updated. Therefore, the first section and the second section may be performed in parallel.

제1 반복에서 갱신되는 모니터링 데이터 구조(400)의 요소들은 "matrix_monitor(*, *, 1)"과 같이 표현될 수 있다.Elements of the monitoring data structure 400 that are updated in the first iteration may be expressed as "matrix_monitor (*, *, 1)".

또한, 제1 반복 또는 제2 반복에서 갱신되는 모니터링 데이터 구조(400)의 요소들은 논리 합으로써 표현될 수 있다. 즉, 제1 구간에 해당하는 제1 반복 및 제2 반복에서 갱신되는 모니터링 데이터 구조(400)의 요소들은 "matrix_monitor(*, *, 1) OR matrix_monitor(*, *, 2)"로 표현될 수 있다. 제2 구간에 해당하는 제3 반복 및 제4 반복에서 갱신되는 모니터링 데이터 구조(400)의 요소들은 "matrix_monitor(*, *, 3) OR matrix_monitor(*, *, 4)"로 표현될 수 있다.In addition, the elements of the monitoring data structure 400 that are updated in the first iteration or the second iteration may be represented as a logical sum. That is, elements of the monitoring data structure 400 updated in the first iteration and the second iteration corresponding to the first interval may be expressed as "matrix_monitor (*, *, 1) OR matrix_monitor (*, *, 2)". have. Elements of the monitoring data structure 400 updated in the third and fourth iterations corresponding to the second interval may be expressed as "matrix_monitor (*, *, 3) OR matrix_monitor (*, *, 4)".

제1 구간 및 제2 구간에서 갱신되는 모니터링 데이터 구조(400)의 요소들은 논리 곱으로써 표현될 수 있다. 즉, 제1 구간 및 제2 구간 양자에서 갱신되는 모니터링 데이터 구조(400)의 요소들은 하기의 표 4와 같이 표현될 수 있다.Elements of the monitoring data structure 400 updated in the first and second intervals may be represented as a logical product. That is, elements of the monitoring data structure 400 updated in both the first section and the second section may be expressed as shown in Table 4 below.

( matrix_monitor(*,*,1) OR matrix_monitor(*,*,2) ) AND ( matrix_monitor(*,*,3) OR matrix_monitor(*,*,4) )(matrix_monitor (*, *, 1) OR matrix_monitor (*, *, 2)) AND (matrix_monitor (*, *, 3) OR matrix_monitor (*, *, 4))

상기의 수학식 4의 결과가 0(또는, 공집합)이라는 것은, 모니터링 데이터 구조(400)의 요소들 중 어떤 요소도 양 구간들에서 중복되어 갱신되지 않는다는 것을 의미한다. 따라서, 이러한 경우, 양 구간들은 병렬로 수행될 수 있다.The result of Equation 4 above being 0 (or empty set) means that none of the elements of the monitoring data structure 400 is updated in both intervals. Thus, in this case, both sections can be performed in parallel.

다음으로, 병렬화 포인트가 하나 이상인 경우를 검토한다. 즉, 루프(200)가 k 개의 구간들로 분할된 경우를 검토한다.Next, consider the case where there is more than one parallelization point. That is, the case where the loop 200 is divided into k sections is considered.

원본 배열(200)의 복수 개의 요소들 중 제x 요소가 k 개의 구간들 중, 특정한 제y 구간에서 갱신되었는지 여부가 판단될 수 있다.It may be determined whether the x th element of the plurality of elements of the original array 200 is updated in the specific y th period among the k periods.

즉, 제x 요소에 대응하는 반복 배열의 요소들 중, 상기의 제 y 구간이 포함하는 반복들에 대응하는 인덱스들의 요소들의 값들을 논리합 한 값에 기반하여 판단될 수 있다.That is, among the elements of the repetition array corresponding to the x th element, it may be determined based on a logical OR of values of elements of the indices corresponding to the repetitions included in the y th interval.

예컨대, 제1 구간이 포함하는 반복들이 제1 반복 및 제2 반복이면, 2 개의 반복들에 대응하는 인덱스는 "1" 및 "2"이다. 원본 배열(200)의 제x 요소에 대응하는 반복 배열의 제1 요소(즉, 반복 배열의 제1 불리언 배열) 및 제2 요소(즉, 반복 배열의 제2 불리언 배열)의 값을 논리 합함으로써(즉, 제1 불리언 배열의 각 요소들 및 제2 불리언 배열의 각 요소들을 서로 논리합함으로써 논리합된 불리언 배열을 생성함으로써), 제x 요소가 제1 구간에서 갱신되었는지 여부가 판단될 수 있다.For example, if the repetitions included in the first interval are the first repetition and the second repetition, the indexes corresponding to the two repetitions are “1” and “2”. By logical sum of the values of the first element of the repeating array (ie, the first Boolean array of the repeating array) and the second element (ie, the second Boolean array of the repeating array) corresponding to the xth element of the original array 200. (Ie, by generating an ORed Boolean array by ORing each element of the first Boolean array and each element of the second Boolean array), it may be determined whether the x th element is updated in the first interval.

따라서, 전술된 방법을 사용하여 원본 배열(200)의 제x 요소가 k 개의 구간들 중 제y 구간 및 제z 구간에서 중복 갱신되었는지 여부가 판단될 수 있다. 즉, 제y 구간에 대한 제1 논리합된 불리언 배열을 생성하고, 제z 구간에 대한 제2 논리합된 불리언 배열을 생성하고, 제1 논리합된 불리언 배열 및 제2 논리합된 불리언 배열을 논리곱한 논리곱된 불리언 배열을 생성함으로써 원본 배열(200)의 제x 요소가 제y 구간 및 제z 구간에서 중복 갱신되었는지 여부가 판단될 수 있다.Therefore, it may be determined whether the x-th element of the original array 200 is duplicated and updated in the y-th and z-th sections of the k sections using the above-described method. That is, the first ANDed Boolean array for the y-th interval is generated, the second ANDed Boolean array for the z-th interval is generated, and the AND is performed by ANDing the first ANDed Boolean array and the second ANDed Boolean array By generating the Boolean array, it may be determined whether the x-th element of the original array 200 is updated in the y-th and z-th periods.

논리곱된 불리언 배열이 참 값을 갖는 요소를 포함한 경우, 특정한 요소가 제y 구간 및 제z 구간에서 중복된 것이다.If the ANDed Boolean array contains elements with true values, then certain elements are duplicates in the y-th and z-th periods.

상기의 설명은, k가 3 이상인 경우에도 적용될 수 있다. 이 경우, 제1 논리합된 불리언 배열 내지 제k 논리합된 불리언 배열 중 가능한 모든 논리합된 블리언 배열 쌍을 논리곱함으로써 제x 요소가 특정한 2 개의 구간에서 중복 갱신되었는지 여부가 판단될 수 있다.The above description can also be applied when k is 3 or more. In this case, it may be determined whether the x-th element is duplicated and updated in two specific sections by performing an AND operation on all possible OR pairs of the paired Boolean array pairs among the first AND-Boolean Boolean arrays.

원본 배열(200)의 모든 요소에 대해, 상기의 논리합을 계산 및 검사함으로써 k 개의 구간들이 병렬 수행될 수 있는지 여부가 판단될 수 있다. 즉, 원본 배열(200)의 모든 요소가 중복 갱신되지 않았으면, k 개의 구간들은 병렬 수행될 수 있다.For all elements of the original array 200, it can be determined whether k intervals can be performed in parallel by calculating and checking the OR. That is, if all elements of the original array 200 are not duplicated and updated, k sections may be performed in parallel.

도 9는 본 발명의 일 실시예에 따른 배열의 요소들에 대한 연산의 병렬화 장치의 구조도이다.9 is a structural diagram of an apparatus for parallelizing an operation on elements of an array according to an embodiment of the present invention.

병렬화 장치(900)는 병렬화 대상 객체 선택부(910)를 포함할 수 있다.The parallelization apparatus 900 may include a parallelization object selection unit 910.

병렬화 장치(910)는 모니터링 코드 삽입부(920), 결과 값 획득부(930), 구간 결정부(940), 중복 갱신 요소 판단부(950) 및 소스 코드 갱신부(960)를 포함한다.The parallelizing apparatus 910 includes a monitoring code inserting unit 920, a result value obtaining unit 930, a section determining unit 940, a duplicate update element determining unit 950, and a source code updating unit 960.

병렬화 대상 객체 선택부(910)는 소스 코드 내에서 제1 배열을 선택하고, 소스 코드 내에서 루프를 선택한다. 제1 배열은 전술된 원본 배열(200)일 수 있다. 루프는 전술된 병렬화의 대상이 되는 루프(300)일 수 있다.The parallelization object selection unit 910 selects a first array in the source code, and selects a loop in the source code. The first arrangement may be the original arrangement 200 described above. The loop may be a loop 300 that is subject to the parallelism described above.

모니터링 코드 삽입부(920)는 소스 코드 내의 루프 내부에 모니터링 코드를 삽입한다. 루프는 제1 배열의 복수 개의 요소들에게 값을 할당한다. 상기 모니터링 코드는 모니터링 데이터 구조를 포함하고, 모니터링 데이터 구조는 루프의 각 반복에서 제1 배열의 복수 개의 요소들 중 어떤 요소가 갱신되었는지를 기록한다.The monitoring code inserter 920 inserts the monitoring code into a loop in the source code. The loop assigns values to a plurality of elements of the first array. The monitoring code includes a monitoring data structure, which records which element of the plurality of elements of the first array has been updated at each iteration of the loop.

제1 배열이 k 차원이면, 모니터링 데이터 구조는 k 차원의 요소들 각각이 루프의 몇 번째 반복들에서 갱신되었는지를 나타낼 수 있다.If the first arrangement is k-dimensional, the monitoring data structure may indicate at which iterations of the loop each of the elements of k-dimensional were updated.

루프의 반복 횟수는 L로 나타낼 수 있다.The number of iterations of the loop may be represented by L.

모니터링 데이터 구조는 제1 배열의 복수 개의 요소들 각각에 대한 제2 배열을 포함할 수 있다. 제2 배열은 전술된 반복 배열일 수 있다.The monitoring data structure may comprise a second arrangement for each of the plurality of elements of the first arrangement. The second arrangement may be the repeating arrangement described above.

모니터링 데이터 구조는 제1 배열 및 제1 배열의 복수 개의 요소들 각각에 대한 제2 배열에 대응하는 k+1 차원의 배열일 수 있다. The monitoring data structure may be an array of k + 1 dimensions corresponding to the first array and the second array for each of the plurality of elements of the first array.

이 때, 제2 배열은 크기가 L인 1차원 배열일 수 있고, 제2 배열의 요소들 각각은 L개의 불리언(Boolean) 값들의 배열일 수 있다.In this case, the second array may be a one-dimensional array having a size L, and each of the elements of the second array may be an array of L Boolean values.

모니터링 코드는, 루프의 i 번째 반복에서 제1 배열의 복수 개의 요소들 중 특정 요소가 갱신되면, 상기 갱신된 요소에 대응하는 제2 배열의 i 번째 요소의 i 번째 불리언 값을 참(ture)으로 세트할 수 있다.The monitoring code sets the i-th Boolean value of the i-th element of the second array corresponding to the updated element to true when a particular one of the plurality of elements of the first array is updated in the i-th iteration of the loop. I can set it.

결과 값 획득부(930)는 루프의 실행이 종료된 후의 모니터링 데이터 구조의 결과 값을 획득한다.The result value obtaining unit 930 obtains a result value of the monitoring data structure after the execution of the loop ends.

구간 결정부(940)는 루프에 대한 n 개의 구간들을 결정한다. n은 2 이상의 정수이고, 루프의 각 반복은 n 개의 구간들 중 하나의 구간에 포함된다.The interval determiner 940 determines n intervals for the loop. n is an integer of 2 or more, and each repetition of the loop is included in one of n intervals.

n은 2일 수 있다. 이 경우, 제1 구간은 상기 루프가 수행하는 반복들 중 앞부분일 수 있고, 제2 구간은 상기 반복들 중 뒷부분일 수 있다.n may be 2. In this case, the first section may be the front of the iterations performed by the loop, and the second section may be the back of the iterations.

중복 갱신 요소 판단부(950)는 결과 값에 기반하여, 제1 배열의 복수 개의 요소들 중 중복 갱신 요소가 있는지 여부를 판단한다. 중복 갱신 요소는 n 개의 구간들 중 2 개 이상의 구간들에서 갱신되는 요소이다.The duplicate update element determiner 950 determines whether there is a duplicate update element among a plurality of elements of the first array based on the result value. The duplicate update element is an element that is updated in at least two of the n periods.

중복 갱신 요소 판단부(950)는, 제1 배열의 복수 개의 요소들 중 제x 요소에 대응하는 제2 배열의 요소들 중, 제y 구간이 포함하는 반복들에 대응하는 인덱스들의 요소들의 값들을 논리합 한 값에 기반하여, 제x 요소가 상기 k 개의 구간들 중 상기 제y 구간에서 갱신되었는지 여부를 판단할 수 있다.The duplicate update element determiner 950 may determine values of elements of indices corresponding to repetitions included in the y th interval among the elements of the second array corresponding to the x th element of the plurality of elements of the first array. Based on the OR value, it may be determined whether the x th element is updated in the y th period among the k periods.

중복 갱신 요소 판단부(950)는, 제1 배열의 복수 개의 요소들 중 제x 요소에 대응하는 제2 배열의 요소들 중, 제y 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제1 논리합을 계산하고, 제z 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제2 논리합을 계산하고, 상기 제1 논리합 및 상기 제2 논리합을 논리곱함으로써, 제x 요소가 k 개의 구간들 중 제y 구간 및 제z 구간에서 중복 갱신되었는지 여부를 판단할 수 있다.The duplicate update element determiner 950 may select values of elements of an index corresponding to repetitions included in the y th interval among the elements of the second array corresponding to the x th element of the plurality of elements of the first array. Computing the first logical OR, calculating the second logical OR of the values of the elements of the index corresponding to the repetitions included in the z-th interval, and ORing the first logical OR and the second logical OR, It is possible to determine whether the x element is duplicately updated in the y th section and the z th section among k sections.

소스 코드 갱신부(960)는 중복 갱신 요소가 발견되지 않은 경우, 루프를 병렬로 실행되는 n 개의 구간들 각각에 대한 루프들로 분할하여 소스 코드를 갱신한다.If no duplicate update element is found, the source code updater 960 updates the source code by dividing the loop into loops for each of the n sections executed in parallel.

앞서 도 1 내지 도 8을 참조하여 설명된 본 발명의 일 실시예에 따른 기술 적 내용들이 본 실시예에도 그대로 적용될 수 있다. 따라서 보다 상세한 설명은 이하 생략하기로 한다.Technical contents according to an embodiment of the present invention described above with reference to FIGS. 1 to 8 may be applied to the present embodiment as it is. Therefore, more detailed description will be omitted below.

상기 구성요소들(910 내지 960)의 기능은 단일한 제어부(도시되지 않음)에서 수행될 수 있다. 이때, 상기 제어부는 단일(single) 또는 복수(multi) 칩(chip), 프로세서(processor) 또는 코어(core)를 나타낼 수 있다. 상기 구성요소들(910 내지 960) 각각은 상기 제어부에서 수행되는 함수(function), 라이브러리(library), 서비스(service), 프로세스(process), 쓰레드(thread) 또는 모듈(module)을 나타낼 수 있다.
The functions of the components 910 through 960 may be performed by a single controller (not shown). In this case, the controller may represent a single or multi chip, a processor, or a core. Each of the components 910 to 960 may represent a function, a library, a service, a process, a thread, or a module that is performed by the controller.

본 발명의 일 실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 롬(ROM), 램(RAM) 및 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 본 발명의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Method according to an embodiment of the present invention is implemented in the form of program instructions that can be executed by various computer means may be recorded on a computer readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be those specially designed and constructed for the present invention or may be available to those skilled in the art of computer software. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as CD-ROMs, DVDs, and magnetic disks, such as floppy disks. Hardware devices specially configured to store and execute program instructions, such as magneto-optical media, ROM, RAM and flash memory, are included. Examples of program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like. The hardware device described above may be configured to operate as one or more software modules to perform the operations of the present invention, and vice versa.

이상과 같이 본 발명은 비록 한정된 실시예와 도면에 의해 설명되었으나, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다.As described above, the present invention has been described by way of limited embodiments and drawings, but the present invention is not limited to the above embodiments, and those skilled in the art to which the present invention pertains various modifications and variations from such descriptions. This is possible.

그러므로, 본 발명의 범위는 설명된 실시예에 국한되어 정해져서는 아니 되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.Therefore, the scope of the present invention should not be limited to the described embodiments, but should be determined by the equivalents of the claims, as well as the claims.

900: 배열의 요소들에 대한 연산의 병렬화 장치
920: 모니터링 코드 삽입 부
930: 구간 결정부
960: 소스 코드 갱신부
900: device for parallelizing operations on elements of an array
920: monitoring code insertion unit
930: interval determination unit
960: update source code

Claims (20)

소스 코드 내의 루프 내부에 모니터링 코드를 삽입하는 단계 - 상기 루프는 제1 배열의 복수 개의 요소들에게 값을 할당함. 상기 모니터링 코드는 모니터링 데이터 구조를 포함하고, 상기 모니터링 데이터 구조는 상기 루프의 각 반복에서 상기 제1 배열의 복수 개의 요소들 중 어떤 요소가 갱신되었는지를 기록함. -;
상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는 단계;
상기 루프에 대한 n 개의 구간들을 결정하는 단계 - 상기 n은 2 이상의 정수임, 상기 루프의 각 반복은 상기 n 개의 구간들 중 하나의 구간에 포함됨. -;
상기 결과 값에 기반하여, 상기 제1 배열의 복수 개의 요소들 중 중복 갱신 요소가 있는지 여부를 판단하는 단계 - 상기 중복 갱신 요소는 상기 n 개의 구간들 중 2 개 이상의 구간들에서 갱신되는 요소임. -; 및
상기 중복 갱신 요소가 발견되지 않은 경우, 상기 루프를 병렬로 실행되는 상기 n 개의 구간들 각각에 대한 루프들로 분할하여 상기 소스 코드를 갱신하는 단계
를 포함하는, 배열의 요소들에 대한 연산의 병렬화 방법.
Inserting monitoring code inside a loop in the source code, the loop assigning values to the plurality of elements of the first array. The monitoring code comprises a monitoring data structure, the monitoring data structure recording which of the plurality of elements of the first array has been updated at each iteration of the loop. -;
Obtaining a result value of the monitoring data structure after execution of the loop ends;
Determining n sections for the loop, where n is an integer greater than or equal to 2, each iteration of the loop being included in one of the n sections. -;
Determining whether there is a duplicate update element among a plurality of elements of the first array based on the result value, wherein the duplicate update element is an element that is updated in at least two of the n periods. -; And
If the duplicate update element is not found, dividing the loop into loops for each of the n intervals executed in parallel to update the source code
And a method for parallelizing an operation on elements of an array.
제1항에 있어서,
상기 소스 코드 내에서 상기 제1 배열을 선택하는 단계; 및
상기 소스 코드 내에서 상기 루프를 선택하는 단계
를 더 포함하는, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 1,
Selecting the first arrangement in the source code; And
Selecting the loop within the source code
Further comprising a method of parallelism of the operation on the elements of the array.
제1항에 있어서,
상기 n은 2이고,
제1 구간은 상기 루프가 수행하는 반복들 중 앞부분이고, 제2 구간은 상기 반복들 중 뒷부분인, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 1,
N is 2,
And a first section is a front part of the iterations performed by the loop, and a second section is a later part of the iterations.
제1항에 있어서,
상기 제1 배열은 k 차원이고, 상기 모니터링 데이터 구조는 상기 k 차원의 요소들 각각이 상기 루프의 몇 번째 반복들에서 갱신되었는지를 나타내는, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 1,
Wherein the first arrangement is of k dimension, and wherein the monitoring data structure indicates at which iterations of the loop each of the elements of the k dimension are updated.
제4항에 있어서,
상기 루프의 반복 횟수는 L이고,
상기 모니터링 데이터 구조는 상기 제1 배열의 복수 개의 요소들 각각에 대한 제2 배열을 포함하고, 상기 제2 배열은 크기가 L인 1차원 배열이고, 상기 제2 배열의 요소들 각각은 L개의 불리언(Boolean) 값들의 배열인, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 4, wherein
The number of iterations of the loop is L,
The monitoring data structure includes a second array for each of the plurality of elements of the first array, the second array is a one-dimensional array of size L, and each of the elements of the second array is L Booleans. (Boolean) A method of parallelizing an operation on the elements of an array that is an array of values.
제5항에 있어서,
상기 모니터링 코드는, 상기 루프의 i 번째 반복에서 상기 제1 배열의 복수 개의 요소들 중 특정 요소가 갱신되면, 상기 갱신된 요소에 대응하는 제2 배열의 i 번째 요소의 i 번째 불리언 값을 참(ture)으로 세트하는, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 5,
The monitoring code is set to true if the i-th Boolean value of the i-th element of the second array corresponding to the updated element is updated when a particular element of the plurality of elements of the first array is updated in the i-th iteration of the loop. method of parallelizing an operation on the elements of an array.
제5항에 있어서,
상기 제1 배열의 복수 개의 요소들 중 제x 요소가 상기 k 개의 구간들 중 제y 구간에서 갱신되었는지 여부는, 상기 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 상기 제y 구간이 포함하는 반복들에 대응하는 인덱스들의 요소들의 값들을 논리합 한 값에 기반하여 판단되는, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 5,
Whether the xth element of the plurality of elements of the first array is updated in the yth period of the k periods, the yth period of the elements of the second array corresponding to the xth element may be A method of parallelizing an operation on elements of an array that is determined based on a value of the OR of the elements of the indices corresponding to the iterations that comprise.
제5항에 있어서,
상기 제1 배열의 복수 개의 요소들 중 제x 요소가 상기 k 개의 구간들 중 제y 구간 및 제z 구간에서 중복 갱신되었는지 여부는, 상기 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 상기 제y 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제1 논리합을 계산하고, 상기 제z 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제2 논리합을 계산하고, 상기 제1 논리합 및 상기 제2 논리합을 논리곱(and)함으로써 판단되는, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 5,
Among the elements of the second array corresponding to the xth element, whether the xth element of the plurality of elements of the first array is duplicated and updated in the yth and zth periods of the k periods, Compute the first logical sum of the values of the elements of the index corresponding to the iterations included in the y th interval, and the second logical sum of the values of the elements of the index corresponding to the iterations included in the z th interval And determining by AND of the first AND and the second AND.
제5항에 있어서,
상기 모니터링 데이터 구조는 상기 제1 배열 및 상기 제1 배열의 복수 개의 요소들 각각에 대한 상기 제2 배열에 대응하는 k+1 차원의 배열인, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 5,
And said monitoring data structure is an array in k + 1 dimension corresponding to said second array for each of said first array and a plurality of elements of said first array.
제1항에 있어서,
상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는 단계는,
상기 소스 코드에 기반한 실행 코드를 생성하는 단계; 및
상기 실행 코드를 실행함으로써 상기 루프의 실행이 종료된 후의 상기 결과 값을 획득하는 단계
를 포함하는, 배열의 요소들에 대한 연산의 병렬화 방법.
The method of claim 1,
Acquiring a result value of the monitoring data structure after execution of the loop ends,
Generating executable code based on the source code; And
Obtaining the result value after execution of the loop ends by executing the execution code
And a method for parallelizing an operation on elements of an array.
소스 코드 내의 루프 내부에 모니터링 코드를 삽입하는 모니터링 코드 삽입부 - 상기 루프는 제1 배열의 복수 개의 요소들에게 값을 할당함. 상기 모니터링 코드는 모니터링 데이터 구조를 포함하고, 상기 모니터링 데이터 구조는 상기 루프의 각 반복에서 상기 제1 배열의 복수 개의 요소들 중 어떤 요소가 갱신되었는지를 기록함. -;
상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는 결과 값 획득부;
상기 루프에 대한 n 개의 구간들을 결정하는 구간 결정부 - 상기 n은 2 이상의 정수임, 상기 루프의 각 반복은 상기 n 개의 구간들 중 하나의 구간에 포함됨. -;
상기 결과 값에 기반하여, 상기 제1 배열의 복수 개의 요소들 중 중복 갱신 요소가 있는지 여부를 판단하는 중복 갱신 요소 판단부 - 상기 중복 갱신 요소는 상기 n 개의 구간들 중 2 개 이상의 구간들에서 갱신되는 요소임. -; 및
상기 중복 갱신 요소가 발견되지 않은 경우, 상기 루프를 병렬로 실행되는 상기 n 개의 구간들 각각에 대한 루프들로 분할하여 상기 소스 코드를 갱신하는 소스 코드 갱신부
를 포함하는, 배열의 요소들에 대한 연산의 병렬화 장치.
Monitoring code insertion section for inserting monitoring code inside the loop in the source code-the loop assigns values to a plurality of elements of the first array. The monitoring code comprises a monitoring data structure, the monitoring data structure recording which of the plurality of elements of the first array has been updated at each iteration of the loop. -;
A result value obtaining unit obtaining a result value of the monitoring data structure after the execution of the loop ends;
An interval determining unit for determining n intervals for the loop, wherein n is an integer of 2 or more, each repetition of the loop is included in one of the n intervals. -;
A duplicate update element determiner that determines whether there is a duplicate update element among the plurality of elements of the first array based on the result value-the duplicate update element is updated in at least two of the n sections; It is a factor. -; And
A source code updater that updates the source code by dividing the loop into loops for each of the n intervals executed in parallel when the duplicate update element is not found
An apparatus for parallelizing an operation on elements of an array comprising a.
제11항에 있어서,
상기 소스 코드 내에서 상기 제1 배열을 선택하고, 상기 소스 코드 내에서 상기 루프를 선택하는 병렬화 대상 객체 선택부
를 더 포함하는, 배열의 요소들에 대한 연산의 병렬화 장치.
The method of claim 11,
A parallelization target object selector that selects the first array in the source code and selects the loop in the source code.
Further comprising a device for parallelizing the operation on the elements of the array.
제11항에 있어서,
상기 n은 2이고,
제1 구간은 상기 루프가 수행하는 반복들 중 앞부분이고, 제2 구간은 상기 반복들 중 뒷부분인, 배열의 요소들에 대한 연산의 병렬화 장치.
The method of claim 11,
N is 2,
And a first section is a front part of the iterations performed by the loop, and a second section is a back part of the iterations.
제11항에 있어서,
상기 제1 배열은 k 차원이고, 상기 모니터링 데이터 구조는 상기 k 차원의 요소들 각각이 상기 루프의 몇 번째 반복들에서 갱신되었는지를 나타내는, 배열의 요소들에 대한 연산의 병렬화 장치.
The method of claim 11,
Wherein the first arrangement is k-dimensional, and wherein the monitoring data structure indicates at which iterations of the loop each of the elements of the k-dimensional are updated.
제14항에 있어서,
상기 루프의 반복 횟수는 L이고,
상기 모니터링 데이터 구조는 상기 제1 배열의 복수 개의 요소들 각각에 대한 제2 배열을 포함하고, 상기 제2 배열은 크기가 L인 1차원 배열이고, 상기 제2 배열의 요소들 각각은 L개의 불리언(Boolean) 값들의 배열인, 배열의 요소들에 대한 연산의 병렬화 장치.
15. The method of claim 14,
The number of iterations of the loop is L,
The monitoring data structure includes a second array for each of the plurality of elements of the first array, the second array is a one-dimensional array of size L, and each of the elements of the second array is L Booleans. (Boolean) A device for parallelizing an operation on elements of an array that is an array of values.
제15항에 있어서,
상기 모니터링 코드는, 상기 루프의 i 번째 반복에서 상기 제1 배열의 복수 개의 요소들 중 특정 요소가 갱신되면, 상기 갱신된 요소에 대응하는 제2 배열의 i 번째 요소의 i 번째 불리언 값을 참(ture)으로 세트하는, 배열의 요소들에 대한 연산의 병렬화 장치.
16. The method of claim 15,
The monitoring code is set to true if the i-th Boolean value of the i-th element of the second array corresponding to the updated element is updated when a particular element of the plurality of elements of the first array is updated in the i-th iteration of the loop. device for parallelizing operations on the elements of an array.
제15항에 있어서,
상기 중복 갱신 요소 판단부는, 상기 제1 배열의 복수 개의 요소들 중 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 제y 구간이 포함하는 반복들에 대응하는 인덱스들의 요소들의 값들을 논리합 한 값에 기반하여, 상기 제x 요소가 상기 k 개의 구간들 중 상기 제y 구간에서 갱신되었는지 여부를 판단하는, 배열의 요소들에 대한 연산의 병렬화 장치.
16. The method of claim 15,
The redundancy update element determiner is configured to OR the values of the elements of the indices corresponding to the repetitions included in the y th interval among the elements of the second array corresponding to the x th element among the plurality of elements of the first array. And determining whether the x-th element is updated in the y-th period of the k periods based on a value.
제15항에 있어서,
상기 중복 갱신 요소 판단부는, 상기 제1 배열의 복수 개의 요소들 중 제x 요소에 대응하는 상기 제2 배열의 요소들 중, 제y 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제1 논리합을 계산하고, 제z 구간이 포함하는 반복들에 대응하는 인덱스의 요소들의 값들을 논리합 한 제2 논리합을 계산하고, 상기 제1 논리합 및 상기 제2 논리합을 논리곱(and)함으로써, 상기 제x 요소가 상기 k 개의 구간들 중 상기 제y 구간 및 상기 제z 구간에서 중복 갱신되었는지 여부를 판단하는, 배열의 요소들에 대한 연산의 병렬화 장치.
16. The method of claim 15,
The redundancy update element determiner is configured to OR the values of the elements of the index corresponding to the repetitions included in the y th interval among the elements of the second array corresponding to the x th element among the plurality of elements of the first array. By calculating a first logical sum, calculating a second logical sum of the values of the elements of the index corresponding to the iterations included in the z interval, and ANDing the first logical sum and the second logical sum And determining whether the x th element is duplicated and updated in the y th and z th periods of the k periods.
제15항에 있어서,
상기 모니터링 데이터 구조는 상기 제1 배열 및 상기 제1 배열의 복수 개의 요소들 각각에 대한 상기 제2 배열에 대응하는 k+1 차원의 배열인, 배열의 요소들에 대한 연산의 병렬화 장치.
16. The method of claim 15,
And said monitoring data structure is an array in k + 1 dimension corresponding to said second array for each of said first array and a plurality of elements of said first array.
제11항에 있어서,
상기 결과 값 획득부는, 상기 소스 코드에 기반한 실행 코드를 생성하고, 상기 실행 코드를 실행함으로써, 상기 루프의 실행이 종료된 후의 상기 모니터링 데이터 구조의 결과 값을 획득하는, 배열의 요소들에 대한 연산의 병렬화 장치.
The method of claim 11,
The result value obtaining unit generates an execution code based on the source code, and executes the execution code to obtain a result value of the monitoring data structure after execution of the loop is terminated. Parallelization unit.
KR1020110001327A 2011-01-06 2011-01-06 Method and apparatus for searching parallelization point of array KR101245494B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020110001327A KR101245494B1 (en) 2011-01-06 2011-01-06 Method and apparatus for searching parallelization point of array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020110001327A KR101245494B1 (en) 2011-01-06 2011-01-06 Method and apparatus for searching parallelization point of array

Publications (2)

Publication Number Publication Date
KR20120079957A true KR20120079957A (en) 2012-07-16
KR101245494B1 KR101245494B1 (en) 2013-03-25

Family

ID=46712740

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020110001327A KR101245494B1 (en) 2011-01-06 2011-01-06 Method and apparatus for searching parallelization point of array

Country Status (1)

Country Link
KR (1) KR101245494B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930795A (en) * 2020-07-02 2020-11-13 苏州浪潮智能科技有限公司 Distributed model searching method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5121498A (en) 1988-05-11 1992-06-09 Massachusetts Institute Of Technology Translator for translating source code for selective unrolling of loops in the source code
JP2009048252A (en) * 2007-08-14 2009-03-05 Oki Electric Ind Co Ltd Program conversion device and compiler program
KR101109009B1 (en) * 2009-11-17 2012-01-31 선문대학교 산학협력단 A method for parallelizing irregular reduction on explicitly managed memory hierarchy

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930795A (en) * 2020-07-02 2020-11-13 苏州浪潮智能科技有限公司 Distributed model searching method and system
CN111930795B (en) * 2020-07-02 2022-11-29 苏州浪潮智能科技有限公司 Distributed model searching method and system

Also Published As

Publication number Publication date
KR101245494B1 (en) 2013-03-25

Similar Documents

Publication Publication Date Title
US8122442B2 (en) Method and system for array optimization
Tan et al. Efficient and precise points-to analysis: modeling the heap by merging equivalent automata
Van Dijk et al. Sylvan: Multi-core decision diagrams
JP4042604B2 (en) Program parallelization apparatus, program parallelization method, and program parallelization program
EP3572952A1 (en) Unified optimization of iterative analytical query processing
US9152389B2 (en) Trace generating unit, system, and program of the same
JP4886838B2 (en) Parallelization method, system, and program
JP5479942B2 (en) Parallelization method, system, and program
Shterenlikht et al. Fortran 2008 coarrays
JP2015219906A (en) Software verification method and processor
Lashgar et al. IPMACC: open source openacc to cuda/opencl translator
Cesare et al. Practical parallelization of scientific applications
KR101245494B1 (en) Method and apparatus for searching parallelization point of array
Coutts et al. Deterministic parallel programming with Haskell
Hoefler et al. Automatic complexity analysis of explicitly parallel programs
JP4787456B2 (en) Parallel program generation device, parallel program generation method, and parallel program generation program
Singh et al. Graffix: Efficient graph processing with a tinge of gpu-specific approximations
Norrish et al. An approach for proving the correctness of inspector/executor transformations
US8549456B2 (en) System and method for circuit design floorplanning
Feldman et al. Efficient Memory Partitioning in Software Defined Hardware
Xu et al. Reduction operations in parallel loops for GPGPUs
Liou et al. Understanding the power of evolutionary computation for gpu code optimization
Fabre et al. Enhancing Multi-threaded legalization through $ k $-d tree circuit partitioning
Gankema Loop-Adaptive Execution in Weld
Save ViennaRNA–Optimizing a Real-world RNA Folding Program

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20151214

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20161227

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20180313

Year of fee payment: 19