Skip to content

Commit 21ed8cb

Browse files
author
Nesterov Alexander
committed
Added new exe
1 parent a0f0d3a commit 21ed8cb

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

modules/test_tasks/mpi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project( mpi_test )
1+
project( test_mpi )
22

33
message( STATUS "-- " ${PROJECT_NAME} )
44
add_executable( ${PROJECT_NAME} main.cpp )

modules/test_tasks/mpi/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2018 Nesterov Alexander
2-
#include <assert.h>
32
#include <mpi.h>
4-
#include <iostream>
3+
#include <stdio.h>
54

65
int main(int argc, char* argv[]) {
76
int status, rank, size;
@@ -10,12 +9,17 @@ int main(int argc, char* argv[]) {
109

1110
status = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
1211
if (status != MPI_SUCCESS) { return -1; }
12+
if (rank == 0) {
13+
printf("----------------------------------\n");
14+
printf("MPI Test Program\n");
15+
printf("----------------------------------\n");
16+
}
17+
MPI_Barrier(MPI_COMM_WORLD);
1318

1419
status = MPI_Comm_size(MPI_COMM_WORLD, &size);
1520
if (status != MPI_SUCCESS) { return -1; }
1621

17-
std::cout << "Process #" << rank << '\n';
18-
std::cout << "Count process: " << size << '\n';
22+
printf("Process: %d | Count process: %d\n", rank, size);
1923

2024
status = MPI_Finalize();
2125
if (status != MPI_SUCCESS) { return -1; }

modules/test_tasks/omp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project( omp_test )
1+
project( test_omp )
22

33
if ( OpenMP_FOUND )
44
message( STATUS "-- " ${PROJECT_NAME} )

modules/test_tasks/omp/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <iostream>
55

66
int main(int argc, char* argv[]) {
7+
std::cout << "----------------------------------" << '\n';
8+
std::cout << "OpenMP Test Program" << '\n';
9+
std::cout << "----------------------------------" << '\n';
710
#pragma omp parallel
811
{
912
#pragma omp critical

modules/test_tasks/tbb/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project( tbb_test )
1+
project( test_tbb )
22

33
message( STATUS "-- " ${PROJECT_NAME} )
44
add_executable( ${PROJECT_NAME} main.cpp )

modules/test_tasks/tbb/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <iostream>
55

66
int main(int argc, char* argv[]) {
7+
std::cout << "----------------------------------" << '\n';
8+
std::cout << "TBB Test Program" << '\n';
9+
std::cout << "----------------------------------" << '\n';
710
tbb::flow::graph g;
811
tbb::flow::continue_node< tbb::flow::continue_msg > hello(g,
912
[](const tbb::flow::continue_msg &) { std::cout << "Hello"; });

run.bat

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
@echo off
2-
echo "##########################################"
3-
echo "mpi"
4-
echo "##########################################"
5-
mpiexec.exe -np 4 build\bin\mpi_test.exe
6-
7-
echo "##########################################"
8-
echo "omp"
9-
echo "##########################################"
10-
build\bin\omp_test.exe
11-
12-
echo "##########################################"
13-
echo "tbb"
14-
echo "##########################################"
15-
build\bin\tbb_test.exe
2+
for /r "." %%a in (build\bin\*_mpi.exe) do mpiexec -np 4 %%~fa
3+
for /r "." %%a in (build\bin\*_omp.exe) do %%~fa
4+
for /r "." %%a in (build\bin\*_tbb.exe) do %%~fa

run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ check_exist_file() {
77
echo "##########################################"
88
echo "mpi"
99
echo "##########################################"
10-
FILE="/build/bin/mpi_test"
10+
FILE="/build/bin/test_mpi"
1111
if check_exist_file $FILE;
1212
then
1313
mpirun -np 2 .$FILE;
@@ -18,7 +18,7 @@ fi
1818
echo "##########################################"
1919
echo "omp"
2020
echo "##########################################"
21-
FILE="/build/bin/omp_test"
21+
FILE="/build/bin/test_omp"
2222
if check_exist_file $FILE;
2323
then
2424
.$FILE;
@@ -29,7 +29,7 @@ fi
2929
echo "##########################################"
3030
echo "tbb"
3131
echo "##########################################"
32-
FILE="/build/bin/tbb_test"
32+
FILE="/build/bin/test_tbb"
3333
if check_exist_file $FILE;
3434
then
3535
.$FILE;

0 commit comments

Comments
 (0)