Ignore:
Timestamp:
Feb 23, 2021, 4:02:27 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b664af2
Parents:
a06023f
Message:

Added option to isolate processor so everything has it's own cluster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/options.cfa

    ra06023f r348f81d5  
    1313#include <kernel.hfa>
    1414#include <parseargs.hfa>
     15#include <stdlib.hfa>
    1516
    1617#include <stdlib.h>
     
    3637
    3738        { // cluster
     39                1,     // nclusters;
    3840                1,     // nprocs;
    3941                1,     // nworkers;
     
    5052        // bool iokpoll = false;
    5153        unsigned nentries = 16;
     54        bool isolate = false;
    5255
    5356
     
    5659                { 'c', "cpus",           "Number of processors to use", options.clopts.nprocs},
    5760                { 't', "threads",        "Number of worker threads to use", options.clopts.nworkers},
     61                {'\0', "isolate",        "Create one cluster per processor", isolate, parse_settrue},
    5862                {'\0', "log",            "Enable logs", options.log, parse_settrue},
    5963                {'\0', "accept-backlog", "Maximum number of pending accepts", options.socket.backlog},
     
    8589                nentries = v;
    8690        }
     91        if(isolate) {
     92                options.clopts.nclusters = options.clopts.nprocs;
     93                options.clopts.nprocs = 1;
     94        }
    8795        options.clopts.params.num_entries = nentries;
     96        options.clopts.instance = alloc(options.clopts.nclusters);
     97        options.clopts.thrd_cnt = alloc(options.clopts.nclusters);
     98        options.clopts.cltr_cnt = 0;
     99        for(i; options.clopts.nclusters) {
     100                options.clopts.thrd_cnt[i] = 0;
     101        }
     102
    88103
    89104        // if( fixedfd ) {
Note: See TracChangeset for help on using the changeset viewer.