Open dannyi96 opened 6 years ago
What is the size of an 'epoch' you are using? Make sure the program runs longer than the max epoch time. Please run your program in loop for some seconds and check the results again.
Thanks for the response. I tried running the same code in loops for 2000 iterations and then it shows NVM accesses value in the statistics output as expected. I'm not sure of how exactly to check the current 'epoch' size? And is there a way to modify it so that even if there is 1 NVM access, it displays in the output.
You can change the epoch time in the nvmemul.ini file. However, very small epochs may lead to extra overhead and additional deviations in the modeling.
Ok. Thanks a lot!
Also, I wanted to address another issue. I've used this as sample code
#include<stdio.h>
#include<stdlib.h>
#include "pmalloc.h"
typedef struct node
{
int data;
struct node *next;
}NODE;
void dummyUse(int x)
{
NODE *new_node = (NODE*)pmalloc(sizeof(NODE));
new_node->data = x;
new_node->next = NULL;
}
int main()
{
int i;
for(i=0;i<20000;i++)
dummyUse(rand()%100);
return 0;
}
But when I try running the code I get the wrong value of NVM accesses(it should be 20000, if I'm not mistaken). But I get only 169 NVM accesses
== Terminated threads ==
Thread id [30300]
: cpu id: 0
: spawn timestamp: 766953101986
: termination timestamp: 766953167483
: execution time: 65497 usecs
: stall cycles: 54152
: NVM accesses: 169
: latency calculation overhead cycles: 0
: injected delay cycles: 278789
: injected delay in usec: 132
: longest epoch duration: 10051 usec
: shortest epoch duration: 10010 usec
: average epoch duration: 10026 usec
: number of epochs: 6
: epochs which didn't reach min duration: 0
: static epochs requested: 6
Is there any reason for this?
Edit: Also when I unload and load the kernel module and then run, I get 658 NVM accesses shown in the statistics output
@danny311296 , this code example is not reading/loading any persistent memory allocated with pmalloc(). Some small amount of 'NVM' access may happen for architectural reasons, but if you want to see 2000 access or more, you have to randomically access/load/read the allocated 'new_node's. Also make sure for your code example that the compiler will not optmize out the memory accesses and make random memory access so the CPU pre-fetch will not hide the memory latency (preventing CPU stall).
Ok. Thanks a lot for the help!
@danny311296 I've picked your first code to try it as an initiation to know how to use the emulator but I don't get the correct program output especially for NVM access, is it due to this : "tee: /sys/bus/event_source/devices/cpu/rdpmc: No file or folder of this type" ?
What linux kernel version are you using? Is the linux perf events enabled in the kernel? Did you try acessing that file and running the application as root?
@guimagalhaes I'm using version 4.4, I've tried to run the app as root but in vain and I didn't find that file. I'm working on a virtual machine Ubuntu 14.04, Intel(R) Xeon(R) CPU E3-1245 v3 @ 3.40GHz.
Please check the kernel has performane counters enabled.
@guimagalhaes In fact, the kernel has performance counters enabled.
Statistics Output:
== Terminated threads == Thread id [3582] : cpu id: 0 : spawn timestamp: 635334690 : termination timestamp: 679622253 : execution time: 44287563 usecs : stall cycles: 0 : NVM accesses: 0 : latency calculation overhead cycles: 1048035309 : injected delay cycles: 0 : injected delay in usec: 0 : longest epoch duration: 18604 usec : shortest epoch duration: 509 usec : average epoch duration: 1427 usec : number of epochs: 31020 : epochs which didn't reach min duration: 0 : static epochs requested: 31020
I don't really Understand why and I still have this : tee: /sys/bus/event_source/devices/cpu/rdpmc: No file or folder of this type" ?
Can you access '/sys/devices/cpu/rdpmc'?
@guimagalhaes No I can't.
Are you using a modified or official kernel version? Could you install the latest stable kernel version?
Yes, I've installed Linux 4.10.0-27-generic x86_64
I am using 4.16.11 and I don't see the problem. Please install 4.16 and retry.
Yes, I've installed Linux 4.10.0-27-generic x86_64 Hello. I met the same problem with you (tee: /sys/bus/event_source/devices/cpu/rdpmc: No file or folder of this type" ). And our hardware configuration is same ( Intel(R) Xeon(R) CPU E3), I also tried the linux version 4.16.11, but it still didn't work. Have you fixed the problem. Please give me some help if possible.
I have used this sample code where I have used pmalloc for a linked list
My current directory contents looks like this 1) plinkedlist.c 2) src < src directory of quartz > 3) scripts < scripts directory of quartz> 4) build < build file of quartz> 5) nvmemul.ini 6) nvmemul.dox 7) nvmemul-orig.ini 8) a.out < the program executable>
I have compiled the file using the following commands
gcc -I src/lib/ plinkedlist.c -L build/src/lib/ -lnvmemul
sudo scripts/setupdev.sh load
scripts/runenv.sh ./a.out
I get the correct program output but in the statistics I get 0 NVM accesses, even though this is untrue.
Statistics Output:
Is there any reason/mistake I'm making?