Saltar al contingut Menu
Map
  • Home
  • Information
  • Contact
  • Map

Awareness of Architecture in Programming (PCA)

Credits Dept. Type Requirements
7.5 (6.0 ECTS) AC
  • Elective for DIE
  • Elective for DCSYS
SO - Prerequisite for DIE , DCSFW

Instructors

Person in charge:  (-)
Others:(-)

General goals

Upon finishing this subject, students should be able to generate code, or optimise existing code to adapt it to the particular characteristics of the architecture it must be executed on, and to make the best use of what resources are available.

Specific goals

Knowledges

  1. Programming tools and code optimisation. Compilation options.
  2. Code optimisation, independent of the architecture used.
  3. Optimisations dependent on memory hierarchy.
  4. Optimisations depending on machine language extensions (vectoral and multimedia extensions).
  5. Code optimisations for multiprocessors and multithreaded processors.

Abilities

  1. Detect which parts of a programme are executed most often, and those which are not executed efficiently.
  2. Generate code which is efficiently executed on a given architecture.
  3. Exploit vectoral and multimedia extensions.
  4. Exploit the architecture"s multithread capabilities.

Competences

(no available informacion)

Contents

Estimated time (hours):

T P L Alt Ext. L Stu A. time
Theory Problems Laboratory Other activities External Laboratory Study Additional time

1. Introduction: Programming that takes account of the computer architecture.
T      P      L      Alt    Ext. L Stu    A. time Total 
1,0 0 0 0 0 0 0 1,0


What this means and in what cases it is worth adopting this approach. Optimisation strategies. Performance evaluation.

2. Programming tools and optimisation
T      P      L      Alt    Ext. L Stu    A. time Total 
1,0 0 7,0 0 2,0 4,0 0 14,0
Measurement of programme performance. Compilation options. Study of the dynamic behaviour of programmes.











  • Additional laboratory activities:
    Study of documentation regarding the tools to be used in the lab.

3. Long latency operations
T      P      L      Alt    Ext. L Stu    A. time Total 
2,0 0 6,0 0 6,0 3,0 0 17,0
Alternatives to some high-cost and/or long latency operations. Substituting complex operations with simpler ones. Memorisation of results. Detection of trivial cases. Use of operating system resources.











  • Additional laboratory activities:
    Study of the documentation covering optimisation exercises in the lab.

4. Optimising flow control
T      P      L      Alt    Ext. L Stu    A. time Total 
2,0 0 8,0 0 10,0 5,0 0 25,0
Jump prediction. Detection and elimination of critical jumps. Inlining. Developing loops.











  • Additional laboratory activities:
    Study of the documentation covering optimisation exercises in the lab.

5. Memory optimisation
T      P      L      Alt    Ext. L Stu    A. time Total 
2,0 0 12,0 0 12,0 4,0 0 30,0
Size and alignment with data. Division of data into blocks that are in keeping with the size of the memory cache. Memory disambiguation.











  • Additional laboratory activities:
    Study of documentation regarding the optimisation to be performed in the lab.

6. Vectoral extensions
T      P      L      Alt    Ext. L Stu    A. time Total 
2,0 0 8,0 0 8,0 3,0 0 21,0
Machine language instructions. Inserting vectorial code in C code.











  • Additional laboratory activities:
    Study of the documentation covering optimisation exercises in the lab.

7. Optimisation practices
T      P      L      Alt    Ext. L Stu    A. time Total 
1,0 0 8,0 0 16,0 0 0 25,0
  • Laboratory
    Application of the optimisation techniques developed during the course to one or more completed applications. Discussion of problems and questions that may arise.
  • Additional laboratory activities:
    Application optimisation by making changes at the algorithmic and data structure levels. Planning optimisations by studying the source code.

8. Programming using more than one thread
T      P      L      Alt    Ext. L Stu    A. time Total 
1,0 0 4,0 0 4,0 3,0 0 12,0
Programming with more than one thread in order to take profit of the current multicore processors, but also some processors with just one core, in some cases.


