The use of DMULTITHREAD
ilya1725 opened this issue · comments
Hello:
What is the point of -DMULTITHREAD
? I've tried running the benchmark on my system with this flag set to 1,2,4,16 and getting the same results.
However, the more complex underlined question is how CoreMarks takes into account multiple cores? There is nothing about it in the README or the EEMBC whitepaper.
Thank you.
You also have to specify which multithread implementation to use.
-DUSE_PTHREAD=1
or -DUSE_FORK=1
or -DUSE_SOCKET=1
are the options I think.
I used -DUSE_FORK=1
. Same result.
MULTITHREAD=N
enables code for parallel execution, where the value of N
determines the number of instances. The parallel implementation may be USE_(FORK|PTHREAD|SOCKET)=1
. The implementation is defined in the core_portme.c
file for the particular platform using the two functions core_start_parallel
and core_stop_parallel
. The linux
and linux64
targets both implement all three modes with example code. Here is a pthreads
example:
coremark/linux64/core_portme.c
Lines 236 to 243 in 2e9d616
Example:
$ make PORT_DIR=macOS
$ grep "Iterations/Sec" run2.log
Iterations/Sec : 19559.264572
$ make PORT_DIR=macOS clean
$ make PORT_DIR=macOS XCFLAGS='-DMULTITHREAD=4 -DUSE_PTHREAD'
$ grep "Iteration/Sec" run2.log
Iterations/Sec : 71577.691619