Coder Social home page Coder Social logo

Glib-ERROR about libcachesim HOT 21 CLOSED

1a1a11a avatar 1a1a11a commented on September 4, 2024
Glib-ERROR

from libcachesim.

Comments (21)

1a1a11a avatar 1a1a11a commented on September 4, 2024

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

Memory on the server.

root@dbms:~# free -h
total used free shared buff/cache available
Mem: 62G 475M 62G 16K 148M 61G
Swap: 9.0G 102M 8.9G

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

I tried to figure out the stack with gdb, but it says I can't.

So I looked at the problem with dmeseg.

(gdb) p main
$1 = {int (int, char **)} 0x555555554c90


(gdb) r
Starting program: /root/libCacheSim/_build/c18.back.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
filename = /hdd/cluster22.000

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb) bt
No stack.
(gdb)

[188077.776581] [14560] 0 14560 20101354 16210629 150704128 2311952 0 c18.back.out
[188077.776582] [14597] 0 14597 1546 16 53248 0 0 sleep
[188077.776584] Out of memory: Kill process 14560 (c18.back.out) score 956 or sacrifice child
[188077.777441] Killed process 14560 (c18.back.out) total-vm:80405416kB, anon-rss:64842516kB, file-rss:0kB, shmem-rss:0kB

I don't know why it holds 80gb...
Is the test.c file that I wrote wrong...?

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

is the problem solved?

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

No, some run for each trace and others don't. I haven't solved it yet.

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

How do you setup the reader?

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

I wrote the test in this way and opened the reader in various formats.

#include <libCacheSim.h>

#define NUM_TRACE_FILES         88
#define MEASUREMENT_FILES       72

int main(int argc, char *argv[]) {
    unsigned long total = 0;
    long lru_miss_cnt, fifo_miss_cnt;
    int nfiles;
    reader_t *reader;
    request_t *req = new_request();
    char filename[64];

    common_cache_params_t cc_params = {.cache_size = 1024*1024*1024, .hashpower = 26};
    cache_t *lru_cache = create_cache("LRU", cc_params, NULL);               
 //   cache_t *fifo_cache = create_cache("FIFO", cc_params, NULL);

    int64_t req_byte = 0, miss_byte = 0;

    lru_miss_cnt = fifo_miss_cnt = 0;

    for (nfiles = 0; nfiles < NUM_TRACE_FILES; nfiles++) {

        sprintf(filename, "/hdd/cluster18.%03d", nfiles);
        printf("filename = %s\n", filename);

        reader_init_param_t init_params_csv = {.delimiter=',', .real_time_field=1, .obj_id_field=2, .ttl_field=7, .has_header=FALSE};
       // reader = open_trace(filename, CSV_TRACE, OBJ_ID_STR, &init_params_csv);
        // reader = open_trace(filename, PLAIN_TXT_TRACE, OBJ_ID_NUM, NULL);

        while (read_one_req(reader, req) == 0) { 
         //   printf("req_size = %u\n", req->obj_size);
        
		if (nfiles > MEASUREMENT_FILES) total++;
        if (lru_cache->get(lru_cache, req) == cache_ck_miss) {
            if (nfiles > MEASUREMENT_FILES) lru_miss_cnt++;
            }
 //           if (fifo_cache->get(fifo_cache, req) == cache_ck_miss) {
 //               if (nfiles > MEASUREMENT_FILES) fifo_miss_cnt++;
//                }
        }
        close_trace(reader);
    }

    free_request(req);
    lru_cache->cache_free(lru_cache);
//    fifo_cache->cache_free(fifo_cache);
    
    printf("========LRU=======\n");
    printf("total:%lu\n", total);
    printf("hit_rate:%f\n", ((float) total - (float) lru_miss_cnt) / (float) total * 100);
    printf("miss_rate:%f\n", (float) lru_miss_cnt / (float) total * 100);
    printf("======================\n");
    printf("========FIFO=======\n");
    printf("total:%lu\n", total);
    printf("hit_rate:%f\n", ((float) total - (float) fifo_miss_cnt) / (float) total * 100);
    printf("miss_rate:%f\n", (float) fifo_miss_cnt / (float) total * 100);
    printf("======================\n");

    return 0;
}

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

you did not specify obj_size_col, then each object will be size 1, and you give a cache size of 102410241024, which means the cache will have 102410241024 objects, each object will use 10s bytes, so it may use more than 64 GB DRAM.
You can try to 1. specify the obj_size_col 2. reduce the cache size

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

Thank you. I'll try again in the way you told me.

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

Can I know the location of obj_size_col? I can't find it.

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

reader_init_param_t init_params_csv = {.delimiter=',', .real_time_field=1, .obj_id_field=2, .ttl_field=7, .has_header=FALSE};
add .obj_size_field=v

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

Oh!
I was originally going to add this, but I couldn't because I didn't know how to specify it because the trace has cache_size_field with key and value.

image

How should I write the field when the trace is like this?

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024
  1. you can write a new trace reader
  2. you can preprocess the trace and add a new column
  3. you can use the value size to approximate object size (not recommend)

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

Which reader format should I use to use Method 1? Originally, I tried to use txt, but it was not available due to a similar error, and there was an error in other formats.

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

you need to create a trace reader under libCacheSim/traceReader/ that can parse the data set you use

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

I'll give it a try.

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

from libcachesim.

gwanil avatar gwanil commented on September 4, 2024

At first, I tried to specify an object size field, but I didn't write it because I didn't know how to assign both sizes because the object size is key and value, as shown in the image above.

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

what image?

from libcachesim.

1a1a11a avatar 1a1a11a commented on September 4, 2024

somehow the previous message was delayed
let me know if you have any question, if not I will close this.

from libcachesim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.