57
edits
Changes
→Kernel Version 2
{{GPU610/DPS915 Index | 2017120191}}= Project Name Goes here Algo Holics =
== Team Members ==
# [mailto:ssdhillon20@myseneca.ca?subject=GPU610 Sukhbeer Dhillon], Responsibilities...Simple Neural Network# [mailto:gsingh520@myseneca.ca?subject=gpu610 Gurpreet Singh], Some other responsibility Sudoku Puzzle Solver # [mailto:egiang1@myseneca.ca?subject=gpu610 Edgar Giang], Some other other responsibilityMerge sort
#[mailto:ssdhillon20@myseneca.ca;gsingh520@myseneca.ca;egiang1@myseneca.ca?subject=GPU610 Email All]
Is it a program that solves Sudoku puzzles(9X9) using Bruteforce algorithm. Either the The user can either pass a Sudoku files as an input or enter the values manually. Moreover, the file or the manual entry should must strictly have strictly 9 rows and 9 columns in them. LastlyLast but not the least, all the cells should must be separated by a space and the cells that needs to be solved should must have 0 in them as their value.
The original source code can be found at [https://github.com/shafeeq/Sudoku Link]
In this program the Bruteforce algorithm first put 1 in the first cell . Then it moves to the second cell and put 1 in there and then check if it is violating any satisfies all the rulesand conditions. If yesit don't, then the algorithm will increment it increment the 's value to 2 and then check again (. The value can vary change from 10-9) until it finds to find the appropriate correct valuefor a cell. After finding a suitable If none of the value for from the first cell, it moves to range of 0-9 satisfies the second cell and put 1 in there and again check again if it violating any rules. If it is discovers that 1 is not allowed in that cell, then the algorithm program will increment it iterate back and change the value of the first cell to 2 and check then try the whole process again.In this way it will solve the puzzle. =====Compiling the program=====Enter the following commands:
g++ -std=c++0x -pg solver.cpp checks.cpp checksolution.cpp -o a
a fileName
-pg directs the compiler to include the executable code required for profiling.
If we run the sample-puzzle-1 (level- easy) file Text , which has the following text inside the sample-puzzle-1 isit:
0 6 0 0 0 0 9 7 2
0 5 0 0 0 2 0 0 3
|}{| class="wikitable mw-collapsible mw-collapsed"! Call graph|-| Call graph granularity: each sample hit covers 2 byte(s) for 0.00% of 1084.68 seconds index % time self children called name <spontaneous>[1] 99.2 1075.84 0.00 displayPrediction(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >) [1]----------------------------------------------- 14012000 train(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&) [2] 2.60 0.87 3/3 relu(std::vector<float, std::allocator<float> > const&) [3][2] 0.3 2.60 0.87 3+14012000 train(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&) [2] 0.87 0.00 519195026/519195026 std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() [7] 14012000 train(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&) [2]----------------------------------------------- <spontaneous>[3] 0.3 0.00 3.47 relu(std::vector<float, std::allocator<float> > const&) [3] 2.60 0.87 3/3 train(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&) [2]----------------------------------------------- <spontaneous>[4] 0.2 2.43 0.00 split(std::string const&, char) [4]----------------------------------------------- <spontaneous>[5] 0.1 1.62 0.00 print(std::vector<float, std::allocator<float> > const&, int, int) [5]----------------------------------------------- <spontaneous>[6] 0.1 1.11 0.00 reluPrime(std::vector<float, std::allocator<float> > const&) [6]----------------------------------------------- 0.87 0.00 519195026/519195026 train(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&) [2][7] 0.1 0.87 0.00 519195026 gprof std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() [7]----------------------------------------------- <spontaneous>[8] 0.0 0.20 0.00 std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() [8]----------------------------------------------q -b myapp 0.00 0.00 1/1 std::vector<float, std::allocator<float> >::vector(unsigned long, std::allocator<float> myappconst&) [30][16] 0.0 0.00 0.clg00 1 transpose(float*, int, int) [16]-q directs ----------------------------------------------�Index by function name [1] displayPrediction(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >) [2] train(std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&) [7] std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() [5] print(std::vector<float, std::allocator<float> > const&, int, int) [6] reluPrime(std::vector<float, std::allocator<float> > const&) [8] std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() [4] split(std::string const&, char) [16] transpose(float*, int, int) |} =====Analysis=====The total execution time of the program is around 3 minutes. The profiling results spot displayPrediction as the function with maximum execution time. However, thats because it displays a matrix using the profiler naive O(n2) for-loop. train(gprof) is the next function with the maximum time. This is the hotspot for the program. If this function is made to be the kernel and the functions that it calls as device functions, the program would fasten by a good proportion. ----====Merge Sort - Edgar Giang==== =====Intro===== The topic I chose is sorting algorithms. The algorithm that I'll be profiling and analyzing would be a merge sort algorithm written in c++ which can be found [https://codereview.stackexchange.com/questions/128457/recurrent-merge-sort-without-recursion/ Here]. This code would ask the user to input the size of the array and then fill the array with random elements. The size of the array can be extremely large. From the original creator, the size of the array entered was in the tens of thousands. Theoretically, there would be no limit to how much the user can input however the original creator of this code said it would take the user several hours to sort 10 million elements in the entered array. =====How to run the program===== The following command was tested in matrix: g++ fileName.cpp -pg -o test ./test =====Running the program===== This would be the following output : Please enter the size of your array: 200000 unsorted sorted time: 166100 As you can see the input used was 200,000. The time indicated in the output is in milliseconds so it took 166100 milliseconds to complete. A much larger input would result in the program running for a very long time. =====Profiling===== {| class="wikitable mw-collapsible mw-collapsed"! Flat profile|-| Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 21.90 0.07 0.07 600021 0.00 0.00 int* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<int>(int const*, int const*, int*) 15.64 0.12 0.05 200006 0.00 0.00 merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int) 9.39 0.15 0.03 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_M_create_storage(unsigned long) 9.39 0.18 0.03 400015 0.00 0.00 int* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, int>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, std::allocator<int>&) 6.26 0.20 0.02 14466088 0.00 0.00 std::vector<int, std::allocator<int> >::operator[](unsigned long) 6.26 0.22 0.02 600021 0.00 0.00 int* std::__copy_move_a<false, int const*, int*>(int const*, int const*, int*) 6.26 0.24 0.02 400016 0.00 0.00 __gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*) 6.26 0.26 0.02 400015 0.00 0.00 int* std::uninitialized_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) 3.13 0.27 0.01 600021 0.00 0.00 std::vector<int, std::allocator<int> >::begin() const 3.13 0.28 0.01 400016 0.00 0.00 __gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long) 3.13 0.29 0.01 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_M_deallocate(int*, unsigned long) 3.13 0.30 0.01 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) 3.13 0.31 0.01 400015 0.00 0.00 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) 3.13 0.32 0.01 400015 0.00 0.00 int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) 0.00 0.32 0.00 1200042 0.00 0.00 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::__normal_iterator(int const* const&) 0.00 0.32 0.00 1200042 0.00 0.00 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::base() const 0.00 0.32 0.00 1200042 0.00 0.00 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, false>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 1200042 0.00 0.00 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 1200042 0.00 0.00 std::_Miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 1200042 0.00 0.00 std::_Niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 1200030 0.00 0.00 std::vector<int, std::allocator<int> >::size() const 0.00 0.32 0.00 1000038 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() 0.00 0.32 0.00 600021 0.00 0.00 std::vector<int, std::allocator<int> >::end() const 0.00 0.32 0.00 600018 0.00 0.00 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::__normal_iterator(int* const&) 0.00 0.32 0.00 400017 0.00 0.00 __gnu_cxx::new_allocator<int>::~new_allocator() 0.00 0.32 0.00 400017 0.00 0.00 std::allocator<int>::~allocator() 0.00 0.32 0.00 400016 0.00 0.00 __gnu_cxx::new_allocator<int>::new_allocator(__gnu_cxx::new_allocator<int> const&) 0.00 0.32 0.00 400016 0.00 0.00 __gnu_cxx::new_allocator<int>::max_size() const 0.00 0.32 0.00 400016 0.00 0.00 std::allocator<int>::allocator(std::allocator<int> const&) 0.00 0.32 0.00 400016 0.00 0.00 std::_Iter_base<int*, false>::_S_base(int*) 0.00 0.32 0.00 400016 0.00 0.00 void std::_Destroy_aux<true>::__destroy<int*>(int*, int*) 0.00 0.32 0.00 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_M_allocate(unsigned long) 0.00 0.32 0.00 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(std::allocator<int> const&) 0.00 0.32 0.00 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl() 0.00 0.32 0.00 400016 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::~_Vector_base() 0.00 0.32 0.00 400016 0.00 0.00 std::vector<int, std::allocator<int> >::~vector() 0.00 0.32 0.00 400016 0.00 0.00 std::_Niter_base<int*>::iterator_type std::__niter_base<int*>(int*) 0.00 0.32 0.00 400016 0.00 0.00 void std::_Destroy<int*>(int*, int*) 0.00 0.32 0.00 400016 0.00 0.00 void std::_Destroy<int*, int>(int*, int*, std::allocator<int>&) 0.00 0.32 0.00 400015 0.00 0.00 __gnu_cxx::__alloc_traits<std::allocator<int> >::_S_select_on_copy(std::allocator<int> const&) 0.00 0.32 0.00 400015 0.00 0.00 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() const 0.00 0.32 0.00 400015 0.00 0.00 int* std::__uninitialized_copy<true>::__uninit_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) 0.00 0.32 0.00 400015 0.00 0.00 int* std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) 0.00 0.32 0.00 400012 0.00 0.00 unsigned int const& std::min<unsigned int>(unsigned int const&, unsigned int const&) 0.00 0.32 0.00 200006 0.00 0.00 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::base() const 0.00 0.32 0.00 200006 0.00 0.00 std::vector<int, std::allocator<int> >::capacity() const 0.00 0.32 0.00 200006 0.00 0.00 std::_Iter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 200006 0.00 0.00 void std::_Destroy_aux<true>::__destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 200006 0.00 0.00 std::vector<int, std::allocator<int> >::end() 0.00 0.32 0.00 200006 0.00 0.00 std::vector<int, std::allocator<int> >::begin() 0.00 0.32 0.00 200006 0.00 0.00 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) 0.00 0.32 0.00 200006 0.00 0.00 std::_Niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 200006 0.00 0.00 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 200006 0.00 0.00 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 200006 0.00 0.00 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) 0.00 0.32 0.00 200006 0.00 0.00 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, std::allocator<int>&) 0.00 0.32 0.00 2 0.00 0.28 check_sort(std::vector<int, std::allocator<int> >) 0.00 0.32 0.00 1 0.00 0.00 _GLOBAL__sub_I_main 0.00 0.32 0.00 1 0.00 320.11 merge_sort(std::vector<int, std::allocator<int> >) 0.00 0.32 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int) 0.00 0.32 0.00 1 0.00 0.00 __gnu_cxx::new_allocator<int>::new_allocator() 0.00 0.32 0.00 1 0.00 0.00 std::allocator<int>::allocator() 0.00 0.32 0.00 1 0.00 0.00 void std::__uninitialized_fill_n<true>::__uninit_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) 0.00 0.32 0.00 1 0.00 0.00 std::vector<int, std::allocator<int> >::_M_fill_initialize(unsigned long, int const&) 0.00 0.32 0.00 1 0.00 0.00 std::vector<int, std::allocator<int> >::vector(unsigned long, int const&, std::allocator<int> const&) 0.00 0.32 0.00 1 0.00 0.00 __gnu_cxx::__enable_if<std::__is_scalar<int>::__value, int*>::__type std::__fill_n_a<int*, unsigned long, int>(int*, unsigned long, int const&) 0.00 0.32 0.00 1 0.00 0.00 void std::uninitialized_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) 0.00 0.32 0.00 1 0.00 0.00 void std::__uninitialized_fill_n_a<int*, unsigned long, int, int>(int*, unsigned long, int const&, std::allocator<int>&) 0.00 0.32 0.00 1 0.00 0.00 int* std::fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) |} {| class="wikitable mw-collapsible mw-collapsed"! Call graph|-| Call graph granularity: each sample hit covers 2 byte(s) for 3.12% of 0.32 seconds index % time self children called name <spontaneous>[1] 100.0 0.00 0.32 main [1] 0.00 0.32 1/1 merge_sort(std::vector<int, std::allocator<int> >) [2] 0.00 0.00 200000/14466088 std::vector<int, std::allocator<int> >::operator[](unsigned long) [17] 0.00 0.00 1/400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3] 0.00 0.00 1/1 std::vector<int, std::allocator<int> >::vector(unsigned long, int const&, std::allocator<int> const&) [26] 0.00 0.00 2/400016 std::vector<int, std::allocator<int> >::~vector() [22] 0.00 0.00 200001/1200030 std::vector<int, std::allocator<int> >::size() const [39] 0.00 0.00 1/1 std::allocator<int>::allocator() [70] 0.00 0.00 1/400017 std::allocator<int>::~allocator() [44]----------------------------------------------- 0.00 0.32 1/1 main [1][2] 99.9 0.00 0.32 1 merge_sort(std::vector<int, std::allocator<int> >) [2] 0.05 0.12 200006/200006 merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int) [4] 0.01 0.09 200008/400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3] 0.00 0.03 200006/200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14] 0.00 0.02 400014/400016 std::vector<int, std::allocator<int> >::~vector() [22] 0.00 0.00 2/2 check_sort(std::vector<int, std::allocator<int> >) [25] 0.00 0.00 400012/400012 unsigned int const& std::min<unsigned int>(unsigned int const&, unsigned int const&) [57] 0.00 0.00 1/1200030 std::vector<int, std::allocator<int> >::size() const [39]----------------------------------------------- 0.00 0.00 1/400015 main [1] 0.01 0.09 200006/400015 merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int) [4] 0.01 0.09 200008/400015 merge_sort(std::vector<int, std::allocator<int> >) [2][3] 61.5 0.01 0.19 400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3] 0.03 0.09 400015/400015 int* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, int>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, std::allocator<int>&) [5] 0.01 0.05 400015/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) [12] 0.01 0.00 400015/600021 std::vector<int, std::allocator<int> >::begin() const [23] 0.00 0.00 400015/400015 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() const [56] 0.00 0.00 400015/400015 __gnu_cxx::__alloc_traits<std::allocator<int> >::_S_select_on_copy(std::allocator<int> const&) [55] 0.00 0.00 400015/1200030 std::vector<int, std::allocator<int> >::size() const [39] 0.00 0.00 400015/1000038 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() [40] 0.00 0.00 400015/600021 std::vector<int, std::allocator<int> >::end() const [41]----------------------------------------------- 0.05 0.12 200006/200006 merge_sort(std::vector<int, std::allocator<int> >) [2][4] 52.3 0.05 0.12 200006 merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int) [4] 0.01 0.09 200006/400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3] 0.02 0.00 13866088/14466088 std::vector<int, std::allocator<int> >::operator[](unsigned long) [17]----------------------------------------------- 0.03 0.09 400015/400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][5] 37.5 0.03 0.09 400015 int* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, int>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, std::allocator<int>&) [5] 0.02 0.07 400015/400015 int* std::uninitialized_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [6]----------------------------------------------- 0.02 0.07 400015/400015 int* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, int>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, std::allocator<int>&) [5][6] 28.1 0.02 0.07 400015 int* std::uninitialized_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [6] 0.00 0.07 400015/400015 int* std::__uninitialized_copy<true>::__uninit_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [8]----------------------------------------------- 0.01 0.02 200006/600021 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [15] 0.01 0.05 400015/600021 int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [9][7] 28.1 0.02 0.07 600021 int* std::__copy_move_a<false, int const*, int*>(int const*, int const*, int*) [7] 0.07 0.00 600021/600021 int* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<int>(int const*, int const*, int*) [11]----------------------------------------------- 0.00 0.07 400015/400015 int* std::uninitialized_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [6][8] 21.9 0.00 0.07 400015 int* std::__uninitialized_copy<true>::__uninit_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [8] 0.00 0.07 400015/400015 int* std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [10]----------------------------------------------- 0.01 0.06 400015/400015 int* std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [10][9] 21.9 0.01 0.06 400015 int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [9] 0.01 0.05 400015/600021 int* std::__copy_move_a<false, int const*, int*>(int const*, int const*, int*) [7] 0.00 0.00 800030/1200042 std::_Niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [38] 0.00 0.00 400015/400016 std::_Niter_base<int*>::iterator_type std::__niter_base<int*>(int*) [52]----------------------------------------------- 0.00 0.07 400015/400015 int* std::__uninitialized_copy<true>::__uninit_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [8][10] 21.9 0.00 0.07 400015 int* std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [10] 0.01 0.06 400015/400015 int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [9] 0.00 0.00 800030/1200042 std::_Miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [37]----------------------------------------------- 0.07 0.00 600021/600021 int* std::__copy_move_a<false, int const*, int*>(int const*, int const*, int*) [7][11] 21.9 0.07 0.00 600021 int* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<int>(int const*, int const*, int*) [11]----------------------------------------------- 0.00 0.00 1/400016 std::vector<int, std::allocator<int> >::vector(unsigned long, int const&, std::allocator<int> const&) [26] 0.01 0.05 400015/400016 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][12] 18.8 0.01 0.05 400016 std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) [12] 0.03 0.02 400016/400016 std::_Vector_base<int, std::allocator<int> >::_M_create_storage(unsigned long) [13] 0.00 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(std::allocator<int> const&) [50]----------------------------------------------- 0.03 0.02 400016/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) [12][13] 15.6 0.03 0.02 400016 std::_Vector_base<int, std::allocator<int> >::_M_create_storage(unsigned long) [13] 0.00 0.02 400016/400016 std::_Vector_base<int, std::allocator<int> >::_M_allocate(unsigned long) [19]----------------------------------------------- 0.00 0.03 200006/200006 merge_sort(std::vector<int, std::allocator<int> >) [2][14] 10.4 0.00 0.03 200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14] 0.00 0.03 200006/200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [16] 0.00 0.00 200006/600021 std::vector<int, std::allocator<int> >::begin() const [23] 0.00 0.00 400012/1200030 std::vector<int, std::allocator<int> >::size() const [39] 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::capacity() const [59] 0.00 0.00 200006/1000038 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() [40] 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::end() [62] 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::begin() [63] 0.00 0.00 200006/600021 std::vector<int, std::allocator<int> >::end() const [41] 0.00 0.00 200006/200006 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, std::allocator<int>&) [66]----------------------------------------------- 0.00 0.03 200006/200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [16][15] 9.4 0.00 0.03 200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [15] 0.01 0.02 200006/600021 int* std::__copy_move_a<false, int const*, int*>(int const*, int const*, int*) [7] 0.00 0.00 400012/1200042 std::_Niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [38] 0.00 0.00 200006/200006 std::_Niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [64] 0.00 0.00 200006/600018 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::__normal_iterator(int* const&) [42]----------------------------------------------- 0.00 0.03 200006/200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14][16] 9.4 0.00 0.03 200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [16] 0.00 0.03 200006/200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [15] 0.00 0.00 400012/1200042 std::_Miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [37]----------------------------------------------- 0.00 0.00 200000/14466088 main [1] 0.00 0.00 400000/14466088 check_sort(std::vector<int, std::allocator<int> >) [25] 0.02 0.00 13866088/14466088 merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int) [4][17] 6.2 0.02 0.00 14466088 std::vector<int, std::allocator<int> >::operator[](unsigned long) [17]----------------------------------------------- 0.02 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::_M_allocate(unsigned long) [19][18] 6.2 0.02 0.00 400016 __gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*) [18] 0.00 0.00 400016/400016 __gnu_cxx::new_allocator<int>::max_size() const [46]----------------------------------------------- 0.00 0.02 400016/400016 std::_Vector_base<int, std::allocator<int> >::_M_create_storage(unsigned long) [13][19] 6.2 0.00 0.02 400016 std::_Vector_base<int, std::allocator<int> >::_M_allocate(unsigned long) [19] 0.02 0.00 400016/400016 __gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*) [18]----------------------------------------------- 0.01 0.01 400016/400016 std::_Vector_base<int, std::allocator<int> >::~_Vector_base() [21][20] 6.2 0.01 0.01 400016 std::_Vector_base<int, std::allocator<int> >::_M_deallocate(int*, unsigned long) [20] 0.01 0.00 400016/400016 __gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long) [24]----------------------------------------------- 0.00 0.02 400016/400016 std::vector<int, std::allocator<int> >::~vector() [22][21] 6.2 0.00 0.02 400016 std::_Vector_base<int, std::allocator<int> >::~_Vector_base() [21] 0.01 0.01 400016/400016 std::_Vector_base<int, std::allocator<int> >::_M_deallocate(int*, unsigned long) [20] 0.00 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl() [51]----------------------------------------------- 0.00 0.00 2/400016 main [1] 0.00 0.02 400014/400016 merge_sort(std::vector<int, std::allocator<int> >) [2][22] 6.2 0.00 0.02 400016 std::vector<int, std::allocator<int> >::~vector() [22] 0.00 0.02 400016/400016 std::_Vector_base<int, std::allocator<int> >::~_Vector_base() [21] 0.00 0.00 400016/1000038 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() [40] 0.00 0.00 400016/400016 void std::_Destroy<int*, int>(int*, int*, std::allocator<int>&) [54]----------------------------------------------- 0.00 0.00 200006/600021 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14] 0.01 0.00 400015/600021 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][23] 3.1 0.01 0.00 600021 std::vector<int, std::allocator<int> >::begin() const [23] 0.00 0.00 600021/1200042 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::__normal_iterator(int const* const&) [33]----------------------------------------------- 0.01 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::_M_deallocate(int*, unsigned long) [20][24] 3.1 0.01 0.00 400016 __gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long) [24]----------------------------------------------- 0.00 0.00 2/2 merge_sort(std::vector<int, std::allocator<int> >) [2][25] 0.2 0.00 0.00 2 check_sort(std::vector<int, std::allocator<int> >) [25] 0.00 0.00 400000/14466088 std::vector<int, std::allocator<int> >::operator[](unsigned long) [17] 0.00 0.00 200001/1200030 std::vector<int, std::allocator<int> >::size() const [39]----------------------------------------------- 0.00 0.00 1/1 main [1][26] 0.0 0.00 0.00 1 std::vector<int, std::allocator<int> >::vector(unsigned long, int const&, std::allocator<int> const&) [26] 0.00 0.00 1/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) [12] 0.00 0.00 1/1 std::vector<int, std::allocator<int> >::_M_fill_initialize(unsigned long, int const&) [72]----------------------------------------------- 0.00 0.00 600021/1200042 std::vector<int, std::allocator<int> >::begin() const [23] 0.00 0.00 600021/1200042 std::vector<int, std::allocator<int> >::end() const [41][33] 0.0 0.00 0.00 1200042 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::__normal_iterator(int const* const&) [33]----------------------------------------------- 0.00 0.00 1200042/1200042 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [36][34] 0.0 0.00 0.00 1200042 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::base() const [34]----------------------------------------------- 0.00 0.00 1200042/1200042 std::_Miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [37][35] 0.0 0.00 0.00 1200042 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, false>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [35]----------------------------------------------- 0.00 0.00 1200042/1200042 std::_Niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [38][36] 0.0 0.00 0.00 1200042 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [36] 0.00 0.00 1200042/1200042 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::base() const [34]----------------------------------------------- 0.00 0.00 400012/1200042 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [16] 0.00 0.00 800030/1200042 int* std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [10][37] 0.0 0.00 0.00 1200042 std::_Miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [37] 0.00 0.00 1200042/1200042 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, false>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [35]----------------------------------------------- 0. 00 0.00 400012/1200042 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [15] 0.00 0.00 800030/1200042 int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [9][38] 0.0 0.00 0.00 1200042 std::_Niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [38] 0.00 0.00 1200042/1200042 std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [36]----------------------------------------------- 0.00 0.00 1/1200030 merge_sort(std::vector<int, std::allocator<int> >) [2] 0.00 0.00 200001/1200030 main [1] 0.00 0.00 200001/1200030 check_sort(std::vector<int, std::allocator<int> >) [25] 0.00 0.00 400012/1200030 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14] 0.00 0.00 400015/1200030 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][39] 0.0 0.00 0.00 1200030 std::vector<int, std::allocator<int> >::size() const [39]----------------------------------------------- 0.00 0.00 1/1000038 std::vector<int, std::allocator<int> >::_M_fill_initialize(unsigned long, int const&) [72] 0.00 0.00 200006/1000038 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14] 0.00 0.00 400015/1000038 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3] 0.00 0.00 400016/1000038 std::vector<int, std::allocator<int> >::~vector() [22][40] 0.0 0.00 0.00 1000038 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() [40]----------------------------------------------- 0.00 0.00 200006/600021 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14] 0.00 0.00 400015/600021 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][41] 0.0 0.00 0.00 600021 std::vector<int, std::allocator<int> >::end() const [41] 0.00 0.00 600021/1200042 __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::__normal_iterator(int const* const&) [33]----------------------------------------------- 0.00 0.00 200006/600018 std::vector<int, std::allocator<int> >::begin() [63] 0.00 0.00 200006/600018 std::vector<int, std::allocator<int> >::end() [62] 0.00 0.00 200006/600018 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [15][42] 0.0 0.00 0.00 600018 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::__normal_iterator(int* const&) [42]----------------------------------------------- 0.00 0.00 400017/400017 std::allocator<int>::~allocator() [44][43] 0.0 0.00 0.00 400017 __gnu_cxx::new_allocator<int>::~new_allocator() [43]----------------------------------------------- 0.00 0.00 1/400017 main [1] 0.00 0.00 400016/400017 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl() [51][44] 0.0 0.00 0.00 400017 std::allocator<int>::~allocator() [44] 0.00 0.00 400017/400017 __gnu_cxx::new_allocator<int>::~new_allocator() [43]----------------------------------------------- 0.00 0.00 400016/400016 std::allocator<int>::allocator(std::allocator<int> const&) [47][45] 0.0 0.00 0.00 400016 __gnu_cxx::new_allocator<int>::new_allocator(__gnu_cxx::new_allocator<int> const&) [45]----------------------------------------------- 0.00 0.00 400016/400016 __gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*) [18][46] 0.0 0.00 0.00 400016 __gnu_cxx::new_allocator<int>::max_size() const [46]----------------------------------------------- 0.00 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(std::allocator<int> const&) [50][47] 0.0 0.00 0.00 400016 std::allocator<int>::allocator(std::allocator<int> const&) [47] 0.00 0.00 400016/400016 __gnu_cxx::new_allocator<int>::new_allocator(__gnu_cxx::new_allocator<int> const&) [45]----------------------------------------------- 0.00 0.00 400016/400016 std::_Niter_base<int*>::iterator_type std::__niter_base<int*>(int*) [52][48] 0.0 0.00 0.00 400016 std::_Iter_base<int*, false>::_S_base(int*) [48]----------------------------------------------- 0.00 0.00 400016/400016 void std::_Destroy<int*>(int*, int*) [53][49] 0.0 0.00 0.00 400016 void std::_Destroy_aux<true>::__destroy<int*>(int*, int*) [49]----------------------------------------------- 0.00 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) [12][50] 0.0 0.00 0.00 400016 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(std::allocator<int> const&) [50] 0.00 0.00 400016/400016 std::allocator<int>::allocator(std::allocator<int> const&) [47]----------------------------------------------- 0.00 0.00 400016/400016 std::_Vector_base<int, std::allocator<int> >::~_Vector_base() [21][51] 0.0 0.00 0.00 400016 std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl() [51] 0.00 0.00 400016/400017 std::allocator<int>::~allocator() [44]----------------------------------------------- 0.00 0.00 1/400016 int* std::fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [76] 0.00 0.00 400015/400016 int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [9][52] 0.0 0.00 0.00 400016 std::_Niter_base<int*>::iterator_type std::__niter_base<int*>(int*) [52] 0.00 0.00 400016/400016 std::_Iter_base<int*, false>::_S_base(int*) [48]----------------------------------------------- 0.00 0.00 400016/400016 void std::_Destroy<int*, int>(int*, int*, std::allocator<int>&) [54][53] 0.0 0.00 0.00 400016 void std::_Destroy<int*>(int*, int*) [53] 0.00 0.00 400016/400016 void std::_Destroy_aux<true>::__destroy<int*>(int*, int*) [49]----------------------------------------------- 0.00 0.00 400016/400016 std::vector<int, std::allocator<int> >::~vector() [22][54] 0.0 0.00 0.00 400016 void std::_Destroy<int*, int>(int*, int*, std::allocator<int>&) [54] 0.00 0.00 400016/400016 void std::_Destroy<int*>(int*, int*) [53]----------------------------------------------- 0.00 0.00 400015/400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][55] 0.0 0.00 0.00 400015 __gnu_cxx::__alloc_traits<std::allocator<int> >::_S_select_on_copy(std::allocator<int> const&) [55]----------------------------------------------- 0.00 0.00 400015/400015 std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [3][56] 0.0 0.00 0.00 400015 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() const [56]----------------------------------------------- 0.00 0.00 400012/400012 merge_sort(std::vector<int, std::allocator<int> >) [2][57] 0.0 0.00 0.00 400012 unsigned int const& std::min<unsigned int>(unsigned int const&, unsigned int const&) [57]----------------------------------------------- 0.00 0.00 200006/200006 std::_Iter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [60][58] 0.0 0.00 0.00 200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::base() const [58]----------------------------------------------- 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14][59] 0.0 0.00 0.00 200006 std::vector<int, std::allocator<int> >::capacity() const [59]----------------------------------------------- 0.00 0.00 200006/200006 std::_Niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [64][60] 0.0 0.00 0.00 200006 std::_Iter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [60] 0.00 0.00 200006/200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::base() const [58]----------------------------------------------- 0.00 0.00 200006/200006 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [65][61] 0.0 0.00 0.00 200006 void std::_Destroy_aux<true>::__destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [61]----------------------------------------------- 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14][62] 0.0 0.00 0.00 200006 std::vector<int, std::allocator<int> >::end() [62] 0.00 0.00 200006/600018 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::__normal_iterator(int* const&) [42]----------------------------------------------- 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14][63] 0.0 0.00 0.00 200006 std::vector<int, std::allocator<int> >::begin() [63] 0.00 0.00 200006/600018 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::__normal_iterator(int* const&) [42]----------------------------------------------- 0.00 0.00 200006/200006 __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [15][64] 0.0 0.00 0.00 200006 std::_Niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [64] 0.00 0.00 200006/200006 std::_Iter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [60]----------------------------------------------- 0.00 0.00 200006/200006 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, std::allocator<int>&) [66][65] 0.0 0.00 0.00 200006 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [65] 0.00 0.00 200006/200006 void std::_Destroy_aux<true>::__destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [61]----------------------------------------------- 0.00 0.00 200006/200006 std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [14][66] 0.0 0.00 0.00 200006 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, std::allocator<int>&) [66] 0.00 0.00 200006/200006 void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [65]----------------------------------------------- 0.00 0.00 1/1 __libc_csu_init [90][67] 0.0 0.00 0.00 1 _GLOBAL__sub_I_main [67] 0.00 0.00 1/1 __static_initialization_and_destruction_0(int, int) [68]----------------------------------------------- 0.00 0.00 1/1 _GLOBAL__sub_I_main [67][68] 0.0 0.00 0.00 1 __static_initialization_and_destruction_0(int, int) [68]----------------------------------------------- 0.00 0.00 1/1 std::allocator<int>::allocator() [70][69] 0.0 0.00 0.00 1 __gnu_cxx::new_allocator<int>::new_allocator() [69]----------------------------------------------- 0.00 0.00 1/1 main [1][70] 0.0 0.00 0.00 1 std::allocator<int>::allocator() [70] 0.00 0.00 1/1 __gnu_cxx::new_allocator<int>::new_allocator() [69]----------------------------------------------- 0.00 0.00 1/1 void std::uninitialized_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [74][71] 0.0 0.00 0.00 1 void std::__uninitialized_fill_n<true>::__uninit_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [71] 0.00 0.00 1/1 int* std::fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [76]----------------------------------------------- 0.00 0.00 1/1 std::vector<int, std::allocator<int> >::vector(unsigned long, int const&, std::allocator<int> const&) [26][72] 0.0 0.00 0.00 1 std::vector<int, std::allocator<int> >::_M_fill_initialize(unsigned long, int const&) [72] 0.00 0.00 1/1000038 std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() [40] 0.00 0.00 1/1 void std::__uninitialized_fill_n_a<int*, unsigned long, int, int>(int*, unsigned long, int const&, std::allocator<int>&) [75]----------------------------------------------- 0.00 0.00 1/1 int* std::fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [76][73] 0.0 0.00 0.00 1 __gnu_cxx::__enable_if<std::__is_scalar<int>::__value, int*>::__type std::__fill_n_a<int*, unsigned long, int>(int*, unsigned long, int const&) [73]----------------------------------------------- 0.00 0.00 1/1 void std::__uninitialized_fill_n_a<int*, unsigned long, int, int>(int*, unsigned long, int const&, std::allocator<int>&) [75][74] 0.0 0.00 0.00 1 void std::uninitialized_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [74] 0.00 0.00 1/1 void std::__uninitialized_fill_n<true>::__uninit_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [71]----------------------------------------------- 0.00 0.00 1/1 std::vector<int, std::allocator<int> >::_M_fill_initialize(unsigned long, int const&) [72][75] 0.0 0.00 0.00 1 void std::__uninitialized_fill_n_a<int*, unsigned long, int, int>(int*, unsigned long, int const&, std::allocator<int>&) [75] 0.00 0.00 1/1 void std::uninitialized_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [74]----------------------------------------------- 0.00 0.00 1/1 void std::__uninitialized_fill_n<true>::__uninit_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [71][76] 0.0 0.00 0.00 1 int* std::fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [76] 0.00 0.00 1/400016 std::_Niter_base<int*>::iterator_type std::__niter_base<int*>(int*) [52] 0.00 0.00 1/1 __gnu_cxx::__enable_if<std::__is_scalar<int>::__value, int*>::__type std::__fill_n_a<int*, unsigned long, int>(int*, unsigned long, int const&) [73]-----------------------------------------------�Index by function name [67] _GLOBAL__sub_I_main [44] std::allocator<int>::~allocator() [22] std::vector<int, std::allocator<int> >::~vector() [25] check_sort(std::vector<int, std::allocator<int> >) [35] std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, false>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [14] std::vector<int, std::allocator<int> >::operator=(std::vector<int, std::allocator<int> > const&) [2] merge_sort(std::vector<int, std::allocator<int> >) [36] std::_Iter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [17] std::vector<int, std::allocator<int> >::operator[](unsigned long) [68] __static_initialization_and_destruction_0(int, int) [60] std::_Iter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, true>::_S_base(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [73] __gnu_cxx::__enable_if<std::__is_scalar<int>::__value, int*>::__type std::__fill_n_a<int*, unsigned long, int>(int*, unsigned long, int const&) [4] merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int) [48] std::_Iter_base<int*, false>::_S_base(int*) [37] std::_Miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__miter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [24] __gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long) [11] int* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<int>(int const*, int const*, int*) [38] std::_Niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) [18] __gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*) [61] void std::_Destroy_aux<true>::__destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [64] std::_Niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::iterator_type std::__niter_base<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [45] __gnu_cxx::new_allocator<int>::new_allocator(__gnu_cxx::new_allocator<int> const&) [49] void std::_Destroy_aux<true>::__destroy<int*>(int*, int*) [52] std::_Niter_base<int*>::iterator_type std::__niter_base<int*>(int*) [69] __gnu_cxx::new_allocator<int>::new_allocator() [19] std::_Vector_base<int, std::allocator<int> >::_M_allocate(unsigned long) [7] int* std::__copy_move_a<false, int const*, int*>(int const*, int const*, int*) [43] __gnu_cxx::new_allocator<int>::~new_allocator() [50] std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(std::allocator<int> const&) [15] __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [55] __gnu_cxx::__alloc_traits<std::allocator<int> >::_S_select_on_copy(std::allocator<int> const&) [51] std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl() [9] int* std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [33] __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::__normal_iterator(int const* const&) [20] std::_Vector_base<int, std::allocator<int> >::_M_deallocate(int*, unsigned long) [6] int* std::uninitialized_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [42] __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::__normal_iterator(int* const&) [13] std::_Vector_base<int, std::allocator<int> >::_M_create_storage(unsigned long) [74] void std::uninitialized_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [46] __gnu_cxx::new_allocator<int>::max_size() const [40] std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() [5] int* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, int>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*, std::allocator<int>&) [34] __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >::base() const [12] std::_Vector_base<int, std::allocator<int> >::_Vector_base(unsigned long, std::allocator<int> const&) [75] void std::__uninitialized_fill_n_a<int*, unsigned long, int, int>(int*, unsigned long, int const&, std::allocator<int>&) [58] __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >::base() const [21] std::_Vector_base<int, std::allocator<int> >::~_Vector_base() [57] unsigned int const& std::min<unsigned int>(unsigned int const&, unsigned int const&) [56] std::_Vector_base<int, std::allocator<int> >::_M_get_Tp_allocator() const [8] int* std::__uninitialized_copy<true>::__uninit_copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [16] __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [41] std::vector<int, std::allocator<int> >::end() const [71] void std::__uninitialized_fill_n<true>::__uninit_fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [10] int* std::copy<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*>(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, int*) [39] std::vector<int, std::allocator<int> >::size() const [72] std::vector<int, std::allocator<int> >::_M_fill_initialize(unsigned long, int const&) [76] int* std::fill_n<int*, unsigned long, int>(int*, unsigned long, int const&) [23] std::vector<int, std::allocator<int> >::begin() const [62] std::vector<int, std::allocator<int> >::end() [65] void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >) [59] std::vector<int, std::allocator<int> >::capacity() const [63] std::vector<int, std::allocator<int> >::begin() [66] void std::_Destroy<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, std::allocator<int>&) [47] std::allocator<int>::allocator(std::allocator<int> const&) [3] std::vector<int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&) [53] void std::_Destroy<int*>(int*, int*) [70] std::allocator<int>::allocator() [26] std::vector<int, std::allocator<int> >::vector(unsigned long, int const&, std::allocator<int> const&) [54] void std::_Destroy<int*, int>(int*, int*, std::allocator<int>&) |}
21.90 0.07 0.07 600021 0.00 0.00 int* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<int>(int const*, int const*, int*)
15.64 0.12 0.05 200006 0.00 0.00 merge(std::vector<int, std::allocator<int> >, unsigned int, unsigned int, unsigned int)
From the flat profile,the hotspots for this program would be the function merge function whih was called 200,006 times and thee int* std::__copy__move. The merge function would take up 52.3% of the time
----
=== Assignment 2 ===
Our initial idea was to use the neural network code for our assignment 2. But since the algorithm itself was not very accurate (2/10 correct predictions even after 10,000 training iterations), we decided to paralellize merge sort. Soon we realized that since its Big O classification was n log n, offloading computations to GPU would not be that effective. So, we settled with the cosine transform library, as described below.
====Cosine Tranformation====
The Cosine_Transform is a simple C++ library which demonstrates properties of the Discrete cosine Transform for real data. The Discrete Cosine Transform or DCT is used to create jpeg (compressed images).
The formula used here is:
| (√1/n) , if u=0; 0≤v≤n-1
C(u,v) =
| (√2/n) * cos[((2*v+1)π*u)/2n], if 1≤u≤n-1; 0≤v≤n-1
Where, u is the row index, v is the column index and n is the total number of elements in a row/column in the computational matrix.
This [https://www.youtube.com/watch?v=tW3Hc0Wrgl0 Link] can be used for better understanding of the above formula. Here is the [https://people.sc.fsu.edu/~jburkardt/cpp_src/cosine_transform/cosine_transform.html source code] used.
=====Profiling=====
The flat profile for the above serial code looks like:
{| class="wikitable mw-collapsible mw-collapsed"
! Flat Profile
|-
|
1
2
3
4 granularity: each sample hit covers 2 byte(s) for 0.68% of 1.47 seconds
5
6 index % time self children called name
7 <spontaneous>
8 [1] 100.0 0.00 1.47 main [1]
9 0.00 1.47 1/1 cosine_transform_test01(int) [3]
10 -----------------------------------------------
11 1.47 0.00 1/1 cosine_transform_test01(int) [3]
12 [2] 100.0 1.47 0.00 1 cosine_transform_data(int, double*) [2]
13 -----------------------------------------------
14 0.00 1.47 1/1 main [1]
15 [3] 100.0 0.00 1.47 1 cosine_transform_test01(int) [3]
16 1.47 0.00 1/1 cosine_transform_data(int, double*) [2]
17 0.00 0.00 1/1 r8vec_uniform_01_new(int, int&) [14]
18 0.00 0.00 1/1 reportTime(char const*, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) [13]
19 0.00 0.00 1/1 std::common_type<std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >::type std::chrono::operator-<std::chrono::_V2::s teady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 10 00000000l> > > const&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) [21]
20 -----------------------------------------------
21 0.00 0.00 1/3 std::chrono::duration<long, std::ratio<1l, 1000l> > std::chrono::__duration_cast_impl<std::chrono::duration<long, std::ratio<1l, 1000l> >, std::ratio<1l, 1000000l>, long, true, false>: :__cast<long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [18]
22 0.00 0.00 2/3 std::common_type<std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >::type std::chrono::operator-<long, std::ratio<1l , 1000000000l>, long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&, std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [22]
23 [10] 0.0 0.00 0.00 3 std::chrono::duration<long, std::ratio<1l, 1000000000l> >::count() const [10]
24 -----------------------------------------------
25 0.00 0.00 2/2 std::common_type<std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >::type std::chrono::operator-<std::chrono::_V2::s teady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 10 00000000l> > > const&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) [21]
26 [11] 0.0 0.00 0.00 2 std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >::time_since_epoch() const [11]
27 -----------------------------------------------
28 0.00 0.00 1/1 __libc_csu_init [28]
29 [12] 0.0 0.00 0.00 1 _GLOBAL__sub_I__Z20r8vec_uniform_01_newiRi [12]
30 0.00 0.00 1/1 __static_initialization_and_destruction_0(int, int) [15]
31 -----------------------------------------------
32 0.00 0.00 1/1 cosine_transform_test01(int) [3]
33 [13] 0.0 0.00 0.00 1 reportTime(char const*, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) [13]
34 0.00 0.00 1/1 std::enable_if<std::chrono::__is_duration<std::chrono::duration<long, std::ratio<1l, 1000l> > >::value, std::chrono::duration<long, std::ratio<1l, 1000l> > >::type std::chrono::duratio n_cast<std::chrono::duration<long, std::ratio<1l, 1000l> >, long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [17]
35 0.00 0.00 1/1 std::chrono::duration<long, std::ratio<1l, 1000l> >::count() const [16]
36 -----------------------------------------------
37 0.00 0.00 1/1 cosine_transform_test01(int) [3]
38 [14] 0.0 0.00 0.00 1 r8vec_uniform_01_new(int, int&) [14]
39 -----------------------------------------------
40 0.00 0.00 1/1 _GLOBAL__sub_I__Z20r8vec_uniform_01_newiRi [12]
41 [15] 0.0 0.00 0.00 1 __static_initialization_and_destruction_0(int, int) [15]
42 -----------------------------------------------
43 0.00 0.00 1/1 reportTime(char const*, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) [13]
44 [16] 0.0 0.00 0.00 1 std::chrono::duration<long, std::ratio<1l, 1000l> >::count() const [16]
45 -----------------------------------------------
46 0.00 0.00 1/1 reportTime(char const*, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) [13]
47 [17] 0.0 0.00 0.00 1 std::enable_if<std::chrono::__is_duration<std::chrono::duration<long, std::ratio<1l, 1000l> > >::value, std::chrono::duration<long, std::ratio<1l, 1000l> > >::type std::chrono::duration_ca st<std::chrono::duration<long, std::ratio<1l, 1000l> >, long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [17]
48 0.00 0.00 1/1 std::chrono::duration<long, std::ratio<1l, 1000l> > std::chrono::__duration_cast_impl<std::chrono::duration<long, std::ratio<1l, 1000l> >, std::ratio<1l, 1000000l>, long, true, false>: :__cast<long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [18]
49 -----------------------------------------------
50 0.00 0.00 1/1 std::enable_if<std::chrono::__is_duration<std::chrono::duration<long, std::ratio<1l, 1000l> > >::value, std::chrono::duration<long, std::ratio<1l, 1000l> > >::type std::chrono::duratio n_cast<std::chrono::duration<long, std::ratio<1l, 1000l> >, long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [17]
51 [18] 0.0 0.00 0.00 1 std::chrono::duration<long, std::ratio<1l, 1000l> > std::chrono::__duration_cast_impl<std::chrono::duration<long, std::ratio<1l, 1000l> >, std::ratio<1l, 1000000l>, long, true, false>::__c ast<long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) [18]
52 0.00 0.00 1/3 std::chrono::duration<long, std::ratio<1l, 1000000000l> >::count() const [10]
|}
As is evident, the algorithm is O(n2) currently. Using thread indices on the GPU to replace the for loops could potentially improve performance.
To increase the efficiency of the program we transformed the '''cosine_transform_data''' function into a kernel named '''cosTransformKernel''' which offloads the compute intense calculation of the program to the GPU.
=====Kernel Version 1=====
{| class="wikitable mw-collapsible mw-collapsed"
! Modified Code
|-
|
# include <iostream>
# include <iomanip>
# include <ctime>
# include <chrono>
# include <cstdlib>
# include <cmath>
#include <cuda_runtime.h>
using namespace std;
using namespace std::chrono;
const double pi = 3.141592653589793;
const int ntpb = 1024;
void cosine_transform_test01 ( int size );
double *r8vec_uniform_01_new ( int n, int &seed ){
int i;
const int i4_huge = 2147483647;
int k;
double *r;
if ( seed == 0 ){
cerr << "\n";
cerr << "R8VEC_UNIFORM_01_NEW - Fatal error!\n";
cerr << " Input value of SEED = 0.\n";
exit ( 1 );
}
r = new double[n];
for ( i = 0; i < n; i++ ){
k = seed / 127773;
seed = 16807 * ( seed - k * 127773 ) - k * 2836;
if ( seed < 0 ){
seed = seed + i4_huge;
}
r[i] = ( double ) ( seed ) * 4.656612875E-10;
}
return r;
}
double *cosine_transform_data ( int n, double d[] ){
double angle;
double *c;
int i;
int j;
c = new double[n];
for ( i = 0; i < n; i++ ){
c[i] = 0.0;
for ( j = 0; j < n; j++ ){
angle = pi * ( double ) ( i * ( 2 * j + 1 ) ) / ( double ) ( 2 * n );
c[i] = c[i] + cos ( angle ) * d[j];
}
c[i] = c[i] * sqrt ( 2.0 / ( double ) ( n ) );
}
return c;
}
void reportTime(const char* msg, steady_clock::duration span) {
auto ms = duration_cast<milliseconds>(span);
std::cout << msg << " - took - " <<
ms.count() << " millisecs" << std::endl;
}
__global__ void cosTransformKernel(double *a, double *b, int n){
double angle;
const double pi = 3.141592653589793;
int i = blockIdx.x * blockDim.x + threadIdx.x;
for(int j=0; j<n; j++){
angle = pi * (double) (i*(2*j+1)) / (double)(2*n);
b[i] += cos ( angle ) * a[j];
}
b[i] *= sqrt( 2.0 / (double) n );
}
int main (int argc, char* argv[] ){
if (argc != 2) {
std::cerr << argv[0] << ": invalid number of arguments\n";
std::cerr << "Usage: " << argv[0] << " size_of_vector\n";
return 1;
}
int n = std::atoi(argv[1]);
cosine_transform_test01 (n);
return 0;
}
void cosine_transform_test01 ( int size){
int n = size;
int seed;
double *r;
double *hs;
double *s = new double[n];
double *d_a;
double *d_b;
//allocate memory on the device for the randomly generated array and for the array in which transform values will be stored
cudaMalloc((void**)&d_a,sizeof(double) * n);
cudaMalloc((void**)&d_b,sizeof(double) * n);
seed = 123456789;
r = r8vec_uniform_01_new ( n, seed );
//copy randomly generated values from host to device
cudaMemcpy(d_a,r,sizeof(double)*n,cudaMemcpyHostToDevice);
int nblks = (n + ntpb - 1) / ntpb;
steady_clock::time_point ts, te;
ts = steady_clock::now();
cosTransformKernel<<<nblks,ntpb>>>(d_a,d_b,size);
cudaDeviceSynchronize();
te = steady_clock::now();
reportTime("Cosine Transform on device",te-ts);
cudaMemcpy(s,d_b,sizeof(double)*n,cudaMemcpyDeviceToHost);
ts = steady_clock::now();
hs = cosine_transform_data ( n, r );
te = steady_clock::now();
reportTime("Cosine Transform on host",te-ts);
cudaFree(d_a);
cudaFree(d_b);
delete [] r;
delete [] s;
delete [] hs;
}
|}
The graph for the execution time difference between the device and the host looks like:
[[File:kernel1.png]]
Even though the kernel includes a for-loop the execution time has decreased drastically. Thats because each thread is now responsible for one calculating one element of the final Cos transformed matrix(unit vector).
=== Assignment 3 ===
For optimizing the code better, we thought of removing the iterative loop from the kernel by using threadIdx.y to control calculation of each element's cosine for that position in the supposed matrix. The problem in this was that each thread was in a racing condition to write to the same memory location, to sum up the cosine transformations for all elements of that row. We solved this by using the atomic function. Its prototype is as follows.
double atomicAdd(double* address, double value)
=====Kernel Version 2=====
{| class="wikitable mw-collapsible mw-collapsed"
! Kernel 2
|-
|
# include <cmath>
# include <cstdlib>
# include <iostream>
# include <iomanip>
# include <ctime>
# include <chrono>
# include <cstdlib>
# include <cmath>
#include <limits>
#include <cuda_runtime.h>
#include <cuda.h>
using namespace std;
using namespace std::chrono;
const double pi = 3.141592653589793;
const unsigned ntpb = 32;
void cosine_transform_test01 ( int size );
double *r8vec_uniform_01_new ( int n, int &seed ){
int i;
const int i4_huge = 2147483647;
int k;
double *r;
if ( seed == 0 ){
cerr << "\n";
cerr << "R8VEC_UNIFORM_01_NEW - Fatal error!\n";
cerr << " Input value of SEED = 0.\n";
exit ( 1 );
}
r = new double[n];
for ( i = 0; i < n; i++ ){
k = seed / 127773;
seed = 16807 * ( seed - k * 127773 ) - k * 2836;
if ( seed < 0 ){
seed = seed + i4_huge;
}
r[i] = ( double ) ( seed ) * 4.656612875E-10;
}
return r;
}
double *cosine_transform_data ( int n, double d[] ){
double angle;
double *c;
int i;
int j;
c = new double[n];
for ( i = 0; i < n; i++ ){
c[i] = 0.0;
for ( j = 0; j < n; j++ ){
angle = pi * ( double ) ( i * ( 2 * j + 1 ) ) / ( double ) ( 2 * n );
c[i] = c[i] + cos ( angle ) * d[j];
}
c[i] = c[i] * sqrt ( 2.0 / ( double ) ( n ) );
}
return c;
}
void reportTime(const char* msg, steady_clock::duration span) {
auto ms = duration_cast<milliseconds>(span);
std::cout << msg << " - took - " <<
ms.count() << " millisecs" << std::endl;
}
__global__ void cosTransformKernel(double *a, double *b, const int n){
double angle;
const double pi = 3.141592653589793;
int j = blockIdx.x * blockDim.x + threadIdx.x;
int i = blockIdx.y * blockDim.y + threadIdx.y;
if(i<n && j<n){
angle = pi * ( double ) ( i * ( 2 * j + 1 ) ) / ( double ) ( 2 * n );
double value = cos ( angle ) * a[j];
b[i] = atomicAdd(&b[i], value);
}
//square root of the whole cos transformed row term
if(j==n-1 && i<n){
b[i] *= sqrt ( 2.0 / ( double ) ( n ) );
}
}
int main (int argc, char* argv[] ){
if (argc != 2) {
std::cerr << argv[0] << ": invalid number of arguments\n";
std::cerr << "Usage: " << argv[0] << " size_of_vector\n";
return 1;
}
int n = std::atoi(argv[1]);
cosine_transform_test01 (n);
return 0;
}
void cosine_transform_test01 ( int size){
int n = size;
int seed;
double *r;
double *hs; //host side pointer to store the array returned from host side cosine_transform_data, for comparison purposes
double *s = new double[n];
//double *t;
double *d_a;
double *d_b;
//allocate memory on the device for the randomly generated array and for the array in which transform values will be stored
cudaMalloc((void**)&d_a,sizeof(double) * n);
cudaMalloc((void**)&d_b,sizeof(double) * n);
seed = 123456789;
r = r8vec_uniform_01_new ( n, seed );
//copy randomly generated values from host to device
for(int i=0; i<n; i++)
s[i]=0.0;
cudaMemcpy(d_a,r,sizeof(double)*n,cudaMemcpyHostToDevice);
cudaMemcpy(d_b,s,sizeof(double)*n,cudaMemcpyHostToDevice);
int nblks = (n + ntpb - 1) / ntpb;
dim3 grid(nblks,nblks,1);
dim3 block(ntpb,ntpb,1);
steady_clock::time_point ts, te;
ts = steady_clock::now();
cosTransformKernel<<<grid,block>>>(d_a,d_b,size);
cudaDeviceSynchronize();
te = steady_clock::now();
reportTime("Cosine Transform on device",te-ts);
cudaMemcpy(s,d_b,sizeof(double)*n,cudaMemcpyDeviceToHost);
ts = steady_clock::now();
hs = cosine_transform_data ( n, r );
te = steady_clock::now();
reportTime("Cosine Transform on host",te-ts);
cudaFree(d_a);
cudaFree(d_b);
delete [] r;
delete [] s;
delete [] hs;
//delete [] t;
return;
}
|}
Here is a comparison between the naive and optimized kernel
[[File:kernel2.jpg]]
Evidently, there is some performance boost for the new version. However, each call to atomicAdd by a thread locks the global memory until the old value is read and added to the passed value. This deters faster execution as might be expected.