trevorcarlson / barrierpoint

A BarrierPoint implementation: Automatically select representative regions of parallel applications
MIT License
14 stars 3 forks source link

setting up barrierpoint #1

Open campiador opened 8 years ago

campiador commented 8 years ago

I have an issue setting up barrierpoint using "make" command. I have downloaded the latest version of pinplay and set my $PIN_ROOT correctly. Thanks, Behnam

Here is the error I receive:

behnam@behnam-Lenovo-IdeaPad-Y480:~/tcal/barrierpoint$ make make -C tool_barrier_icount make[1]: Entering directory `/home/behnam/tcal/barrierpoint/tool_barrier_icount' g++ -D_FILE_OFFSET_BITS=64 -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/tools/InstLib -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/pinplay//include -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/tools/PinPoints -O2 -std=c++0x -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/include/pin -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/include/pin/gen -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/stlport/include -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/libstdc++/include -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include/arch-x86_64 -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include/kernel/uapi -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include/kernel/uapi/asm-x86 -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/components/include -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/xed-intel64/include -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/tools/InstLib -DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -DPIN=1 -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2 -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/include/pin -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/include/pin/gen -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/stlport/include -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/libstdc++/include -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include/arch-x86_64 -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include/kernel/uapi -isystem /home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/crt/include/kernel/uapi/asm-x86 -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/components/include -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/extras/xed-intel64/include -I/home/behnam/programs/pinplay-drdebug-3.0-pin-3.0-76991-gcc-linux/source/tools/InstLib -O3 -fomit-frame-pointer -fno-strict-aliasing -c -o parse_func_xml.o parse_func_xml.cpp parse_func_xml.cpp: In function ‘uint64_t parseBase(rapidxml::xml_node<>)’: parse_func_xml.cpp:19:4: error: ‘errno’ was not declared in this scope errno = 0; ^ In file included from parse_func_xml.cpp:8:0: rapidxml/rapidxml.hpp: In instantiation of ‘void rapidxml::xml_document::parse(Ch) [with int Flags = 12; Ch = char]’: parse_func_xml.cpp:55:77: required from here rapidxml/rapidxml.hpp:55:72: error: exception handling disabled, use -fexceptions to enable

define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where)

                                                                    ^

rapidxml/rapidxml.hpp:1408:21: note: in expansion of macro ‘RAPIDXML_PARSE_ERROR’ RAPIDXML_PARSE_ERROR("expected <", text); ^ make[1]: [parse_func_xml.o] Error 1 make[1]: Leaving directory`/home/behnam/tcal/barrierpoint/tool_barrier_icount' make: \ [tool_barrier_icount/barrier_icount.so] Error 2

trevorcarlson commented 8 years ago

Behnam,

This version of BarrierPoint does not currently work with Pin/Pinplay 3.0 (76991). Could you try this again using Pinplay 2.2 (71313)? I see these errors with 76991, but do not see these errors with 71313.

campiador commented 8 years ago

Thank you Trevor. I did as you said. Can you please tell me how to read the output and make sure it worked successfully? And the second question is, could you please tell me how to feed pinpoint my own input?

Thank you so very much.

P.S. I found the following trick to make barrierpoint work from here. It may be worth adding to the README:

"_/proc/sys/kernel/yama/ptrace_scope: This file is created at boot-time, based on the kernel.yama.ptrace_scope variable in the file above. It contains only the value of kernel.yama.ptracescope (0 or 1). If you edit it to 0, Pin and GDB will be able to attach to running processes. But it will reset to 1 the next time the system boots unless you also change 10-ptrace.conf. Note: You cannot edit this file with emacs (even as root). You must:"

% sudo bash % echo 0 > /proc/sys/kernel/yama/ptrace_scope

trevorcarlson commented 8 years ago

@campiador, I've just pushed some updates to support modern (GOMP 4.0) GCC versions, so if you have had problems before, I would check again with the new updates. If everything works, you shouldn't see any errors on the output, and the barrierpoint/work/barrierpoint/*.address pinballs should have been created. Note that the verification step is missing in this example.

To fed in your own SimPoint data, you might want to take a look at the genbarriercmd.py file and override those functions yourself.

To fix the yama/ptrace_scope issue, I used the -injection child option suggested by Pin which allows the tools to continue to work even with trace_scope == 1.

One other hint: to change the ptrace_scope file in one line, you can also run echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope.

campiador commented 8 years ago

Thanks for the help @trevorcarlson. I really appreciate it.

After I run barrierpoint matrix-omp, I can locate the *.address files. However, when I try to run the generated pinballs using Sniper command $SNIPER_ROOT/run-sniper -d $BARRIERPOINT_ROOT/work/sniper/36 --pinballs=$BARRIERPOINT_ROOT/work/barrierpoint/pb_t0r36_warmup0_prolog0_region753706_epilog0_036_1-00000 -sipctrace -v -n 4

I observe the error: ... [app0] [SIFT_RECORDER] sift_writer.cc:91: void Sift::Writer::initResponse(): Assertion !response->fail()' failed. sniper: sift_reader.cc:621: const Sift::StaticInstruction* Sift::Reader::decodeInstruction(uint64_t, uint8_t): Assertionresult == XED_ERROR_NONE' failed. [app0] Pin app terminated abnormally due to signal 6. [SNIPER] End

If I am using the right command (the command is suggested in barrierpoint output log file), what do you think the cause of error is? Should I be using a particular version of Sniper?

Thank you again for your help.

P.S. I am using pinplay-drdebug-2.2-pldi2015-pin-2.14-71313-gcc.4.4.7-linux, and the latest Sniper version. The complete barrierpoint output directory "work" is available here.

trevorcarlson commented 8 years ago

@campiador in fact, it appears that the run is progressing correctly. Is there a sim.out file generated by Sniper?

In fact, it is possible for this to work, but it is not tested in the current version of Sniper. The issue is that non-barrier critical sections that should have already been created have not been set up at this point. I have not tested this situation thoroughly.

One other issue is running with appropriate warmup up to this point. You would need to either inject/restore the appropriate cache or run functional cache simulation to get the correctly warmed cache state for this application.

Unfortunately, neither of these features are currently supported by Sniper, although extensions are definitely possible.

campiador commented 8 years ago

Thank you.

Yes, sim.out file is created, but it is empty.