nested loops
Recently Published Documents


TOTAL DOCUMENTS

217
(FIVE YEARS 16)

H-INDEX

16
(FIVE YEARS 2)

2022 ◽  
Vol 6 (POPL) ◽  
pp. 1-28
Author(s):  
Amanda Liu ◽  
Gilbert Louis Bernstein ◽  
Adam Chlipala ◽  
Jonathan Ragan-Kelley

We present a lightweight Coq framework for optimizing tensor kernels written in a pure, functional array language. Optimizations rely on user scheduling using series of verified, semantics-preserving rewrites. Unusually for compilation targeting imperative code with arrays and nested loops, all rewrites are source-to-source within a purely functional language. Our language comprises a set of core constructs for expressing high-level computation detail and a set of what we call reshape operators, which can be derived from core constructs but trigger low-level decisions about storage patterns and ordering. We demonstrate that not only is this system capable of deriving the optimizations of existing state-of-the-art languages like Halide and generating comparably performant code, it is also able to schedule a family of useful program transformations beyond what is reachable in Halide.


2021 ◽  
Vol 9 (10) ◽  
pp. 1136
Author(s):  
Jinming Wu

The objective of this work is to identify the maximum absorbed power and optimal buoy geometry of a heaving axisymmetric point absorber for a given cost in different sea states. The cost of the wave energy converter is estimated as proportional to the displaced volume of the buoy, and the buoy geometry is described by the radius-to-draft ratio. A conservative wave-height-dependent motion constraint is introduced to prevent the buoy from jumping out of the free surface of waves. The constrained optimization problem is solved by a two-nested-loops method, within which a core fundamental optimization process employs the MATLAB function fmincon. Results show that the pretension of the mooring system should be as low as possible. Except for very small energy periods, the stiffness of both the power take-off and mooring system should also be as low as possible. A buoy with a small radius-to-draft ratio can absorb more power, but at the price of working in more energetic seas and oscillating at larger amplitudes. In addition, the method to choose the optimal buoy geometry at different sea states is provided.


2021 ◽  
Author(s):  
Carlos Eduardo C. Dantas ◽  
Marcelo A. Maia

Code search engines usually use readability feature to rank code snippets. There are several metrics to calculate this feature, but developers may have different perceptions about readability. Correlation between readability and understandability features has already been proposed, i.e., developers need to read and comprehend the code snippet syntax, but also understand the semantics. This work investigate scores for understandability and readability features, under the perspective of the possible subjective perception of code snippet comprehension. We find that code snippets with higher readability score has better comprehension than lower ones. The understandability score presents better comprehension in specific situations, e.g. nested loops or if-else chains. The developers also mentioned writability aspects as the principal characteristic to evaluate code snippets comprehension. These results provide insights for future works in code comprehension score optimization.


2021 ◽  
Vol 14 (11) ◽  
pp. 2383-2396
Author(s):  
Philipp Fent ◽  
Thomas Neumann

Groupjoins, the combined execution of a join and a subsequent group by, are common in analytical queries, and occur in about 1/8 of the queries in TPC-H and TPC-DS. While they were originally invented to improve performance, efficient parallel execution of groupjoins can be limited by contention, which limits their usefulness in a many-core system. Having an efficient implementation of groupjoins is highly desirable, as groupjoins are not only used to fuse group by and join but are also introduced by the unnesting component of the query optimizer to avoid nested-loops evaluation of aggregates. Furthermore, the query optimizer needs be able to reason over the result of aggregation in order to schedule it correctly. Traditional selectivity and cardinality estimations quickly reach their limits when faced with computed columns from nested aggregates, which leads to poor cost estimations and thus, suboptimal query plans. In this paper, we present techniques to efficiently estimate, plan, and execute groupjoins and nested aggregates. We propose two novel techniques, aggregate estimates to predict the result distribution of aggregates, and parallel groupjoin execution for a scalable execution of groupjoins. The resulting system has significantly better estimates and a contention-free evaluation of groupjoins, which can speed up some TPC-H queries up to a factor of 2.


2021 ◽  
pp. 24-33
Author(s):  
S. S. Gerbut

The article describes the methodological rationale for using the virtual robot Drawman in the PascalABC.NET environment for teaching the basics of programming. There is a didactic material on the basics of working with the virtual robot Drawman, which can be used in informatics lessons or in additional classes. Detailed instructions can be both an assistant to the teacher for working in the lesson, and a guide for students working at an individual pace, and schoolchildren in self-study of the basics of programming. However, under teacher guidance, this training will be more effective. The article examines tasks from various topics  — linear programs, loop operators, nested loops, procedures and procedures with a parameter — with a detailed description of how to solve these problems, which will allow students to solve other tasks from these topics on their own. For the first linear program, step-by-step instructions are given on how to implement the task and write the first program in the PascalABC.NET environment for the virtual robot Drawman, as well as to automatically check the completed task. Depending on the interests and level of preparation of the students, the material may be useful for students in the sixth or seventh grades.


2021 ◽  
Vol 2021 ◽  
pp. 1-18
Author(s):  
Kai Nie ◽  
Qinglei Zhou ◽  
Hong Qian ◽  
Jianmin Pang ◽  
Jinlong Xu ◽  
...  

Loop selection for multilevel nested loops is a very difficult problem, for which solutions through the underlying hardware-based loop selection techniques and the traditional software-based static compilation techniques are ineffective. A genetic algorithm- (GA-) based method is proposed in this study to solve this problem. First, the formal specification and mathematical model of the loop selection problem are presented; then, the overall framework for the GA to solve the problem is designed based on the mathematical model; finally, we provide the chromosome representation method and fitness function calculation method, the initial population generation algorithm and chromosome improvement methods, the specific implementation methods of genetic operators (crossover, mutation, and selection), the offspring population generation method, and the GA stopping criterion during the GA operation process. Experimental tests with the SPEC2006 and NPB3.3.1 standard test sets were performed on the Sunway TaihuLight supercomputer. The test results indicated that the proposed method can achieve a speedup improvement that is superior to that by the current mainstream methods, which confirm the effectiveness of the proposed method. Solving the loop selection problem of multilevel nested loops is of great practical significance for exploiting the parallelism of general scientific computing programs and for giving full play to the performance of multicore processors.


2020 ◽  
Vol 13 (32) ◽  
Author(s):  
Ricardo Scucuglia Rodrigues da Silva ◽  
George Gadanidis ◽  
Carina Alexandra Rondini ◽  
Marcelo C. Borba ◽  
Janette M. Hughes

In this paper we emphasize the aesthetic-sensitive dimension of computational thinking in a scenario of pre-service mathematics teacher education. Through the development of teaching experiments we investigate aspects (skills/concepts/affordances) of computational thinking of mathematics majors emergent in the exploration of a task based on coding with the online application based on a coding application developed using Blockly. The findings highlight the processes of experimentation with technology in which the command named repeat was used in several manners in the attempt of creating nested loops to solve the task. The sensitive-computational thinking points to the perception and modification of aesthetic elements such as the form of objects, colors, symmetries, patterns, sounds, etc. and its relation to commands that compose the code and the overall structure of the code.


Sign in / Sign up

Export Citation Format

Share Document