Enlarging letters   Home   Information   Contacting   Map
Catalą   Castellano

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:  Daniel Jimenez Gonzalez (djimenez@ac.upc.edu)
Others:Alejandro Ramirez Bellido (aramirez@ac.upc.edu)
Eduardo Ayguadé Parra (eduard@ac.upc.edu)
Enrique Morancho Llena (enricm@ac.upc.edu)
Jose Ramon Herrero Zaragoza (josepr@ac.upc.edu)
Teresa Monreal Arnal (teresa@ac.upc.edu)

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 
2,0 0 4,0 0 4,0 3,0 0 13,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 
1,0 0 8,0 0 8,0 2,0 0 19,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 
3,0 0 12,0 0 12,0 4,0 0 31,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 2,0 0 20,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 
3,0 0 12,0 0 16,0 0 0 31,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.


Total per kind T      P      L      Alt    Ext. L Stu    A. time Total 
14,0 0 56,0 0 60,0 15,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 exercices is a C program that must be submited 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 exercices is a brief report (1-3 pages) that must be submited 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.

- F: 3 questionnaires (F1, F2 and F3). Along the course, the students will have to answer three questionares administered in the theory sessions. The purpose of these questionnaires is to check whether students have assimilated the code optimisation theory and practice taught until the date.

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

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

- Challenge: Moreover, we will propose an extra exercise to be submited 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 the average of "Fi" grades.

There are two ways of passing the course:

If Fm >= 5 and >= 75% accepted exercices:

Final Grade = 0.60 * Fm + 0.40 * En + Challenge

Otherwise:

Final Grade = 0.60 * Final + 0.4 * En + Challenge

In other words, the course can be passed without having to take the final exam.

Basic Bibliography

(no available informacion)

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)



 
logo FIB © Barcelona school of informatics - webmaster@fib.upc.edu - RSS RSS