Hello,

I'm trying to use m5threads to compiler my program, but encounter several
errors.

In brief, I found that some variables in the program are
modified inexplicably.

Here are two symptoms when using m5threads to run on the host machine
directly (not in gem5):

First, I ran 2 threads and the code had some printf(). Using gdb, I found
that the last several elements of one array are modified by the printf()
call. After realizing this, I allocate additional space for the array,
e.g., twice the original array size, to set a safe margin for the array. It
actually works.

Then, I ran 4 threads and found that one important thread-local variable,
myid, was modifed. Gdb didn't help this time, and I didn't find who modify
it.

I have been stuck by such problems for a week. Does anyone have similar
experience or know possible reasons?

I'm using m5threads-dcec9ee72f99. The test program works fine. The program
that I'm using is the graph500 reference code (breath-first search). The
original code is written in openmp. I tried to directly compile the openmp
code using m5threads, but didn't work. Then I change it into pthreads and
encounter the problems mentioned before. (btw, using standard pthreads
library works fine.)


Best regards,
Zehan
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to