Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not found libelf.a #2

Open
ZYX223 opened this issue May 19, 2020 · 14 comments
Open

not found libelf.a #2

ZYX223 opened this issue May 19, 2020 · 14 comments

Comments

@ZYX223
Copy link

ZYX223 commented May 19, 2020

my pin version is pin-3.11-97998-g7ecce2dac-gcc-linux, and I don't find the libelf.a in /intel64/lib-ext/libelf.a

as the makefile is

TOOL_CXXFLAGS += -Wall -g -std=c++0x -Wno-error -Wextra -Wno-unused-parameter -pedantic -lelf
# TOOL_LIBS += -lelf
TOOL_LIBS += /opt/pin-2.14-67254-gcc.4.4.7-linux/intel64/lib-ext/libelf.a

TOOL_ROOTS := numalize

include $(TOOLS_ROOT)/Config/makefile.default.rules
@matthiasdiener
Copy link
Owner

matthiasdiener commented May 19, 2020

I think you have to install libelf on your system.

I.e., you should uncomment the # TOOL_LIBS += -lelf line, and remove the TOOL_LIBS += /opt/pin-2.14-67254-gcc.4.4.7-linux/intel64/lib-ext/libelf.a line. Then install libelf on your system.

@ZYX223
Copy link
Author

ZYX223 commented May 19, 2020

#include
#include<omp.h>
int main() {
// insert code here...
int b = 3;
int a = 0;
#pragma omp parallel private(a)
a = b;
return 0;
}
I tested the example using the above code.
And I got the result is
2377 | 192093 | 159938 | 159501 | 243496 | 0
4945 | 221325 | 184076 | 216486 | 0 | 243496
4505 | 215635 | 205506 | 0 | 216486 | 159501
1965 | 220351 | 0 | 205506 | 184076 | 159938
5788 | 0 | 220351 | 215635 | 221325 | 192093
0 | 5788 | 1965 | 4505 | 4945 | 2377

I think this communication value is too large , and how to define communication between threads?

@ZYX223
Copy link
Author

ZYX223 commented May 19, 2020

Excuse me

// adjust thread ID for extra internal Pin thread that this tool creates
static inline
THREADID real_tid(THREADID tid)
{
return tid >= 2 ? tid-1 : tid;
}

What does the "real_tid" mean, why tid hasn't the value 1?

@matthiasdiener
Copy link
Owner

Excuse me

// adjust thread ID for extra internal Pin thread that this tool creates
static inline
THREADID real_tid(THREADID tid)
{
return tid >= 2 ? tid-1 : tid;
}

What does the "real_tid" mean, why tid hasn't the value 1?

As indicated in the comment, numalize creates an extra Pin thread for the periodic output of data. This extra thread always has TID 1 and is not instrumented. real_tid converts the TID reported by Pin to the TID as seen by the application, by adjusting the TID, ie.:

TID 0 -> real_tid 0
TID 2 -> real_tid 1
TID 3 -> real_tid 2

etc.

@matthiasdiener
Copy link
Owner

#include
#include<omp.h>
int main() {
// insert code here...
int b = 3;
int a = 0;
#pragma omp parallel private(a)
a = b;
return 0;
}
I tested the example using the above code.
And I got the result is
2377 | 192093 | 159938 | 159501 | 243496 | 0
4945 | 221325 | 184076 | 216486 | 0 | 243496
4505 | 215635 | 205506 | 0 | 216486 | 159501
1965 | 220351 | 0 | 205506 | 184076 | 159938
5788 | 0 | 220351 | 215635 | 221325 | 192093
0 | 5788 | 1965 | 4505 | 4945 | 2377

I think this communication value is too large , and how to define communication between threads?

I think thats fine. The communication probably comes from memory accesses inside the external libraries (e.g. libomp). Note that depending on your value for comm_shift, you might also count false sharing here.

@ZYX223
Copy link
Author

ZYX223 commented May 22, 2020

Thanks for your answer.And now I want to know a communication's timestamp between threads, and how to implement it?

