Skip to content

Commit

Permalink
Merge pull request #4 from fmihpc/performance_improvement
Browse files Browse the repository at this point in the history
Performance improvement + fix to #2
  • Loading branch information
Sebastian von Alfthan committed Mar 14, 2015
2 parents 02c6401 + 569b5d0 commit 98c7298
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 100 deletions.
2 changes: 1 addition & 1 deletion example/cpp_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INCLUDES =

# C++ compiler flags (-g -O2 -Wall)
CCFLAGS = -O3 -I../../include
LDFLAGS = -L../../lib -lphiprof
LDFLAGS = -L../../lib -lphiprof -lgomp
# compiler
CCC = mpiCC

Expand Down
4 changes: 2 additions & 2 deletions example/cpp_test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ int main(int argc,char **argv){

if(rank==0)
cout << "Measuring accuracy" <<endl;
/*
phiprof::start("Test accuracy");
if(rank==0)
cout << " 1/2" <<endl;
Expand All @@ -121,14 +122,13 @@ int main(int argc,char **argv){
phiprof::stop("100x0.1s computations + logprofile");
phiprof::stop("Test accuracy");

*/
MPI_Barrier(MPI_COMM_WORLD);
double t1=MPI_Wtime();
phiprof::print(MPI_COMM_WORLD);
phiprof::print(MPI_COMM_WORLD,"profile_minfrac0.01",0.01);
if(rank==0)
cout<< "Print time is "<<MPI_Wtime()-t1<<endl;
// phiprof::print(MPI_COMM_WORLD,0.1);

MPI_Finalize();
}
12 changes: 10 additions & 2 deletions include/phiprof.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,16 @@ namespace phiprof
* \overload bool phiprof::stop(const std::string &label,double workUnits=-1.0,const std::string &workUnitLabel="")
*/
bool stop (int id,
double workUnits=-1.0,
const std::string &workUnitLabel="");
double workUnits,
const std::string &workUnitLabel);



/**
* Fastest stop routine for cases when no workunits are defined.
*/
bool stop (int id);



/**
Expand Down
8 changes: 7 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ OUT_NO = ../lib/libnophiprof.a
# include directories
INCLUDES = -I../include

#Set clock.
#CLOCK_MONOTONIC_COARSE is (much) faster, but has very poor
# resolution. Also only available on newer linux kernels see man
# clock_gettime
CLOCK_ID = CLOCK_MONOTONIC

# C++ compiler flags
CCFLAGS = -O3 -fopenmp # -W -Wall -Wextra -pedantic
CCFLAGS = -O3 -fopenmp -DCLOCK_ID=$(CLOCK_ID) # -W -Wall -Wextra -pedantic

# compiler
CCC = mpiCC
Expand Down
Loading

0 comments on commit 98c7298

Please sign in to comment.