Back to index

numactl  2.0.8~rc4
Functions
nodemap.c File Reference
#include "numa.h"
#include "bitops.h"
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 7 of file nodemap.c.

{
       int i, k, w, ncpus;
       struct bitmask *cpus;
       int maxnode = numa_num_configured_nodes()-1;

       if (numa_available() < 0)  {
              printf("no numa\n");
              exit(1);
       }
       cpus = numa_allocate_cpumask();
       ncpus = cpus->size;

       for (i = 0; i <= maxnode ; i++) {
              if (numa_node_to_cpus(i, cpus) < 0) {
                     printf("node %d failed to convert\n",i); 
              }             
              printf("%d: ", i); 
              w = 0;
              for (k = 0; k < ncpus; k++)
                     if (numa_bitmask_isbitset(cpus, k))
                            printf(" %s%d", w>0?",":"", k);
              putchar('\n');              
       }
       return 0;
}

Here is the call graph for this function: