CN105260175B - The processing method of astronomy software Gridding based on OpenMP - Google Patents

The processing method of astronomy software Gridding based on OpenMP Download PDF

Info

Publication number
CN105260175B
CN105260175B CN201510591875.8A CN201510591875A CN105260175B CN 105260175 B CN105260175 B CN 105260175B CN 201510591875 A CN201510591875 A CN 201510591875A CN 105260175 B CN105260175 B CN 105260175B
Authority
CN
China
Prior art keywords
circulation
suppv
thread
openmp
calculate
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201510591875.8A
Other languages
Chinese (zh)
Other versions
CN105260175A (en
Inventor
吴韶华
沈铂
王娅娟
张清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510591875.8A priority Critical patent/CN105260175B/en
Publication of CN105260175A publication Critical patent/CN105260175A/en
Application granted granted Critical
Publication of CN105260175B publication Critical patent/CN105260175B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The processing method of the invention discloses a kind of astronomy software Gridding based on OpenMP, comprising: open up nT OpenMP thread, suppv is calculated into circulation be converted to the son that nT execute parallel and calculate circulation.Wherein, it is described suppv calculated into circulation be converted to the son that nT is executed parallel and calculate circulation specifically include: array is divided into nT data block, is each data block one OpenMP thread of distribution;Bs is indexed for the starting that each OpenMP thread distributes data and terminates index be;It is parallel to execute the nT suppv calculating circulations from bs to be.The present invention for Gridding calculate core include three re-computations circulation the characteristics of, by multithreading setting suppv calculate circulation, it is ensured that the data that different cross-threads possesses be it is entirely different, the memory access collision problem during parallelization is avoided with this.

Description

The processing method of astronomy software Gridding based on OpenMP
Technical field
The present invention relates to computer application technology, in particular to a kind of astronomy software based on OpenMP The processing method of Gridding.
Background technique
Square kilometre radio telescope array SKA is the maximum synthesis radiotelescope that will be built in the world, is used In the great number of issues of answer puzzlement at present scientific circles, as how first generation celestial body is formed, galactic evolution, cosmic magnetic field, gravitation Essential, extraterrestrial life and alien civilization, dark matter and dark energy etc..The telescope is by quantity up to 3000 teledish structures At, it will be than current maximum 50 times of centimeter wave synthesis telescope JVLA sensitivity raising after building up, search speed improves 10000 Times.But performance boost also means that the growth of geometry grade will be presented in the speed of SKA gather data and quantity, and according to plan, SKA is per second The data volume of acquisition is greater than 12Tb, needs the sum of the performance of all supercomputers of current TOP500 that could complete data processing.
Gridding is to calculate that step is most complicated, time-consuming most data processing link in SKA, is approached in entire project 50% data need to be handled by the software.Fig. 1 is the program processing figure that Gridding calculates core.As shown in Figure 1, It includes three calculating circulations that Gridding, which calculates core, and outermost circulation is that dind calculates circulation, and intercycle is that suppv is calculated Circulation, most inner side circulation are that suppu calculates circulation, wherein store input data to be treated in samples array.Dind meter When calculating cycle calculations gind and cind value, since samples [dind] .iu and samples [dind] .iv is by generating random number , the gind value calculated accordingly also has randomness, it means that different calculating is recycled, the value of gind may be identical 's.It is introduced for Gridding for by multithreading, if calculating circulation according to dind and carrying out data division, different numbers Identical gind element may be contained according to block, these elements are directed toward same memory address, when these elements are in multi-thread environment It is lower while when being accessed, it will cause that memory read-write is inconsistent, cause the memory access conflict between thread.
Fig. 2 is to calculate the schematic diagram that circulation carries out data division according to dind.It is deposited in data gind as shown in Fig. 2, calculating In some elements with identical value, such as 3,8 and 13.It distributes when by gind to three thread Thread 0,1 and of Thread When in Thread 2, element 3 appears in first position of thread Thread 0 Yu Thread 1, due to thread Thread 0 with Thread 1 starts simultaneously at calculating, this will lead to the two threads and will be operated to the same memory address (because in gind Identical element value is directed toward same memory address), i.e. memory access conflict between generation thread.
Summary of the invention
The place of in order to solve the above technical problem, the present invention provides a kind of astronomy software Gridding based on OpenMP Reason method effectively overcomes and calculates the defect that circulation carries out memory access conflict between data division generation thread according to dind.
In order to reach the object of the invention, the place of the present invention provides a kind of astronomy software Gridding based on OpenMP Reason method, comprising:
NT OpenMP thread is opened up, wherein nT is the total number of thread;
Suppv is calculated into circulation and is converted to the nT son calculating circulations executed parallel.
Further, it is described suppv calculated into circulation be converted to the son that nT is executed parallel and calculate circulation specifically include:
Array is divided into nT data block, distributes an OpenMP thread for each data block;
Bs is indexed for the starting that each OpenMP thread distributes data and terminates index be;
It is parallel to execute the nT suppv calculating circulations from bs to be.
Further, the parallel execution nT suppv from bs to be calculate in circulation, and a son calculates circulation tool Body includes:
Suppv=bs is set;
Suppu=0 is set;
Calculate gind array;
Judge whether suppu is less than sSize, be then incremental suppu, re-executes and calculate gind array step, otherwise hold Row next step;
Execute gind=gind+gSize;Cind=cind+sSize;
Judge whether suppv is less than be, be then incremental suppv, re-executes setting suppu=0 step, otherwise execute Dind calculates circulation.
Further, described to open up nT OpenMP thread setting in suppv calculating circulation.
Further, described to open up nT OpenMP thread setting in dind calculating circulation.
The processing method of the present invention provides a kind of astronomy software Gridding based on OpenMP, for Gridding The characteristics of core includes three re-computations circulation is calculated, multithreading setting is calculated in suppv and is recycled, it is ensured that different cross-threads The data possessed be it is entirely different, the memory access collision problem during parallelization is avoided with this.Meanwhile OpenMP thread Expansion and merging are placed on outermost circulation, cause additional load to avoid excessive the opening up and discharge of thread.The present invention Method has the characteristics that high scalability, high efficiency, is easily achieved, and to the effectively optimizing of Gridding, can save huge calculating Investment and daily expenditure of the entire project in terms of computing platform is greatly reduced in effective progress for pushing SKA research by amount, right SKA project and world's astronomical community have very important significance.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the program processing figure that Gridding calculates core;
Fig. 2 is to calculate the schematic diagram that circulation carries out data division according to dind;
Fig. 3 is the schematic diagram of the invention by convolutional calculation map procedures to two-dimensional grid;
Fig. 4 is that the present invention is based on the process flow diagrams of the processing method of the astronomy software Gridding of OpenMP;
Fig. 5 is the process flow diagram of the invention for calculating suppv and recycling and being converted to the son calculating circulation that nT execute parallel;
Fig. 6 is that the present invention is based on the processes of the processing method specific embodiment of the astronomy software Gridding of OpenMP Figure.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
The present invention provides a kind of new data division modes, calculate core for Gridding and recycle comprising three re-computations The characteristics of, data are divided setting and recycled in middle layer by the present invention, i.e., multithreading are arranged and recycle in suppv calculating, avoid Memory access conflict between thread efficiently solves and calculates memory access conflict between circulation progress data division generation thread according to dind Defect.
Gridding according to figure 1, which calculates core process flow, can be seen that its suppu calculating circulation and suppv Calculating circulation is actually to calculate convolution to samples array, and convolution kernels function is array C, the size of calculating be sSize × sSize.Fig. 3 is the schematic diagram of the invention by convolutional calculation map procedures to two-dimensional grid.As shown in figure 3, the present invention pass through by The convolutional calculation map procedures carry out data division to two-dimensional grid, for calculating circulation in suppv, substantially along the two dimension The traveling row data of grid divide, i.e., carry out data division along the direction suppv.After carrying out data division in this way, each thread The task amount got is sSize/nT, and wherein nT is the total number of thread.The range calculated for i-th d thread, suppv Are as follows:
It can be seen that according to data division mode proposed by the present invention, the data volume that each thread obtains is approximately equal, and each The memory block that thread is assigned to is entirely different, is not overlapped between the memory block of each thread, therefore effectively prevents memory access conflict Problem.
Fig. 4 is that the present invention is based on the process flow diagrams of the processing method of the astronomy software Gridding of OpenMP.Such as Fig. 4 Shown, processing method of the present invention includes:
Step 1 opens up nT OpenMP thread;
Suppv is calculated circulation and is converted to the son that nT is executed parallel and calculates circulation by step 2.
In actual use, the present invention shares memory parallel programming OpenMP (Open Multi-Processing) thread Suppv can be both placed on by, which opening up, calculates circulation, can also be placed on dind and calculate circulation.For opening up OpenMP thread It is placed on suppv and calculates circulation, the dind of outer layer calculates the circulation each time of circulation, and the thread of OpenMP then needs to open up and discharge Once.In view of the number that dind calculates circulation is very more, it will lead to excessive thread and open up the cost discharged with thread, this hair It is bright that preferably opening up for OpenMP thread is placed on dind and calculated in circulation, thread open up and thread release only once, from And the expense of thread management is reduced to the full extent.
Suppv is calculated circulation and is converted in the son calculating circulation that nT execute parallel by the present invention, first by gind array It is respectively divided into nT data block with cind array, an OpenMP thread is distributed for each data block, then calculates suppv The size sSize of circulation is also divided into nT parts, makes the calculating in each thread by bs, be terminates.Wherein, OpenMP thread Open up and discharge, array divide, for data block distribute OpenMP thread, OpenMP thread parallel execute etc. be all made of existing skill Art means, which is not described herein again.
Fig. 5 is the process flow diagram of the invention for calculating suppv and recycling and being converted to the son calculating circulation that nT execute parallel. As shown in Figure 5, comprising:
Gind array and cind array are respectively divided into nT data block by step 21, distribute one for each data block OpenMP thread;
Step 22, the starting that data are distributed for each OpenMP thread index bs and terminate index be;
Step 23, parallel a suppv from bs to be of nT that executes calculate circulation.
In practical application, id first can be numbered to each OpenMP thread, be based on number id later, obtain each line The starting index bs of data and termination index be in journey.
The processing method of the present invention provides a kind of astronomy software Gridding based on OpenMP, by well-designed Method for parallel processing solve according to dind calculate circulation carry out data divide generate thread between memory access conflict defect.This Invention calculates the characteristics of core includes three re-computations circulation for Gridding, and multithreading setting is calculated in suppv and is recycled, really Protected the data that different cross-threads possesses be it is entirely different, the memory access collision problem during parallelization is avoided with this. Meanwhile the expansion and merging of OpenMP thread are placed on outermost circulation, cause to avoid excessive the opening up and discharge of thread Additional load.New data proposed by the present invention divide, and data are divided into muti-piece, each piece of size is approximately uniform, each A OpenMP thread gets its corresponding one piece according to the thread number of itself, and number is written to the unique memory headroom of cross-thread According to not only ensuring that the data volume that each thread obtains is approximately equal, and the data for ensuring that each thread possesses do not repeat, greatly Improve the parallel performance of Gridding program.The method of the present invention has the characteristics that high scalability, high efficiency, is easily achieved.
Fig. 6 is that the present invention is based on the processes of the processing method specific embodiment of the astronomy software Gridding of OpenMP Figure.Through this embodiment, it can clearly illustrate technical solution of the present invention.As shown in fig. 6, the present embodiment includes:
Step 31 opens up nT OpenMP thread;
Step 32, setting dind=0;
Step 33 calculates gind array and cind array;
Gind array and cind array are respectively divided into nT data block by step 34, distribute one for each data block OpenMP thread;
Step 35, the starting that data are distributed for each OpenMP thread index bs and terminate index be;
Step 36, setting suppv=bs;
Step 37, setting suppu=0;
Step 38 calculates gind array;
Step 39 judges whether suppu is less than sSize, is that then incremental suppu, execution step 38 are no to then follow the steps 40;
Step 40 executes gind=gind+gSize;Cind=cind+sSize;
Step 41 judges whether suppv is less than be, is that then incremental suppv, execution step 37 are no to then follow the steps 42;
Step 42 judges whether dind is less than int (samples size ()), is then incremental dind, executes step 33, It is no to then follow the steps 43;
Step 43 terminates.
Wherein, step 36~step 41 is that nT OpenMP thread parallel executes.
So far the processing that astronomy software Gridding calculates core is completed, using method of the invention, in multithreading In the case of, the promotion of Gridding performance is approximately linearly, close to theoretical performance.
Although disclosed herein embodiment it is as above, the content only for ease of understanding the present invention and use Embodiment is not intended to limit the invention.Technical staff in any fields of the present invention is taken off not departing from the present invention Under the premise of the spirit and scope of dew, any modification and variation, but the present invention can be carried out in the form and details of implementation Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.

Claims (1)

1. a kind of processing method of the astronomy software Gridding based on OpenMP, it includes that three calculating follow that Gridding, which is calculated, Ring, outermost dind calculate circulation, and intermediate suppv calculates circulation, and innermost suppu calculates circulation, which is characterized in that Data are divided into setting and calculate circulation in suppv, comprising:
Circulation is calculated in dind and opens up nT OpenMP thread, and wherein nT is the total number of thread;
Suppv is calculated into circulation and is converted to the nT son calculating circulations executed parallel, comprising: array is divided into nT data Block distributes an OpenMP thread for each data block;The starting for distributing data for each OpenMP thread indexes bs and termination Index be;It is parallel to execute the nT suppv calculating circulations from bs to be;
The parallel execution nT suppv from bs to be calculate in circulation, and a son calculates circulation and specifically includes:
Suppv=bs is set;
Suppu=0 is set;
Calculate gind array;
Judge whether suppu is less than sSize, be then incremental suppu, re-execute and calculate gind array step, under otherwise executing One step;
Execute gind=gind+gSize;Cind=cind+sSize;
Judge whether suppv is less than be, be then incremental suppv, re-execute setting suppu=0 step, otherwise executes dind meter Calculate circulation.
CN201510591875.8A 2015-09-16 2015-09-16 The processing method of astronomy software Gridding based on OpenMP Active CN105260175B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510591875.8A CN105260175B (en) 2015-09-16 2015-09-16 The processing method of astronomy software Gridding based on OpenMP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510591875.8A CN105260175B (en) 2015-09-16 2015-09-16 The processing method of astronomy software Gridding based on OpenMP

Publications (2)

Publication Number Publication Date
CN105260175A CN105260175A (en) 2016-01-20
CN105260175B true CN105260175B (en) 2019-01-25

Family

ID=55099879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510591875.8A Active CN105260175B (en) 2015-09-16 2015-09-16 The processing method of astronomy software Gridding based on OpenMP

Country Status (1)

Country Link
CN (1) CN105260175B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598552A (en) * 2016-12-22 2017-04-26 郑州云海信息技术有限公司 Data point conversion method and device based on Gridding module
CN106897131B (en) * 2017-02-22 2020-05-29 浪潮(北京)电子信息产业有限公司 Parallel computing method and device for astronomical software Griding
CN107908477A (en) * 2017-11-17 2018-04-13 郑州云海信息技术有限公司 A kind of data processing method and device for radio astronomy data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707955A (en) * 2012-05-18 2012-10-03 天津大学 Method for realizing support vector machine by MPI programming and OpenMP programming
CN104035781A (en) * 2014-06-27 2014-09-10 北京航空航天大学 Method for quickly developing heterogeneous parallel program
CN104375838A (en) * 2014-11-27 2015-02-25 浪潮电子信息产业股份有限公司 OpenMP-based astronomy software Gridding optimization method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7596480B2 (en) * 2005-04-14 2009-09-29 Saudi Arabian Oil Company Solution method and apparatus for large-scale simulation of layered formations

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707955A (en) * 2012-05-18 2012-10-03 天津大学 Method for realizing support vector machine by MPI programming and OpenMP programming
CN104035781A (en) * 2014-06-27 2014-09-10 北京航空航天大学 Method for quickly developing heterogeneous parallel program
CN104375838A (en) * 2014-11-27 2015-02-25 浪潮电子信息产业股份有限公司 OpenMP-based astronomy software Gridding optimization method

Also Published As

Publication number Publication date
CN105260175A (en) 2016-01-20

Similar Documents

Publication Publication Date Title
CN101799762A (en) Quick parallelization programming template method for remote sensing image processing algorithm
CN105260175B (en) The processing method of astronomy software Gridding based on OpenMP
CN102902512B (en) A kind of multi-threading parallel process method based on multi-thread programming and message queue
CN103607466B (en) A kind of wide-area multi-stage distributed parallel grid analysis method based on cloud computing
CN102981807B (en) Graphics processing unit (GPU) program optimization method based on compute unified device architecture (CUDA) parallel environment
CN110135569B (en) Heterogeneous platform neuron positioning three-level flow parallel method, system and medium
CN104850866A (en) SoC-FPGA-based self-reconstruction K-means cluster technology realization method
CN103559148A (en) On-chip scratch-pad memory (SPM) management method facing multitasking embedded system
CN109272110A (en) Photoelectricity based on photon neural network chip merges intelligent signal processing system
CN106055401A (en) Automatic starting-stopping and computation task dynamic allocation method for mass parallel coarse particle computation
CN106648546A (en) Collaborative optimization compilation method used for GPU register allocation and parallelism management
CN102902590A (en) Parallel digital terrain analysis-oriented massive DEM (Digital Elevation Model) deploying and scheduling method
CN106897131A (en) A kind of parallel calculating method and its device for astronomical software Gridding
CN106026107A (en) QR decomposition method of power flow Jacobian matrix for GPU acceleration
CN104266657A (en) Shortest path planning parallelization method based on cooperative computing of CPU and MIC
CN112232594A (en) Multi-satellite emergency observation task planning method and device and computer equipment
CN101840329B (en) Data parallel processing method based on graph topological structure
CN107908477A (en) A kind of data processing method and device for radio astronomy data
Tang et al. Optimizing and auto-tuning iterative stencil loops for GPUs with the in-plane method
CN102722472B (en) Complex matrix optimizing method
CN106971369A (en) A kind of data dispatch and distribution method of the landform recallable amounts based on GPU
CN106484532B (en) GPGPU parallel calculating method towards SPH fluid simulation
CN106598552A (en) Data point conversion method and device based on Gridding module
Ren et al. Parallel modified artificial bee colony algorithm for solving conditional nonlinear optimal perturbation
CN105512763A (en) Method and system for predicting photovoltaic power station middle-short term power generation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant