COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
main-short.cpp
Go to the documentation of this file.
1#include <mpi.h>
2
3#include <string>
4#include <iomanip>
5#include <cstdio>
6#include <cstdlib>
7#include <iostream>
8#include <vector>
9#include <omp.h>
10#include <sstream>
11
12
13#ifdef _PROFILE_SORT
14#include "sort_profiler.h"
15#endif
16
17#include <binUtils.h>
18#include <ompUtils.h>
19#include <parUtils.h>
20
21
22
23int main(int argc, char **argv){
24
25 int num_threads = 1;
26 omp_set_num_threads(num_threads);
27
28 // Initialize MPI
29 MPI_Init(&argc, &argv);
30 int myrank;
31 MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
32
33
34
35
36
37 std::vector<int> in;
38 if(myrank==0)
39 {
40 in.resize(2);
41 in[0] = 1;
42 in[1] = 2;
43 }
44
45
46
47 double t0 = omp_get_wtime();
48 par::sampleSort(in, MPI_COMM_WORLD);
49 double t1 = omp_get_wtime();
50
51 std::cout << myrank << ": all done in " << t1-t0 << std::endl;
52
53
54 MPI_Finalize();
55 return 0;
56
57 }
58
59
int main()
Definition Driver.cpp:12
int sampleSort(std::vector< T > &in, std::vector< T > &out, MPI_Comm comm)
A parallel sample sort implementation. In our implementation, we do not pose any restriction on the i...