ICLDisco / parsec

PaRSEC is a generic framework for architecture aware scheduling and management of micro-tasks on distributed, GPU accelerated, many-core heterogeneous architectures. PaRSEC assigns computation threads to the cores, GPU accelerators, overlaps communications and computations and uses a dynamic, fully-distributed scheduler based on architectural features such as NUMA nodes and algorithmic features such as data reuse.
Other
47 stars 17 forks source link

Python profiling tools #261

Closed abouteiller closed 4 years ago

abouteiller commented 4 years ago

Original report by Anonymous.


When I try to execute profile2h5, I get the following error. During the parsec 2to3 was found and showed refactoring python code. But I don't see the refactoring happening properly (eg. ptt_utils.py line no. 79 basestring)

profile2h5 profile-0.prof-joNWHX profile-1.prof-joNWHX File "/usr/local/bin/profile2h5", line 9 print("Usage: %s profile-file1 profile-file2 ..." % (sys.argv[0]), file=sys.stderr) ^ SyntaxError: invalid syntax

abouteiller commented 4 years ago

Original comment by George Bosilca (Bitbucket: bosilca, GitHub: bosilca).


The translation between python2 and python3 is only done during install. Did you install PaRSEC or are you trying to use it directly from the build directory?

abouteiller commented 4 years ago

