Ignore:
Timestamp:
Mar 2, 2021, 5:28:32 PM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
6083392
Parents:
182256b (diff), 9eb7a53 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r182256b r266ecf1  
    1313#include <kernel.hfa>
    1414#include <parseargs.hfa>
     15#include <stdlib.hfa>
    1516
    1617#include <stdlib.h>
     
    1920Options options @= {
    2021        false, // log
     22        false, // stats
    2123
    2224        { // file_cache
     
    3638
    3739        { // cluster
     40                1,     // nclusters;
    3841                1,     // nprocs;
    3942                1,     // nworkers;
     
    4649
    4750void parse_options( int argc, char * argv[] ) {
    48         bool subthrd = false;
    49         bool eagrsub = false;
    50         bool fixedfd = false;
    51         bool sqkpoll = false;
    52         bool iokpoll = false;
    53         unsigned sublen = 16;
     51        // bool fixedfd = false;
     52        // bool sqkpoll = false;
     53        // bool iokpoll = false;
    5454        unsigned nentries = 16;
     55        bool isolate = false;
    5556
    5657
     
    5960                { 'c', "cpus",           "Number of processors to use", options.clopts.nprocs},
    6061                { 't', "threads",        "Number of worker threads to use", options.clopts.nworkers},
     62                {'\0', "isolate",        "Create one cluster per processor", isolate, parse_settrue},
    6163                {'\0', "log",            "Enable logs", options.log, parse_settrue},
     64                {'\0', "stats",          "Enable statistics", options.stats, parse_settrue},
    6265                {'\0', "accept-backlog", "Maximum number of pending accepts", options.socket.backlog},
    6366                {'\0', "request_len",    "Maximum number of bytes in the http request, requests with more data will be answered with Http Code 414", options.socket.buflen},
     
    6568                {'\0', "cache-size",     "Size of the cache to use, if set to small, will uses closes power of 2", options.file_cache.size },
    6669                {'\0', "list-files",     "List the files in the specified path and exit", options.file_cache.list, parse_settrue },
    67                 { 's', "submitthread",   "If set, cluster uses polling thread to submit I/O", subthrd, parse_settrue },
    68                 { 'e', "eagersubmit",    "If set, cluster submits I/O eagerly but still aggregates submits", eagrsub, parse_settrue},
    69                 { 'f', "fixed-fds",      "If set, files are open eagerly and pre-registered with the cluster", fixedfd, parse_settrue},
    70                 { 'k', "kpollsubmit",    "If set, cluster uses IORING_SETUP_SQPOLL, implies -f", sqkpoll, parse_settrue },
    71                 { 'i', "kpollcomplete",  "If set, cluster uses IORING_SETUP_IOPOLL", iokpoll, parse_settrue },
    72                 {'\0', "submitlength",   "Max number of submitions that can be submitted together", sublen },
    73                 {'\0', "numentries",     "Number of I/O entries", nentries },
     70                // { 'f', "fixed-fds",      "If set, files are open eagerly and pre-registered with the cluster", fixedfd, parse_settrue},
     71                // { 'k', "kpollsubmit",    "If set, cluster uses IORING_SETUP_SQPOLL, implies -f", sqkpoll, parse_settrue },
     72                // { 'i', "kpollcomplete",  "If set, cluster uses IORING_SETUP_IOPOLL", iokpoll, parse_settrue },
     73                {'e', "numentries",     "Number of I/O entries", nentries },
    7474
    7575        };
     
    9191                nentries = v;
    9292        }
     93        if(isolate) {
     94                options.clopts.nclusters = options.clopts.nprocs;
     95                options.clopts.nprocs = 1;
     96        }
    9397        options.clopts.params.num_entries = nentries;
    94 
    95         options.clopts.params.poller_submits = subthrd;
    96         options.clopts.params.eager_submits  = eagrsub;
    97 
    98         if( fixedfd ) {
    99                 options.file_cache.fixed_fds = true;
     98        options.clopts.instance = alloc(options.clopts.nclusters);
     99        options.clopts.thrd_cnt = alloc(options.clopts.nclusters);
     100        options.clopts.cltr_cnt = 0;
     101        for(i; options.clopts.nclusters) {
     102                options.clopts.thrd_cnt[i] = 0;
    100103        }
    101104
    102         if( sqkpoll ) {
    103                 options.clopts.params.poll_submit = true;
    104                 options.file_cache.fixed_fds = true;
    105         }
    106105
    107         if( iokpoll ) {
    108                 options.clopts.params.poll_complete = true;
    109                 options.file_cache.open_flags |= O_DIRECT;
    110         }
     106        // if( fixedfd ) {
     107        //      options.file_cache.fixed_fds = true;
     108        // }
    111109
    112         options.clopts.params.num_ready = sublen;
     110        // if( sqkpoll ) {
     111        //      options.file_cache.fixed_fds = true;
     112        // }
     113
     114        // if( iokpoll ) {
     115        //      options.file_cache.open_flags |= O_DIRECT;
     116        // }
    113117
    114118        if( left[0] == 0p ) { return; }
Note: See TracChangeset for help on using the changeset viewer.