[gem5-users] Multithreaded openMP in se mode
Hi all, I ran a simple multithreaded helloworld code (as enclosed) with ARM I got "Panic:Page table fault when accessing virtual address" error. Then I tried running on X86 and it runs fine but in stats file I get "sim_seconds 18446744.073710" which is impossible. I used 4 cores as there are 4 threads. For compiling this code I am making use of m5threads. I followed the instructions as in the below link https://github.com/WeijingShi/playground/blob/master/Run-openmp-code-in-gem5.md I am not sure what I am doing wrong. Please can someone help me with it. Best Gagan #include #include #include #include int main(int argc, char **argv) { omp_set_num_threads(4); #pragma omp parallel { int ID=omp_get_thread_num(); printf("hello(%d)",ID); printf("World(%d)\n", ID); } return 0; } ___ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Re: [gem5-users] Multi-threading on ARM timing CPU
Hi Ciro, I feel its something with SE mode maybe. Now I tried to run on a latest git repository and I get syscall unimplemented errors. I tried to work around by changing "unimplemented" to "ignore" in process.cc. But then I get different syscall error. I am compiling the code on an arm server with just -fopenmp and -static flags. Am I missing something? Best Gagan -Original Message- From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of Ciro Santilli Sent: Friday, 20 April 2018 00:22 To: gem5 users mailing list Subject: Re: [gem5-users] Multi-threading on ARM timing CPU On Thu, Apr 19, 2018 at 11:08 PM, Singh, G. wrote: > Hi Ciro, > > Sorry for the late response. I had a lot of trouble setting up linux kernel > module on my server. > Indeed it works there. > > But I have added NVMain with gem5 on my system. So I was hoping if can fix > this issue on my setup. > I am still trying to figure out why it keeps on failing. > No problem, I provided that mainly as a working baseline, so now you can diff out the working setup with yours to find the problem more easily :-) Also consider the docker setup if you are having installation difficulties: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/36cffd5c1a6e081194610d1d77a43a863f1d1157#docker > My gem5 version is a mercurial directory. > This the summary I get > > parent: 11775:0eadb0b6e9de tip > > > Best > Gagan > -Original Message- > From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of > Ciro Santilli > Sent: Tuesday, 17 April 2018 14:41 > To: gem5 users mailing list > Subject: Re: [gem5-users] Multi-threading on ARM timing CPU > > On Tue, Apr 17, 2018 at 10:15 AM, Singh, G. wrote: >> Hi, >> >> Please find enclosed the script file and the program code for matrix >> multiplication which I tried. >> > > Thanks. > > Which disk image / kernel are you using? > > I have produced a working fs.py aarch64 example at: > https://github.com/cirosantilli/linux-kernel-module-cheat/tree/singh-m > m#gem5-getting-started (use the singh-mm branch I've created) > > Build and run with: > > ./configure -g && ./build -a aarch64 -g && ./run -a aarch64 -c 4 -g -- > --cpu-type=TimingSimpleCPU > > which uses 4 cores and TimingSimpleCPU. > > After boot finishes, run your benchmark inside the guest with: > > /MM.out > > It completes without errors. > > The setup also worked on arm instead of aarch64, but my arm setup is running > very slowly for some reason which I don't understand yet: > https://github.com/cirosantilli/linux-kernel-module-cheat/tree/02b433e > 3ee8edb129c1e286a37ed2c8a8170fefe#benchmark-linux-kernel-boot > so just use the aarch64 one if you can. > > You will also likely want to enable compiler optimizations as > described at: > https://github.com/cirosantilli/linux-kernel-module-cheat/tree/02b433e > 3ee8edb129c1e286a37ed2c8a8170fefe#enable-compiler-optimizations > but I haven't tested it with that setup. > >> On running gem5 binary with --version option I get "Gem5.opt 2.0". >> > > Please provide the actual git SHA from git log, --version is not updated > often and therefore too imprecise. > >> I tried running a simple hello world program with se.py and got the >> same error. This is the command line I used for it >> ../gem5/build/ARM/gem5.opt ../gem5/configs/example/se.py >> --cpu-type=TimingSimpleCPU --num-cpus=4 --num-work-ids=3 -c hello3 >> --caches --l1d_size=2kB --l1i_size=2kB --l2cache --l2_size=2kB >> >> But if I use DerivO3CPU it works fine. >> >> Best >> Gagan >> >> -Original Message- >> From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of >> Ciro Santilli >> Sent: Tuesday, 17 April 2018 10:04 >> To: gem5 users mailing list >> Subject: Re: [gem5-users] Multi-threading on ARM timing CPU >> >> On Tue, Apr 17, 2018 at 8:10 AM, Singh, G. wrote: >>> Hi All, >>> >>> >>> >>> I am trying to run a simple multi-threaded program on ARM processor >>> with 4 cpu's and 4 threads. >>> >>> This program works perfectly for DerivO3CPU but the same program on >>> timing model gives the errors given >>> >>> below. Actually I get the correct result but the program run does >>> not complete. >>> >> >> Please provide the following: >> >> - gem5 version (git SHA) >> - full gem5 command line >> - how to obtain the required blobs (rootfs, dtb, etc.) >> >> What program are you running? Does it fail on every
Re: [gem5-users] Multi-threading on ARM timing CPU
Hi Ciro, Sorry for the late response. I had a lot of trouble setting up linux kernel module on my server. Indeed it works there. But I have added NVMain with gem5 on my system. So I was hoping if can fix this issue on my setup. I am still trying to figure out why it keeps on failing. My gem5 version is a mercurial directory. This the summary I get parent: 11775:0eadb0b6e9de tip Best Gagan -Original Message- From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of Ciro Santilli Sent: Tuesday, 17 April 2018 14:41 To: gem5 users mailing list Subject: Re: [gem5-users] Multi-threading on ARM timing CPU On Tue, Apr 17, 2018 at 10:15 AM, Singh, G. wrote: > Hi, > > Please find enclosed the script file and the program code for matrix > multiplication which I tried. > Thanks. Which disk image / kernel are you using? I have produced a working fs.py aarch64 example at: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/singh-mm#gem5-getting-started (use the singh-mm branch I've created) Build and run with: ./configure -g && ./build -a aarch64 -g && ./run -a aarch64 -c 4 -g -- --cpu-type=TimingSimpleCPU which uses 4 cores and TimingSimpleCPU. After boot finishes, run your benchmark inside the guest with: /MM.out It completes without errors. The setup also worked on arm instead of aarch64, but my arm setup is running very slowly for some reason which I don't understand yet: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/02b433e3ee8edb129c1e286a37ed2c8a8170fefe#benchmark-linux-kernel-boot so just use the aarch64 one if you can. You will also likely want to enable compiler optimizations as described at: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/02b433e3ee8edb129c1e286a37ed2c8a8170fefe#enable-compiler-optimizations but I haven't tested it with that setup. > On running gem5 binary with --version option I get "Gem5.opt 2.0". > Please provide the actual git SHA from git log, --version is not updated often and therefore too imprecise. > I tried running a simple hello world program with se.py and got the > same error. This is the command line I used for it > ../gem5/build/ARM/gem5.opt ../gem5/configs/example/se.py > --cpu-type=TimingSimpleCPU --num-cpus=4 --num-work-ids=3 -c hello3 > --caches --l1d_size=2kB --l1i_size=2kB --l2cache --l2_size=2kB > > But if I use DerivO3CPU it works fine. > > Best > Gagan > > -Original Message- > From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of > Ciro Santilli > Sent: Tuesday, 17 April 2018 10:04 > To: gem5 users mailing list > Subject: Re: [gem5-users] Multi-threading on ARM timing CPU > > On Tue, Apr 17, 2018 at 8:10 AM, Singh, G. wrote: >> Hi All, >> >> >> >> I am trying to run a simple multi-threaded program on ARM processor >> with 4 cpu's and 4 threads. >> >> This program works perfectly for DerivO3CPU but the same program on >> timing model gives the errors given >> >> below. Actually I get the correct result but the program run does >> not complete. >> > > Please provide the following: > > - gem5 version (git SHA) > - full gem5 command line > - how to obtain the required blobs (rootfs, dtb, etc.) > > What program are you running? Does it fail on every multithreaded program, or > just this partiular one? Can you produce a minimal single C file example that > also fails and give us the source? > >> >> >> Also, is there an option to simulate multithreaded code with each >> thread on different processor using se.py? >> > > Please ask one question per email in the future to make answers more > reusable for other people. ;-) (I don't know the answer to this one > yet) > >> Right now I am writing a new script file. >> >> >> >> gem5.opt: build/ARM/cpu/simple/timing.cc:237: virtual void >> TimingSimpleCPU::suspendContext(ThreadID): Assertion `_status == >> BaseSimpleCPU::Running' failed. >> >> Program aborted at tick 4576216124000 >> >> --- BEGIN LIBC BACKTRACE --- >> >> ../../tools/gem5/build/ARM/gem5.opt(_Z15print_backtracev+0x28)[0xb05d >> 2 >> 8] >> >> ../../tools/gem5/build/ARM/gem5.opt(_Z12abortHandleri+0x46)[0xb24396] >> >> /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7efd25543390] >> >> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7efd24269428] >> >> /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7efd2426b02a] >> >> /lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7efd24261bd7] >> >> /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7efd24261c82] >> >> ../../tools/gem5/build/ARM/gem5.opt(_ZN1
Re: [gem5-users] Multi-threading on ARM timing CPU
Hi, Please find enclosed the script file and the program code for matrix multiplication which I tried. On running gem5 binary with --version option I get "Gem5.opt 2.0". I tried running a simple hello world program with se.py and got the same error. This is the command line I used for it ../gem5/build/ARM/gem5.opt ../gem5/configs/example/se.py --cpu-type=TimingSimpleCPU --num-cpus=4 --num-work-ids=3 -c hello3 --caches --l1d_size=2kB --l1i_size=2kB --l2cache --l2_size=2kB But if I use DerivO3CPU it works fine. Best Gagan -Original Message- From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of Ciro Santilli Sent: Tuesday, 17 April 2018 10:04 To: gem5 users mailing list Subject: Re: [gem5-users] Multi-threading on ARM timing CPU On Tue, Apr 17, 2018 at 8:10 AM, Singh, G. wrote: > Hi All, > > > > I am trying to run a simple multi-threaded program on ARM processor > with 4 cpu's and 4 threads. > > This program works perfectly for DerivO3CPU but the same program on > timing model gives the errors given > > below. Actually I get the correct result but the program run does not > complete. > Please provide the following: - gem5 version (git SHA) - full gem5 command line - how to obtain the required blobs (rootfs, dtb, etc.) What program are you running? Does it fail on every multithreaded program, or just this partiular one? Can you produce a minimal single C file example that also fails and give us the source? > > > Also, is there an option to simulate multithreaded code with each > thread on different processor using se.py? > Please ask one question per email in the future to make answers more reusable for other people. ;-) (I don't know the answer to this one yet) > Right now I am writing a new script file. > > > > gem5.opt: build/ARM/cpu/simple/timing.cc:237: virtual void > TimingSimpleCPU::suspendContext(ThreadID): Assertion `_status == > BaseSimpleCPU::Running' failed. > > Program aborted at tick 4576216124000 > > --- BEGIN LIBC BACKTRACE --- > > ../../tools/gem5/build/ARM/gem5.opt(_Z15print_backtracev+0x28)[0xb05d2 > 8] > > ../../tools/gem5/build/ARM/gem5.opt(_Z12abortHandleri+0x46)[0xb24396] > > /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7efd25543390] > > /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7efd24269428] > > /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7efd2426b02a] > > /lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7efd24261bd7] > > /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7efd24261c82] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN15TimingSimpleCPU14suspendConte > xtEs+0x335)[0xfe1035] > > ../../tools/gem5/build/ARM/gem5.opt(_Z13exitGroupFuncP11SyscallDesciP1 > 1LiveProcessP13ThreadContext+0x57)[0xb85677] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN11SyscallDesc9doSyscallEiP11Liv > eProcessP13ThreadContext+0xa8)[0xb8afe8] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN11LiveProcess7syscallElP13Threa > dContext+0x49)[0xb7bc09] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN6ArmISA14SupervisorCall6invokeE > P13ThreadContextRK14RefCountingPtrI10StaticInstE+0x6a)[0xd8317a] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN13BaseSimpleCPU9advancePCERKSt1 > 0shared_ptrI9FaultBaseE+0x104)[0xfe27a4] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN15TimingSimpleCPU11advanceInstE > RKSt10shared_ptrI9FaultBaseE+0x39)[0xfded49] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN15TimingSimpleCPU14completeIfet > chEP6Packet+0x1d9)[0xfdf149] > > ../../tools/gem5/build/ARM/gem5.opt(_ZN10EventQueue10serviceOneEv+0xb1 > )[0xb14a21] > > ../../tools/gem5/build/ARM/gem5.opt(_Z9doSimLoopP10EventQueue+0x50)[0x > b42020] > > ../../tools/gem5/build/ARM/gem5.opt(_Z8simulatem+0x203)[0xb425f3] > > ../../tools/gem5/build/ARM/gem5.opt[0x1053802] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x785 > 2)[0x7efd25800772] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c) > [0x7efd2593705c] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ff > d)[0x7efd257fff1d] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x712 > 4)[0x7efd25800044] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x712 > 4)[0x7efd25800044] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c) > [0x7efd2593705c] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x > 7efd257f8da9] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x613 > b)[0x7efd257ff05b] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c) > [0x7efd2593705c] > > /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0
[gem5-users] Multi-threading on ARM timing CPU
Hi All, I am trying to run a simple multi-threaded program on ARM processor with 4 cpu's and 4 threads. This program works perfectly for DerivO3CPU but the same program on timing model gives the errors given below. Actually I get the correct result but the program run does not complete. Also, is there an option to simulate multithreaded code with each thread on different processor using se.py? Right now I am writing a new script file. gem5.opt: build/ARM/cpu/simple/timing.cc:237: virtual void TimingSimpleCPU::suspendContext(ThreadID): Assertion `_status == BaseSimpleCPU::Running' failed. Program aborted at tick 4576216124000 --- BEGIN LIBC BACKTRACE --- ../../tools/gem5/build/ARM/gem5.opt(_Z15print_backtracev+0x28)[0xb05d28] ../../tools/gem5/build/ARM/gem5.opt(_Z12abortHandleri+0x46)[0xb24396] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7efd25543390] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7efd24269428] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7efd2426b02a] /lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7efd24261bd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7efd24261c82] ../../tools/gem5/build/ARM/gem5.opt(_ZN15TimingSimpleCPU14suspendContextEs+0x335)[0xfe1035] ../../tools/gem5/build/ARM/gem5.opt(_Z13exitGroupFuncP11SyscallDesciP11LiveProcessP13ThreadContext+0x57)[0xb85677] ../../tools/gem5/build/ARM/gem5.opt(_ZN11SyscallDesc9doSyscallEiP11LiveProcessP13ThreadContext+0xa8)[0xb8afe8] ../../tools/gem5/build/ARM/gem5.opt(_ZN11LiveProcess7syscallElP13ThreadContext+0x49)[0xb7bc09] ../../tools/gem5/build/ARM/gem5.opt(_ZN6ArmISA14SupervisorCall6invokeEP13ThreadContextRK14RefCountingPtrI10StaticInstE+0x6a)[0xd8317a] ../../tools/gem5/build/ARM/gem5.opt(_ZN13BaseSimpleCPU9advancePCERKSt10shared_ptrI9FaultBaseE+0x104)[0xfe27a4] ../../tools/gem5/build/ARM/gem5.opt(_ZN15TimingSimpleCPU11advanceInstERKSt10shared_ptrI9FaultBaseE+0x39)[0xfded49] ../../tools/gem5/build/ARM/gem5.opt(_ZN15TimingSimpleCPU14completeIfetchEP6Packet+0x1d9)[0xfdf149] ../../tools/gem5/build/ARM/gem5.opt(_ZN10EventQueue10serviceOneEv+0xb1)[0xb14a21] ../../tools/gem5/build/ARM/gem5.opt(_Z9doSimLoopP10EventQueue+0x50)[0xb42020] ../../tools/gem5/build/ARM/gem5.opt(_Z8simulatem+0x203)[0xb425f3] ../../tools/gem5/build/ARM/gem5.opt[0x1053802] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7852)[0x7efd25800772] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7efd2593705c] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd)[0x7efd257fff1d] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7124)[0x7efd25800044] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7124)[0x7efd25800044] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7efd2593705c] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7efd257f8da9] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x613b)[0x7efd257ff05b] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7efd2593705c] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd)[0x7efd257fff1d] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7efd2593705c] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7efd257f8da9] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76)[0x7efd258731f6] --- END LIBC BACKTRACE --- Aborted (core dumped) Best Gagan ___ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
[gem5-users] Multithread with se.py
Hi, I am trying run a multithreaded code in se mode but I don’t know how to specify the program to run on all the cores rather than just one. Please can someone help me with it Best, Gagan ___ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
[gem5-users] gem5+NVMain
Hi, I am trying to extend gem5 with NVMain simulator but I am facing some issues with it. I tried building NVMain with gem5 by following the instruction on http://wiki.nvmain.org/index.php?n=Site.Compiling It compiles perfectly but I am not able to pass all the nvmain argument, just-mem-type=NVMainMemory and no other parameters. I checked the latest patch (nvmain2-gem5-11688+) seems like it doesn't have other parameters like" -nvmain-config" to mention the configuration file. I tried patching with previous patch versions but then I am having problem with passing NVMain as -mem-type. To find a way around this, I tried getting traces from gem5 using -debug-flags=Exec but I suppose that is not the trace file which is supported by NVMain as probably I just need to get the memory traces which are supported. Maybe by using "CommMonitor" flag but I am not sure? Please, can someone help me with it. Regards, Gagan ___ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users