Commit 540a8b7b authored by Ondrej Vysocky's avatar Ondrej Vysocky
Browse files

ENH MPI test using readex instrumentation #11 #37

parent c615799b
......@@ -41,7 +41,7 @@ sleepTest: sleep_test.cpp
$(CXX) -O0 -g sleep_test.cpp $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o sleepTest -DUSE_MERIC
mpiTest: test_mpi.cpp
$(MPICXX) -O0 -g test_mpi.cpp $(MERIC) -lmericmpi -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o test_mpi
$(MPICXX) -O0 -g test_mpi.cpp $(MERIC) -lmericmpi -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o test_mpi -DUSE_MERIC
basicTest: test.cpp
$(CXX) -O0 -g test.cpp -o test -DUSE_MERIC $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE)
......
#include <meric.h>
#include <readex.h>
#include <cstdlib>
#include <iostream>
......@@ -9,7 +9,7 @@
int main(int argc, char **argv)
{
MPI_Init(&argc, &argv);
MERIC_Init();
READEX_INIT();
int rank, size;
double time;
......@@ -17,45 +17,48 @@ int main(int argc, char **argv)
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MERIC_MeasureStart("A");
READEX_REGION_DEFINE(A);
READEX_REGION_START(A, "A", SCOREP_USER_REGION_TYPE_COMMON);
READEX_REGION_DEFINE(iteration);
for(int i = 0; i < 1; i++)
{
MERIC_MeasureStart("iteration");
READEX_REGION_START(iteration, "iteration", SCOREP_USER_REGION_TYPE_COMMON);
MERIC_MeasureStart("B");
READEX_REGION_START(B, "B", SCOREP_USER_REGION_TYPE_COMMON);
sleep(1);
time = MERIC_MeasureStop(); //B
time = READEX_REGION_STOP(B);
if (time > 0.0)
std::cout << "["<<rank<<"] B: "<< time << std::endl;
MERIC_MeasureStart("C");
MERIC_MeasureStart("D");
READEX_REGION_START(C, "C", SCOREP_USER_REGION_TYPE_COMMON);
READEX_REGION_START(D, "D", SCOREP_USER_REGION_TYPE_COMMON);
sleep(2);
time = MERIC_MeasureStop(); //D
time = READEX_REGION_STOP(D);
if (time > 0.0)
std::cout << "["<<rank<<"] D: "<< time << std::endl;
time = MERIC_MeasureStop(); //C
time = READEX_REGION_STOP(C);
if (time > 0.0)
std::cout << "["<<rank<<"] C: "<< time << std::endl;
MERIC_MeasureStart("B");
READEX_REGION_START(B, "B", SCOREP_USER_REGION_TYPE_COMMON);
sleep(1);
time = MERIC_MeasureStop(); //B
time = READEX_REGION_STOP(B);
if (time > 0.0)
std::cout << "["<<rank<<"] B: "<< time << std::endl;
MERIC_MeasureStop(); //iteration
READEX_REGION_STOP(iteration);
}
sleep(1);
MERIC_MeasureStop(); //A
READEX_REGION_STOP(A);
std::cout << "FIN\n";
MPI_Barrier(MPI_COMM_WORLD); //not necessary, just for the test purpose
MERIC_Close();
READEX_CLOSE();
MPI_Finalize();
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment