Back to index

numactl  2.0.8~rc4
Functions | Variables
stream_main.c File Reference
#include <stdio.h>
#include <sys/mman.h>
#include <stdlib.h>
#include "numa.h"
#include "numaif.h"
#include "util.h"
#include "stream_lib.h"

Go to the source code of this file.

Functions

void usage (void)
int main (int ac, char **av)

Variables

char * policy = "default"

Function Documentation

int main ( int  ac,
char **  av 
)

Definition at line 17 of file stream_main.c.

{
       struct bitmask *nodes;
       char *map;
       long size;
       int policy;

       policy = parse_policy(av[1], av[2]);

        nodes = numa_allocate_nodemask();

       if (av[1] && av[2])
              nodes = numa_parse_nodestring(av[2]);
       if (!nodes) {
              printf ("<%s> is invalid\n", av[2]);
              exit(1);
       }
       size = stream_memsize();
       map = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
                 0, 0);
       if (map == (char*)-1) exit(1);
       if (mbind(map, size, policy, nodes->maskp, nodes->size, 0) < 0)
              perror("mbind"), exit(1);
       stream_init(map);
       stream_test(NULL);
       return 0;
}

Here is the call graph for this function:

void usage ( void  )

Definition at line 9 of file stream_main.c.

{
       exit(1);
}

Variable Documentation

char* policy = "default"

Definition at line 14 of file stream_main.c.