Tuesday, 20 December 2016

Sequence Diagrams


Sequence Diagrams:
1.     Draw one sequence diagram for one use case
2.     For e.g “Insert Student” use case. Actor :Admin
What will be sequence?
a.     Admin actor(external to system) logins the system
b.     Searches the student info
c.      If not present , inserts the student
d.     Logouts

In this e.g. login() method is in Admin class (verify in class diagram)
So take Admin object & invoke login() method on it. Search_student_info() method is in Student class, so take object of student class & invoke this method on the student object. Insert_student() is also in Student class.
 

in short the sequence of implementation of insert_student  is :

a.login();
found=s.search_student();
if (found==yes)
      s.insert_student();   

3.     Else part is shown in alternative flow of sequence diagram




Steps for installing VTune

a. Go to the Intel VTune amplifier site  https://software.intel.com/en-us/intel-vtune-amplifier-xe 
b.  Click on Join Today button & enter your details to create login. 
c. Download VTune Amplifier tar file & follow the steps below
 
1. Extract the archive to a directory. (using command tar -xvzf vtune_amplifier_xe_2016_update2.tar.gz)
2. Travers upto the directory, run sudo ./install.sh  (root permissions are required).

      i. Press Enter to continue
      ii. Keep pressing Space to scroll to the end of the license agreement, then enter the string 'accept ',  

         then Enter.
      iii. Press 2, then Enter, to select evaluation.

       iv. Press 2, then Enter, to not participate in Intel's   program.     
       v.  Press Enter to continue, wait for it to install.
3. Press Enter to continue. Note down the post install instructions. There should be a line saying
    bash users: source /opt/intel/vtune_amplifier_xe_2016.2.0.444464/amplxevars.sh  `. Version number may  be different . Copy that string from source (for example, source /opt/intel  

      /vtune_amplifier_xe_2016.2.0.444464/amplxe-vars.sh  `).
 4. Open ~/.bashrc in gedit or any text editor. Paste the above line at the end. There should be no    newlines between 'source' and the version, it should be one line. 
5. Run echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
6.. Run amplxe-gui . VTune Amplifier should start. 
7. Select 'New Project'. Enter any project name.
8. There should be two tabs in the right panel – Analysis Target and Analysis Type. 

9. In Analysis Target, in Application, browse for the output file to your program (a.out). 
10. In Analysis Type, select Advanced Hotspots. Hit Start. 
11. Your program will execute. In case it requires input, look at the terminal from which you started VTune and enter it there. After the program executes, you will get a detailed report.

Monday, 19 December 2016

Generation of 8-Queens Matrix using Python using HPC architecture



Experiment No. 8
Aim :    Generation of 8-Queens Matrix using Python using HPC architecture

Problem Statement : 8-queen’s Matrix is Stored using JSON/XML having  first Queen placed, use back-tracking to place remaining Queens to generate  final 8-queen’s Matrix using Python. Create a backtracking scenario and use HPC architecture (Preferably BBB) for computation of next placement of a queen.

Procedure:  JSON file contains placement locations of 1st Queen.
1. The placement locations  of first Queen are given to all processors to find out possible 1 solution each with one input location.(Different location for each node)
2. This way every processor will be working on different placement  of 1st Queen position

Theory:  Write about parallelism in the algorithm & JSON
Give mathematical model for parallel algorithm


Input :  A program
Output:  Analysis of the program

Monday, 12 December 2016

Class diagrams




Class diagram
1.     Find out nouns from problem statements, These are the probable classes of your system
2.      Try to identify the probable attributes for each class. E.g. class student- student_name , stud_rn etc. write these in attribute section of the class
3.     Find out the methods which will change values(states) of these attributes & write in the same class.
4.     Try to find out relations among the classes- 1.simple association , 2. generalization, 3. aggregation, 4. Composition or 5. Dependency
5.     When two classes only use information of each other through methods , show simple association e.g. teacher uses info of student. So simple association between teacher & student class
6.     Show generalization in case of inheritance






 Accountant is-a employee & Teacher is-a employee
E.g.2  ASCII file(specific file) is-a file & Binary file (specific file)is-a file . File class is a general class of Files.

1.     Generally has-a or made of or consists of relationships are shown using aggregation association
e.g Linked List is made up of Nodes or Linked List has a set of Nodes. Means Linked List is collection of Nodes.             
Linked list is collection(aggregate) class of node objects. Node class can be used by Tree class as well. part_of relationship

1.      Composition relation also shows collection class(part_of relationship) but it is whole-part relationship. Means the parts can’t be used by other classes.

                 
Tracks (or Sector)can’t be used by any other class. If Disk is deleted, there is no use of Sectors &Tracks. If Sector is deleted, no use of Tracks. Existence of Sector & Tracks is due to existence of Disk

1.     If a class is dependent on data from other classes , show dependency relation
e.g

  


To generate bill, customer info & item info are needed without which bill can’t be generated
Do not forget to show multiplicity