Loading CMakeLists.txt +29 −3 Original line number Diff line number Diff line Loading @@ -132,8 +132,9 @@ endif() # Check for MPI # find_package( MPI ) if( MPI_FOUND ) if( MPI_CXX_FOUND ) set( BUILD_MPI TRUE ) message( "MPI headers found -- ${MPI_CXX_INCLUDE_PATH}") endif() #### Loading Loading @@ -204,8 +205,9 @@ if( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) message( "CPPUNIT not found." ) set( HAVE_CPPUNIT "//#define HAVE_CPPUNIT" ) else( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) message( "CPPUNIT headers found -- ${CPPUNIT_INCLUDE_DIR}" ) if(CPPUNIT_LIBRARY) message( "CPPUNIT found. -- ${CPPUNIT_INCLUDE_DIR}" ) message( "CPPUNIT library found -- ${CPPUNIT_LIBRARY}" ) set(CPPUNIT_FOUND "YES") set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS}) set(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY} Loading @@ -214,7 +216,31 @@ else( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) endif(CPPUNIT_LIBRARY) endif( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) find_package( PETSc ) if( BUILD_MPI ) FIND_PATH( PETSC_INCLUDE_DIR petsc.h /usr/include/petsc ${PETSC_DIR}/${PETSC_ARCH}/include ${PETSC_DIR}/include DOC "PETSC headers." ) if( ${PETSC_INCLUDE_DIR} STREQUAL "PETSC_INCLUDE_DIR-NOTFOUND" ) message( "PETSC not found." ) else() message( "PETSC headers found -- ${PETSC_INCLUDE_DIR}" ) FIND_LIBRARY(PETSC_LIBRARY petsc ${PETSC_INCLUDE_DIR}/../lib /usr/local/lib /usr/lib) if( PETSC_LIBRARY ) #string( REPLACE ";" " " MPI_LIBRARIES "${MPI_CXX_LIBRARIES}" ) #set( PETSC_LIBRARY "${MPI_LIBRARIES} ${PETSC_LIBRARY}") message( "PETSC library found -- ${PETSC_LIBRARY}") list( GET MPI_CXX_INCLUDE_PATH 0 MPI_CXX_PATH ) set(PETSC_CXX_FLAGS "-DHAVE_PETSC -I${PETSC_INCLUDE_DIR} -DHAVE_MPI -I${MPI_CXX_PATH}") endif() endif() endif() ENABLE_TESTING() INCLUDE( Dart ) Loading buildAll +4 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ CUDA_ARCHITECTURE=2.0 VERBOSE=1 CPUS=`grep -c processor /proc/cpuinfo` CPUS=1 echo "Building $TARGET using $CPUS processors." Loading @@ -21,13 +22,13 @@ then fi cd Debug cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -PETSC_DIR=${PETSC_DIR} make -j${CPUS} #VERBOSE=1 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -DPETSC_DIR=${PETSC_DIR} make -j${CPUS} VERBOSE=1 make -j${CPUS} test make -j${CPUS} install cd ../Release cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -PETSC_DIR=${PETSC_DIR} cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -DPETSC_DIR=${PETSC_DIR} make -j${CPUS} #VERBOSE=1 make -j${CPUS} test make -j${CPUS} install cmake/ResolveCompilerPaths.cmake +1 −1 Original line number Diff line number Diff line ResolveCompilerPaths - this module defines two macros #ResolveCompilerPaths - this module defines two macros # # RESOLVE_LIBRARIES (XXX_LIBRARIES LINK_LINE) # This macro is intended to be used by FindXXX.cmake modules. Loading src/core/tnlTimerCPU.cpp +1 −57 Original line number Diff line number Diff line Loading @@ -15,64 +15,8 @@ * * ***************************************************************************/ #include "tnlConfig.h" #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif #include "tnlTimerCPU.h" tnlTimerCPU default_mcore_cpu_timer; tnlTimerCPU :: tnlTimerCPU() { Reset(); } //-------------------------------------------------------------------------- void tnlTimerCPU :: Reset() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #else initial_time = 0; #endif total_time = 0.0; stop_state = false; } //-------------------------------------------------------------------------- void tnlTimerCPU :: Stop() { #ifdef HAVE_SYS_RESOURCE_H if( ! stop_state ) { rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); total_time += init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec - initial_time; stop_state = true; } #endif } //-------------------------------------------------------------------------- void tnlTimerCPU :: Continue() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #endif stop_state = false; } //-------------------------------------------------------------------------- double tnlTimerCPU :: GetTime( int root, MPI_Comm comm ) { #ifdef HAVE_SYS_RESOURCE_H Stop(); Continue(); double mpi_total_time; MPIReduce( total_time, mpi_total_time, 1, MPI_SUM, root, comm ); return mpi_total_time; #else return -1; #endif } src/core/tnlTimerCPU.h +60 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,12 @@ #ifndef tnlTimerCPUH #define tnlTimerCPUH #include "tnlConfig.h" #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif #include "mpi-supp.h" class tnlTimerCPU Loading Loading @@ -45,4 +51,58 @@ class tnlTimerCPU extern tnlTimerCPU default_mcore_cpu_timer; tnlTimerCPU :: tnlTimerCPU() { Reset(); } //-------------------------------------------------------------------------- void tnlTimerCPU :: Reset() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #else initial_time = 0; #endif total_time = 0.0; stop_state = false; } //-------------------------------------------------------------------------- void tnlTimerCPU :: Stop() { #ifdef HAVE_SYS_RESOURCE_H if( ! stop_state ) { rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); total_time += init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec - initial_time; stop_state = true; } #endif } //-------------------------------------------------------------------------- void tnlTimerCPU :: Continue() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #endif stop_state = false; } //-------------------------------------------------------------------------- double tnlTimerCPU :: GetTime( int root, MPI_Comm comm ) { #ifdef HAVE_SYS_RESOURCE_H Stop(); Continue(); double mpi_total_time; MPIReduce( total_time, mpi_total_time, 1, MPI_SUM, root, comm ); return mpi_total_time; #else return -1; #endif } #endif Loading
CMakeLists.txt +29 −3 Original line number Diff line number Diff line Loading @@ -132,8 +132,9 @@ endif() # Check for MPI # find_package( MPI ) if( MPI_FOUND ) if( MPI_CXX_FOUND ) set( BUILD_MPI TRUE ) message( "MPI headers found -- ${MPI_CXX_INCLUDE_PATH}") endif() #### Loading Loading @@ -204,8 +205,9 @@ if( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) message( "CPPUNIT not found." ) set( HAVE_CPPUNIT "//#define HAVE_CPPUNIT" ) else( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) message( "CPPUNIT headers found -- ${CPPUNIT_INCLUDE_DIR}" ) if(CPPUNIT_LIBRARY) message( "CPPUNIT found. -- ${CPPUNIT_INCLUDE_DIR}" ) message( "CPPUNIT library found -- ${CPPUNIT_LIBRARY}" ) set(CPPUNIT_FOUND "YES") set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS}) set(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY} Loading @@ -214,7 +216,31 @@ else( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) endif(CPPUNIT_LIBRARY) endif( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" ) find_package( PETSc ) if( BUILD_MPI ) FIND_PATH( PETSC_INCLUDE_DIR petsc.h /usr/include/petsc ${PETSC_DIR}/${PETSC_ARCH}/include ${PETSC_DIR}/include DOC "PETSC headers." ) if( ${PETSC_INCLUDE_DIR} STREQUAL "PETSC_INCLUDE_DIR-NOTFOUND" ) message( "PETSC not found." ) else() message( "PETSC headers found -- ${PETSC_INCLUDE_DIR}" ) FIND_LIBRARY(PETSC_LIBRARY petsc ${PETSC_INCLUDE_DIR}/../lib /usr/local/lib /usr/lib) if( PETSC_LIBRARY ) #string( REPLACE ";" " " MPI_LIBRARIES "${MPI_CXX_LIBRARIES}" ) #set( PETSC_LIBRARY "${MPI_LIBRARIES} ${PETSC_LIBRARY}") message( "PETSC library found -- ${PETSC_LIBRARY}") list( GET MPI_CXX_INCLUDE_PATH 0 MPI_CXX_PATH ) set(PETSC_CXX_FLAGS "-DHAVE_PETSC -I${PETSC_INCLUDE_DIR} -DHAVE_MPI -I${MPI_CXX_PATH}") endif() endif() endif() ENABLE_TESTING() INCLUDE( Dart ) Loading
buildAll +4 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ CUDA_ARCHITECTURE=2.0 VERBOSE=1 CPUS=`grep -c processor /proc/cpuinfo` CPUS=1 echo "Building $TARGET using $CPUS processors." Loading @@ -21,13 +22,13 @@ then fi cd Debug cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -PETSC_DIR=${PETSC_DIR} make -j${CPUS} #VERBOSE=1 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -DPETSC_DIR=${PETSC_DIR} make -j${CPUS} VERBOSE=1 make -j${CPUS} test make -j${CPUS} install cd ../Release cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -PETSC_DIR=${PETSC_DIR} cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/local -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUSPARSE=${WITH_CUSPARSE} -DPETSC_DIR=${PETSC_DIR} make -j${CPUS} #VERBOSE=1 make -j${CPUS} test make -j${CPUS} install
cmake/ResolveCompilerPaths.cmake +1 −1 Original line number Diff line number Diff line ResolveCompilerPaths - this module defines two macros #ResolveCompilerPaths - this module defines two macros # # RESOLVE_LIBRARIES (XXX_LIBRARIES LINK_LINE) # This macro is intended to be used by FindXXX.cmake modules. Loading
src/core/tnlTimerCPU.cpp +1 −57 Original line number Diff line number Diff line Loading @@ -15,64 +15,8 @@ * * ***************************************************************************/ #include "tnlConfig.h" #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif #include "tnlTimerCPU.h" tnlTimerCPU default_mcore_cpu_timer; tnlTimerCPU :: tnlTimerCPU() { Reset(); } //-------------------------------------------------------------------------- void tnlTimerCPU :: Reset() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #else initial_time = 0; #endif total_time = 0.0; stop_state = false; } //-------------------------------------------------------------------------- void tnlTimerCPU :: Stop() { #ifdef HAVE_SYS_RESOURCE_H if( ! stop_state ) { rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); total_time += init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec - initial_time; stop_state = true; } #endif } //-------------------------------------------------------------------------- void tnlTimerCPU :: Continue() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #endif stop_state = false; } //-------------------------------------------------------------------------- double tnlTimerCPU :: GetTime( int root, MPI_Comm comm ) { #ifdef HAVE_SYS_RESOURCE_H Stop(); Continue(); double mpi_total_time; MPIReduce( total_time, mpi_total_time, 1, MPI_SUM, root, comm ); return mpi_total_time; #else return -1; #endif }
src/core/tnlTimerCPU.h +60 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,12 @@ #ifndef tnlTimerCPUH #define tnlTimerCPUH #include "tnlConfig.h" #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif #include "mpi-supp.h" class tnlTimerCPU Loading Loading @@ -45,4 +51,58 @@ class tnlTimerCPU extern tnlTimerCPU default_mcore_cpu_timer; tnlTimerCPU :: tnlTimerCPU() { Reset(); } //-------------------------------------------------------------------------- void tnlTimerCPU :: Reset() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #else initial_time = 0; #endif total_time = 0.0; stop_state = false; } //-------------------------------------------------------------------------- void tnlTimerCPU :: Stop() { #ifdef HAVE_SYS_RESOURCE_H if( ! stop_state ) { rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); total_time += init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec - initial_time; stop_state = true; } #endif } //-------------------------------------------------------------------------- void tnlTimerCPU :: Continue() { #ifdef HAVE_SYS_RESOURCE_H rusage init_usage; getrusage( RUSAGE_SELF, &init_usage ); initial_time = init_usage. ru_utime. tv_sec + 1.0e-6 * ( double ) init_usage. ru_utime. tv_usec; #endif stop_state = false; } //-------------------------------------------------------------------------- double tnlTimerCPU :: GetTime( int root, MPI_Comm comm ) { #ifdef HAVE_SYS_RESOURCE_H Stop(); Continue(); double mpi_total_time; MPIReduce( total_time, mpi_total_time, 1, MPI_SUM, root, comm ); return mpi_total_time; #else return -1; #endif } #endif