From 6e62b31aab8c9b060cc3d5ebe6dbf941c3796a81 Mon Sep 17 00:00:00 2001 From: Ondrej Meca <ondrej.meca@vsb.cz> Date: Tue, 19 Nov 2019 09:50:08 +0100 Subject: [PATCH] FIX: add forgotten includes --- barrier.cpp | 1 + cgather.cpp | 1 + datatypes.cpp | 1 + exchange.cpp | 1 + gather.cpp | 1 + hello.cpp | 1 + igather.cpp | 1 + mpiio.cpp | 1 + msgorder.cpp | 1 + pingpong.cpp | 1 + pingpong2.cpp | 1 + syncsend.cpp | 1 + threads.cpp | 7 ++----- varysize.cpp | 1 + 14 files changed, 15 insertions(+), 5 deletions(-) diff --git a/barrier.cpp b/barrier.cpp index b11f7aa..5619394 100644 --- a/barrier.cpp +++ b/barrier.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <vector> int main(int argc, char **argv) { diff --git a/cgather.cpp b/cgather.cpp index 47d205e..398df7b 100644 --- a/cgather.cpp +++ b/cgather.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <vector> int main(int argc, char **argv) { diff --git a/datatypes.cpp b/datatypes.cpp index 2ce03b2..69716c2 100644 --- a/datatypes.cpp +++ b/datatypes.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> struct Data { char name[20]; diff --git a/exchange.cpp b/exchange.cpp index 0f794eb..5cf26de 100644 --- a/exchange.cpp +++ b/exchange.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> int main(int argc, char **argv) { MPI_Init(&argc, &argv); diff --git a/gather.cpp b/gather.cpp index b82fa1e..49aaced 100644 --- a/gather.cpp +++ b/gather.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <unistd.h> #include <vector> diff --git a/hello.cpp b/hello.cpp index 93b2f1f..927c56f 100644 --- a/hello.cpp +++ b/hello.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> int main(int argc, char **argv) { MPI_Init(&argc, &argv); diff --git a/igather.cpp b/igather.cpp index c02595b..12767d4 100644 --- a/igather.cpp +++ b/igather.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <unistd.h> #include <vector> diff --git a/mpiio.cpp b/mpiio.cpp index e7410ae..a246ce8 100644 --- a/mpiio.cpp +++ b/mpiio.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <string> int main(int argc, char **argv) { diff --git a/msgorder.cpp b/msgorder.cpp index cc861bd..1c13e11 100644 --- a/msgorder.cpp +++ b/msgorder.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <unistd.h> #include <vector> diff --git a/pingpong.cpp b/pingpong.cpp index 7f0af13..52885c7 100644 --- a/pingpong.cpp +++ b/pingpong.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <unistd.h> #define INLOOP 0 diff --git a/pingpong2.cpp b/pingpong2.cpp index d813938..acf22b5 100644 --- a/pingpong2.cpp +++ b/pingpong2.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <unistd.h> #define INLOOP 0 diff --git a/syncsend.cpp b/syncsend.cpp index 9a32d9b..e98023b 100644 --- a/syncsend.cpp +++ b/syncsend.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <vector> #include <sstream> diff --git a/threads.cpp b/threads.cpp index d1df30e..bf3e579 100644 --- a/threads.cpp +++ b/threads.cpp @@ -1,14 +1,11 @@ #include "mpi.h" #include "omp.h" +#include <cstdio> #include <sstream> #include <unistd.h> int main(int argc, char **argv) { - int threads; - std::stringstream env(getenv("OMP_NUM_THREADS")); - env >> threads; - int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); if (provided < MPI_THREAD_FUNNELED) { @@ -21,7 +18,7 @@ int main(int argc, char **argv) { MPI_Comm_size(MPI_COMM_WORLD, &size); #pragma omp parallel for - for (int t = 0; t < threads; t++) { + for (int t = 0; t < omp_get_max_threads(); t++) { double start = omp_get_wtime(); while (omp_get_wtime() - start < 5); printf("Hello world from rank: %d-%d / %d\n", rank, t, size); diff --git a/varysize.cpp b/varysize.cpp index db67422..2b85abb 100644 --- a/varysize.cpp +++ b/varysize.cpp @@ -1,5 +1,6 @@ #include "mpi.h" +#include <cstdio> #include <cstring> int main(int argc, char **argv) { -- GitLab