Beispiel #1
0
int test_numainit()
{
    int i = 0;
    topology_init();
    numa_init();
    NumaTopology_t numainfo = get_numaTopology();
    if (numainfo == NULL)
        goto fail;
    if (numainfo->numberOfNodes <= 0)
        goto fail;
    if (likwid_getNumberOfNodes() <= 0)
        goto fail;
    for (i = 0; i < likwid_getNumberOfNodes(); i++)
    {
        if (numainfo->nodes[i].totalMemory == 0)
            goto fail;
        if (numainfo->nodes[i].freeMemory == 0)
            goto fail;
        if (numainfo->nodes[i].numberOfProcessors == 0)
            goto fail;
        if (numainfo->nodes[i].numberOfDistances == 0)
            goto fail;
        if (numainfo->nodes[i].numberOfDistances != likwid_getNumberOfNodes())
            goto fail;
    }
    numa_finalize();
    topology_finalize();
    return 1;
fail:
    numa_finalize();
    topology_finalize();
    return 0;
}
Beispiel #2
0
static int lua_likwid_finalize(lua_State* L)
{
    if (topology_isInitialized == 1)
    {
        topology_finalize();
        topology_isInitialized = 0;
        cputopo = NULL;
        cpuinfo = NULL;
    }
    if (numa_isInitialized == 1)
    {
        numa_finalize();
        numa_isInitialized = 0;
        numainfo = NULL;
    }
    if (affinity_isInitialized == 1)
    {
        affinity_finalize();
        affinity_isInitialized = 0;
        affinity = NULL;
    }
    if (perfmon_isInitialized == 1)
    {
        perfmon_finalize();
        perfmon_isInitialized = 0;
    }
    if (config_isInitialized == 1)
    {
        destroy_configuration();
        config_isInitialized = 0;
        configfile = NULL;
    }
    return 0;
}
Beispiel #3
0
static int lua_likwid_putNumaInfo(lua_State* L)
{
    if (numa_isInitialized)
    {
        numa_finalize();
        numa_isInitialized = 0;
        numainfo = NULL;
    }
    return 0;
}