Original comment by Kirshanthan Sundararajah (Bitbucket: [Kirshanthan Sundararajah](https://bitbucket.org/Kirshanthan Sundararajah), ).


I have installed PaRSEC in my system and I have seen python 2 to 3 conversion happening in the config.log.

I found the above issue when I try to use the installed scripts. I checked the build directory and the same errors prevail.

Thank you

abouteiller commented 4 years ago

Original comment by George Bosilca (Bitbucket: bosilca, GitHub: bosilca).


Can you send the config.log file ? In order to compile the profiling python support you need python but also cython (> 0.25).

I just noticed that cmake python detection has a very unexpected behavior, it prefers the python version installed in the system instead of the most recent version available. Having the config.log would help us eliminate the cases.

abouteiller commented 4 years ago

Original comment by Kirshanthan Sundararajah (Bitbucket: [Kirshanthan Sundararajah](https://bitbucket.org/Kirshanthan Sundararajah), ).


Here is my config.log and I couldn’t find any clear discrepancies.

### This program was invoked with the following command line
#
    ../configure  --disable-debug --enable-prof-trace --enable-prof-calltrace --disable-prof-dryrun --enable-prof-grapher --with-papi --with-hwloc --with-gtg --with-mpi --enable-collectives --with-python -DPARSEC_PROF_TRACE=ON -DPARSEC_PROF_CALLTRACE=ON
#
### CMake generated invocation
#
     /usr/local/bin/cmake -G'Unix Makefiles' /home/sundararajah/parsec/build/..  -DPARSEC_PROF_TRACE=ON -DPARSEC_PROF_CALLTRACE=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DPARSEC_PROF_TRACE=ON -DPARSEC_PROF_CALLTRACE=ON -DPARSEC_PROF_GRAPHER=ON -DPARSEC_PROF_DRY_RUN=OFF -DPARSEC_PROF_DRY_BODY=OFF -DPARSEC_PROF_DRY_DEP=OFF -DPARSEC_PROF_TRACE=ON -DPARSEC_DIST_COLLECTIVES=ON 
#
Removing Cmake Cache...
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/bin/f95
-- The Fortran compiler identification is GNU 7.5.0
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95 - works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 - yes
-- Looking for a CXX compiler
-- Looking for a CXX compiler - /usr/bin/c++
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/bin/bison (found version "3.0.4") 
-- Found FLEX: /usr/bin/flex (found version "2.6.4") 
-- Building for target x86_64
-- Found target X86_64
-- Performing Test C_M32or64
-- Performing Test C_M32or64 - Success
-- Performing Test F_M32or64
-- Performing Test F_M32or64 - Success
-- Performing Test CXX_M32or64
-- Performing Test CXX_M32or64 - Success
-- Performing Test PARSEC_HAVE_G3
-- Performing Test PARSEC_HAVE_G3 - Success
-- Performing Test PARSEC_HAVE_Og
-- Performing Test PARSEC_HAVE_Og - Success
-- Performing Test PARSEC_HAVE_WALL
-- Performing Test PARSEC_HAVE_WALL - Success
-- Performing Test PARSEC_HAVE_WEXTRA
-- Performing Test PARSEC_HAVE_WEXTRA - Success
-- Performing Test PARSEC_HAVE_PAR_EQUALITY
-- Performing Test PARSEC_HAVE_PAR_EQUALITY - Success
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of __int128_t
-- Check size of __int128_t - done
-- Performing Test PARSEC_ATOMIC_USE_GCC_32_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_GCC_32_BUILTINS - Success
-- Performing Test PARSEC_ATOMIC_USE_GCC_64_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_GCC_64_BUILTINS - Success
-- Performing Test PARSEC_ATOMIC_USE_GCC_128_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_GCC_128_BUILTINS - Failed
-- Performing Test PARSEC_ATOMIC_USE_GCC_128_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_GCC_128_BUILTINS - Success
-- Performing Test PARSEC_ATOMIC_USE_GCC_128_OTHER_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_GCC_128_OTHER_BUILTINS - Success
-- Performing Test PARSEC_ATOMIC_USE_XLC_32_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_XLC_32_BUILTINS - Failed
-- Performing Test PARSEC_ATOMIC_USE_MIPOSPRO_32_BUILTINS
-- Performing Test PARSEC_ATOMIC_USE_MIPOSPRO_32_BUILTINS - Failed
-- Performing Test PARSEC_ATOMIC_USE_SUN_32
-- Performing Test PARSEC_ATOMIC_USE_SUN_32 - Failed
--   support for 32 bits atomics - found
--   support for 64 bits atomics - found
--   support for 128 bits atomics - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Looking for pthread_getspecific
-- Looking for pthread_getspecific - found
-- Looking for pthread_barrier_init
-- Looking for pthread_barrier_init - found
-- Looking for sched_setaffinity
-- Looking for sched_setaffinity - found
-- Performing Test PARSEC_HAVE_TIMESPEC_TV_NSEC
-- Performing Test PARSEC_HAVE_TIMESPEC_TV_NSEC - Success
-- Looking for clock_gettime in c
-- Looking for clock_gettime in c - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Performing Test PARSEC_HAVE_VA_COPY
-- Performing Test PARSEC_HAVE_VA_COPY - Success
-- Performing Test PARSEC_HAVE_ATTRIBUTE_FORMAT_PRINTF
-- Performing Test PARSEC_HAVE_ATTRIBUTE_FORMAT_PRINTF - Success
-- Performing Test PARSEC_HAVE_THREAD_LOCAL
-- Performing Test PARSEC_HAVE_THREAD_LOCAL - Success
-- Looking for asprintf
-- Looking for asprintf - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file getopt.h
-- Looking for include file getopt.h - found
-- Looking for getopt_long
-- Looking for getopt_long - found
-- Looking for include file errno.h
-- Looking for include file errno.h - found
-- Looking for include file stddef.h
-- Looking for include file stddef.h - found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- Looking for include file ctype.h
-- Looking for include file ctype.h - found
-- Performing Test PARSEC_HAVE_BUILTIN_CPU
-- Performing Test PARSEC_HAVE_BUILTIN_CPU - Success
-- Performing Test PARSEC_HAVE_BUILTIN_CPU512
-- Performing Test PARSEC_HAVE_BUILTIN_CPU512 - Success
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for RUSAGE_THREAD
-- Looking for RUSAGE_THREAD - not found
-- Looking for RUSAGE_THREAD
-- Looking for RUSAGE_THREAD - found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file libgen.h
-- Looking for include file libgen.h - found
-- Looking for include file complex.h
-- Looking for include file complex.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file syslog.h
-- Looking for include file syslog.h - found
-- Performing Test PARSEC_HAVE_ATTRIBUTE_ALWAYS_INLINE
-- Performing Test PARSEC_HAVE_ATTRIBUTE_ALWAYS_INLINE - Success
-- Performing Test PARSEC_HAVE_ATTRIBUTE_VISIBILITY
-- Performing Test PARSEC_HAVE_ATTRIBUTE_VISIBILITY - Success
-- Performing Test PARSEC_HAVE_BUILTIN_EXPECT
-- Performing Test PARSEC_HAVE_BUILTIN_EXPECT - Success
-- Found HWLOC: /usr/lib/x86_64-linux-gnu/libhwloc.so  
-- Performing Test PARSEC_HAVE_HWLOC_PARENT_MEMBER
-- Performing Test PARSEC_HAVE_HWLOC_PARENT_MEMBER - Success
-- Performing Test PARSEC_HAVE_HWLOC_CACHE_ATTR
-- Performing Test PARSEC_HAVE_HWLOC_CACHE_ATTR - Success
-- Performing Test PARSEC_HAVE_HWLOC_OBJ_PU
-- Performing Test PARSEC_HAVE_HWLOC_OBJ_PU - Success
-- Looking for hwloc_bitmap_free in /usr/lib/x86_64-linux-gnu/libhwloc.so
-- Looking for hwloc_bitmap_free in /usr/lib/x86_64-linux-gnu/libhwloc.so - found
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1") 
-- Found MPI_Fortran: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_usempif08.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Looking for MPI_Type_create_resized
-- Looking for MPI_Type_create_resized - found
-- Performing Test PARSEC_HAVE_MPI_OVERTAKE
-- Performing Test PARSEC_HAVE_MPI_OVERTAKE - Success
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) 
-- Looking for shm_open
-- Looking for shm_open - not found
-- Looking for shm_open in rt
-- Looking for shm_open in rt - found
-- Found GTG: /usr/lib/x86_64-linux-gnu/libgtg.so  
-- Checking for module 'libgvc'
--   Found libgvc, version 2.40.1
-- Found Python: /usr/bin/python3.6 (found version "3.6.9") found components: Interpreter Development 
-- Cython version 0.29.20 found
-- Found Cython: /usr/bin/cython (Required is at least version "0.21.2") 
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/demo_ptt.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/example-DAG-and-Trace.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/h5totrace.py
RefactoringTool: No changes to /home/sundararajah/parsec/build/tools/profiling/python/examples/mpl_prefs.py
RefactoringTool: No changes to /home/sundararajah/parsec/build/tools/profiling/python/examples/online_math.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/paje.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/parsec_dag.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/parsec_testing.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/plot_counts_by_eventname.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/plot_scatter_papi.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/print_papi_L123_profile_stats.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/print_profile_info.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/print_trialset_trace_stats.py
RefactoringTool: Refactored /home/sundararajah/parsec/build/tools/profiling/python/examples/profile2h5.py
RefactoringTool: Files that were modified:
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/demo_ptt.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/example-DAG-and-Trace.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/h5totrace.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/mpl_prefs.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/online_math.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/paje.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/parsec_dag.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/parsec_testing.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/plot_counts_by_eventname.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/plot_scatter_papi.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/print_papi_L123_profile_stats.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/print_profile_info.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/print_trialset_trace_stats.py
RefactoringTool: /home/sundararajah/parsec/build/tools/profiling/python/examples/profile2h5.py
-- PARSEC Modular Component Architecture (MCA) discovery:
-- -- Found Component `device'
-- Module cuda not selectable: does not have CUDA
-- ---- Module `device/template` is ignored (due to .ignore)
-- -- Found Component `pins'
-- ---- Module `alperf' is ON
-- ---- Module `iterators_checker' is ON
-- The PAPI Library is found at /usr/local/lib/libpapi.so
-- ---- Module `papi' is ON
-- ---- Module `print_steals' is ON
-- ---- Module `ptg_to_dtd' is ON
-- ---- Module `task_profiler' is ON
-- -- Found Component `sched'
-- ---- Module `ap' is ON
-- ---- Module `gd' is ON
-- ---- Module `ip' is ON
-- ---- Module `lfq' is ON
-- ---- Module `lhq' is ON
-- ---- Module `ll' is ON
-- ---- Module `ltq' is ON
-- ---- Module `pbq' is ON
-- ---- Module `rnd' is ON
-- ---- Module `spq' is ON
-- PARSEC Modular Component Architecture (MCA) discovery done.
-- no otf2-config found
-- Could NOT find OTF2 (missing: OTF2_CONFIG OTF2_LIBRARIES OTF2_INCLUDE_DIRS) (Required is at least version "2.1.1")
-- Profiling uses PaRSEC Binary Tracing Format
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Looking for PARSEC_ATOMIC_HAS_ATOMIC_CAS_INT128
-- Looking for PARSEC_ATOMIC_HAS_ATOMIC_CAS_INT128 - found
-- Check size of parsec_lifo_t
-- Check size of parsec_lifo_t - done
-- Check offset of field lifo_private in structure 'struct{parsec_object_t super;uint8_t alignment;parsec_list_item_t*lifo_ghost;char lifo_private;}'
-- Check offset of field lifo_private in structure struct{parsec_object_t super;uint8_t alignment;parsec_list_item_t*lifo_ghost;char lifo_private;} - done
-- Internal PaRSEC uses CAS on int128_t. Reconfiguring parsec_options.h

PkgConfig Configuration Flags:
  EXTRA_CFLAGS           = 
  EXTRA_LDFLAGS          = 
  EXTRA_INCLUDES         = /usr/include;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include;/usr/lib/x86_64-linux-gnu/openmpi/include
  EXTRA_LIBS             = -L/usr/lib/gcc/x86_64-linux-gnu/7;-L/usr/lib/x86_64-linux-gnu;-L/usr/lib;-L/lib/x86_64-linux-gnu;-L/lib;gfortran;m;gcc_s;gcc;quadmath;c;/usr/lib/x86_64-linux-gnu/libhwloc.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so

-- Configuring done
-- Generating done
-- Build files have been written to: /home/sundararajah/parsec/build
#
### CMake Generator: Unix Makefiles
#

abouteiller commented 4 years ago

Original comment by George Bosilca (Bitbucket: bosilca, GitHub: bosilca).


I found the issue, a lack of conversion from python2 to python3 for our helper tools. 2cdc15d61 (bb) should provide a fix.

abouteiller commented 4 years ago

Original comment by Kirshanthan Sundararajah (Bitbucket: [Kirshanthan Sundararajah](https://bitbucket.org/Kirshanthan Sundararajah), ).


Thank you.

abouteiller commented 4 years ago

Original comment by Kirshanthan Sundararajah (Bitbucket: [Kirshanthan Sundararajah](https://bitbucket.org/Kirshanthan Sundararajah), ).


There is a new error appeared in the config.log after the update

RefactoringTool: There was 1 error:
RefactoringTool: Can't open /home/sundararajah/parsec/build/tools/profiling/python/common_utils.py /home/sundararajah/parsec/build/tools/profiling/python/parsec_trace_tables.py /home/sundararajah/parsec/build/tools/profiling/python/ptt_utils.py: [Errno 2] No such file or directory: '/home/sundararajah/parsec/build/tools/profiling/python/common_utils.py /home/sundararajah/parsec/build/tools/profiling/python/parsec_trace_tables.py /home/sundararajah/parsec/build/tools/profiling/python/ptt_utils.py'