DOC PREVIEW
UH COSC 6385 - COSC 6385 Homework

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Edgar GabrielCOSC 6385 Computer Architecture - HomeworkEdgar GabrielFall 2009COSC 6385 – Computer ArchitectureEdgar Gabriel1stAssignment• Rules– Each team should deliver• Source code (.cpp, .h and Makefiles files)– Please: no .o files and no executables!• Documentation (.pdf, .doc, .tex or .txt file)– Deliver electronically to [email protected]– Expected by Wednesday, October 14 , 11.59pm– In case of questions: • ask the TAs first, if they don’t know the answer, they will ask me.• Ask early, not the day before the submission is due2COSC 6385 – Computer ArchitectureEdgar GabrielAbout the Project• Given the source code for sequential image segmentation code ( File cosc6385-segment.tar.gz).– You can open the archive with tar –xzvf cosc6385-segment.tar.gz– The archive contains the among others following files• Makefile /* To compile everything on Linux/Unix */• segment.cpp /* The main file */• segment-image.h /* header file containing source code */• segment-graph.h /* header file containing source code */COSC 6385 – Computer ArchitectureEdgar GabrielAbout the Project• A sequential code performing image segmentation for a multi-spectral image• Code provided by Shishir Shah• Input file: – a flat image ( no compression )– a configuration file• Start the application by– Compiling: just type make– Run: • allocate a node (see later in the lecture)• type: ./segment <infilename> <outfilename>3COSC 6385 – Computer ArchitectureEdgar GabrielThe source code• The source code contains of the following parts:Domain 1: Perform I/O operations– Step 1, 6 [in segment.cpp]Domain 2: Set up the graph– Step 2 [in segment-image.h]Domain 3: Perform segmentation– Steps 3, 4 [in segment-image.h]Domain 4: Sorting– Step 3a [in segment-graph.h]– whether you report in Domain 3 the result of Domain 4 including or excluding the sorting step is up to you, as long as the documentation is clear what you are doing.COSC 6385 – Computer ArchitectureEdgar Gabriel• Part 1:Instrument the code in order to use hardware performance counters to determine the behavior of each Domain described on the previous page separately.• The hardware performance counters should be based on the PAPI library, and you could monitor the following values:– Level 2 Cache Hits and Level 2 Cache misses– Number of floating point operations and integer instructions– Floating point performance • Whether you can access these values will depend on the processor you are really using!• Please note that counter values might overflow, and PAPI can handle that, you have to include however special functions calls for that.4COSC 6385 – Computer ArchitectureEdgar Gabriel• Part 2:Run the modified code on the shark cluster. Generate graphs for at least 3 PAPI hardware counters showing the values for each Domain separately for both image provided– 8023.pbm– img1024.pbm. Please document (you can use PAPI to figure many of these things out!) :– Processor type, frequency– Operating System (as precisely as possible)– Cache sizes– Each team has a single accountCOSC 6385 – Computer ArchitectureEdgar Gabriel• Part 3 ( only for the two-person teams!)– Generate an estimate of the cache usage of the original code (without PAPI calls in it) using the valgrind toolkit with cachegrind, e.g.valgrind –tool=cachegrind ./segment <infilename> <outfilename>– If possible, compare the data produced by valgrind to the data obtained with PAPI– Note: the execution of the application using valgrind/cachegrind will be significantly slower than without it!5COSC 6385 – Computer ArchitectureEdgar GabrielNotes• The PAPI version installed on shark is 3.6.0• On the front-end node you can find tons ton’s of examples in C and Fortran on how to use PAPI in /opt/papi-3.6.0/share/examples/. E.g.– src/ctests/avail.c -> how to check on a processor whether a counter is available– src/ctests/high_level.c -> how to use the high-level API of PAPI– src/ctests/memory.c -> how to extract information of the memory subsystem (e.g. cache sizes)COSC 6385 – Computer ArchitectureEdgar Gabriel1stAssignment• The Documentation should contain– (Brief) Problem description– Solution strategy– Results section• Description of resources used • Description of measurements performed• Results (graphs + findings)6COSC 6385 – Computer ArchitectureEdgar Gabriel1stAssignment• The document should not contain– Replication of the entire source code – that’s why you have to deliver the sources– Screen shots of every single measurement you made• Actually, no screen shots at all.– The slurm output filesCOSC 6385 – Computer ArchitectureEdgar GabrielHow to use a cluster• A cluster usually consists of a front-end node and compute nodes• You can login to the front end node using ssh (from windows or linux machines) using the login name and the password assigned to you.• The front end node is supposed to be there for editing, and compiling - not for running jobs!– If 40 teams would run their jobs on the same processor, everything would stall!!!!!• To allocate a node for interactive development:teamxy@shark:~>salloc –N 1 bashteamxy@shark:~>squeueJOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) 489 calc smith R 0:02 1 shark08 teamxy@shark:~> ssh shark087COSC 6385 – Computer ArchitectureEdgar GabrielHow to use a cluster (II)• Once your code is correct and you would like to do the measurements:– You have to submit a batch job– The command you need is sbatch, e.g.sbatch –N 1 ./ImageAnalysis.sh– Your job goes into a queue, and will be executed as soon as a node is available. You can check the status of your job withsqeueuCOSC 6385 – Computer ArchitectureEdgar GabrielHow to use a cluster (III)• The output of squeue gives you a job-id for your job• Once your job finishes, you will have a file called slurm-<jobid>.out in your home directory, which contains all the output of your printf statements etc.• Note the batch script used for the job submission (e.g. ImageAnalysis.sh) has to be executable. This means, that after you downloaded it from the webpage and copied it to shark, you have to typechmod +x ImageAnalysis.sh• Please do not edit the ImageAnalysis.sh file on MS Windows. Windows does not add the UNIX EOF markers, and this confuses slurm when reading the file.8COSC 6385 – Computer ArchitectureEdgar GabrielNotes• PAPI


View Full Document

UH COSC 6385 - COSC 6385 Homework

Download COSC 6385 Homework
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view COSC 6385 Homework and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view COSC 6385 Homework 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?