Total per kind T      P      L      Alt    Ext. L Stu    A. time Total 
12,0 0 53,0 0 58,0 22,0 0 145,0
Avaluation additional hours 0
Total work hours for student 145,0

Docent Methodolgy

The course is mainly of a practical nature but is based on theory.

Teacher and students will discuss the theory in class. The teacher will provide bibliographic references and documentation on the subject for discussion. Students will do the preparatory work in their own time. This material will then be discussed in the following theory session.


The practical part of the course will be imparted in the teaching labs, and employ tutored practical assignments. All practical assignments will be held in the lab hours reserved for the purpose. The practical assignments will be tackled in two groups: limited-scope experiments to illustrate particular applications and optimisations, and other assignments in which students will be expected to apply all of the knowledge acquired on the course to optimise a complete application.

To facilitate that the students can compare their
solutions with those of the rest of students, the course
offers a web site where they will be able to send the
solution of determinate exercises.
The web site will be in charge of executing the programs, to check out
their correctness and of sorting the programs
considering their execution time.

Evaluation Methodgy

Course assessment is based on the following five components:

- Along the course, the students will have to face of a series of exercises.
The answer to some of these exercises is a C program that must be submitted to the web site; a submission will be accepted if, before the established deadline, its execution time is inferior to the threshold established by the teacher.
The answer to the remaining exercises is a brief report (1-3 pages) that must be submitted to the teacher; he will decide if the report is acceptable.
The acceptance of a minimum of 75% of the proposed exercises will be a necessary condition to be able to pass the subject without having to attend the final examination.
Those exercises will contribute to the exam evaluation with a factor (fs) depending on the % of acceptance, and evaluation of ALL the exercises of the laboratory documents (usually done at the laboratory classes).

Therefore, fs = max(0.8*((accepted exercises/total) - 0.75),0) + 1.0, with the necessary modifications depending on the evaluation/supervision of the teacher will do of ALL the exercises of the laboratory document (usually done on the lab classes). Those modifications will never make fs be less than 1.0.

- Fm: 2 questionnaires (F1 (35% de Fm) i F2 (65% de Fm)). Along the course, the students will have to answer two partial exams administered in the theory sessions. The purpose of these questionnaires is to check whether students have assimilated the code optimization theory and practice taught until the date.

- In : Submission of a report on the final practical assignment. Students will optimize code for the final practical assessment, using the techniques they have learned on the course.

- Final : Final exam containing questions on theory and practical cases.

- Challenge: Moreover, we will propose an extra exercise to be submitted to the web site. The students who submit the 10 faster solutions will see its final note increased in 1 point (faster solution), 0.9 points (second faster solution)... and 0.1 points (tenth faster solution) respectively.

"Fm" being (0.35*F1+0.65*F2), and fs the factor of % acceptance of exercises.

There are two ways of passing the course:

If Fm >= 5 and >= 75% accepted exercices:
NEx = MAX(Fm, Final)
Otherwise:
NEx = Final

And the Final Grade is:

Final Grade = MIN(0.60 * NEx * fs + 0.40 * En + Challenge, 10)

In other words, the course can be passed without having to take the final exam. In any case, the work done during the laboratory classes may help to the final grade thanks to the fs.

Basic Bibliography

  • BRYANT, Randal and O'HALLARON David Computer Systems: A Programmer's Perspective, Pearson International Edition, 2011/2.

Complementary Bibliography

(no available informacion)

Web links

(no available informacion)

Previous capacities

Knowledge of computer architecture: memory hierarchies and machine language. (courses EC1 and EC2)

Knowledge of programming in "C". (EC1 and EC2)

Knowledge of UNIX at the user level. (OS)


Compartir

 
logo FIB © Barcelona school of informatics - Contact - RSS
This website uses cookies to offer you the best experience and service. If you continue browsing, it is understood that you accept our cookies policy.
Classic version Mobile version