@ZYX223
Copy link
Author

ZYX223 commented May 22, 2020

static inline
UINT64 get_tsc()
{
#if defined(__i386) || defined(x86_64)
unsigned int lo, hi;
asm volatile (
"cpuid \n"
"rdtsc"
: "=a"(lo), "=d"(hi) /* outputs /
: "a"(0) /
inputs /
: "%ebx", "%ecx"); /
clobbers*/
return ((UINT64)lo) | (((UINT64)hi) << 32);
#elif defined(__ia64)
UINT64 r;
asm volatile ("mov %0=ar.itc" : "=r" (r) :: "memory");
return r;
#elif defined(powerpc)
UINT64 hi, lo, tmp;
asm volatile(
"0:\n"
"mftbu %0 \n"
"mftb %1 \n"
"mftbu %2 \n"
"cmpw %2,%0 \n"
"bne 0b \n"
: "=r"(hi),"=r"(lo),"=r"(tmp) );
return ((UINT64)lo) | (((UINT64)hi) << 32);
#else
#error "architecture not supported"
#endif
}

Is the "get_tsc()" function count the timestamp?

@matthiasdiener
Copy link
Owner

Yes, you could use the output of get_tsc as a way to maintain timestamps.

@ZYX223
Copy link
Author

ZYX223 commented May 23, 2020

KNOB COMMSIZE(KNOB_MODE_WRITEONCE, "pintool", "cs", "6", "comm shift in bits");

I read your paper "Communication in Shared Memory: Concepts, Definitions, and Efficient Detection" recently, and I want to know that if I want to set the cache line to 64 bytes ,I should set the COMMSIZE to 6 as the above code shown.Is that right?

And another question is how to use the CacheSim at https://github.com/matthiasdiener/CacheSim, I have make it.

Thanks.

@matthiasdiener
Copy link
Owner

KNOB COMMSIZE(KNOB_MODE_WRITEONCE, "pintool", "cs", "6", "comm shift in bits");

I read your paper "Communication in Shared Memory: Concepts, Definitions, and Efficient Detection" recently, and I want to know that if I want to set the cache line to 64 bytes ,I should set the COMMSIZE to 6 as the above code shown.Is that right?

Yes, that's right, since 2^6=64.

And another question is how to use the CacheSim at https://github.com/matthiasdiener/CacheSim, I have make it.

I think you can run it in the same way as numalize.

@ZYX223
Copy link
Author

ZYX223 commented May 27, 2020

Ok,I have run the CacheSIm,it seems not to trace communication between threads.I think I should modify it.
What's value "get_tsc()" returned represents, how much will it increase in one second?

@matthiasdiener
Copy link
Owner

get_tsc() just returns the value of the CPU's time stamp counter (e.g. https://en.wikipedia.org/wiki/Time_Stamp_Counter)

For CacheSim, you probably need to use the comm branch.

@ZYX223
Copy link
Author

ZYX223 commented Jun 3, 2020

Thanks,I have run the CacheSim using the comm branch, and do you know how to count the communications between threads using a INTERVAL as the same in numalize?

KNOB INTERVAL(KNOB_MODE_WRITEONCE, "pintool", "i", "1", "print interval (ms) (0=disable)");

When I try to use the INTERVAL in CacheSim, I meet the problem:
C: Tool (or Pin) caused signal 11 at PC 0x7f3e8c8fc594
Command terminated by signal 11

@matthiasdiener
Copy link
Owner

Thanks,I have run the CacheSim using the comm branch, and do you know how to count the communications between threads using a INTERVAL as the same in numalize?

KNOB INTERVAL(KNOB_MODE_WRITEONCE, "pintool", "i", "1", "print interval (ms) (0=disable)");

When I try to use the INTERVAL in CacheSim, I meet the problem:
C: Tool (or Pin) caused signal 11 at PC 0x7f3e8c8fc594
Command terminated by signal 11

I don't think this interval feature is implemented in CacheSim, only in numalize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants