runtime_context.c 1.85 KB
Newer Older
1
/**
2
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
3
 * @file quark/runtime_context.c
4
 *
5
 * @copyright 2009-2014 The University of Tennessee and The University of
Mathieu Faverge's avatar
Mathieu Faverge committed
6
 *                      Tennessee Research Foundation. All rights reserved.
Mathieu Faverge's avatar
Mathieu Faverge committed
7
 * @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8
 *                      Univ. Bordeaux. All rights reserved.
9
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
10 11 12
 ***
 *
 * @brief Chameleon Quark context routines
13
 *
14
 * @version 1.0.0
15 16
 * @author Vijay Joshi
 * @author Cedric Castagnede
17
 * @date 2011-10-29
18
 *
19
 */
20
#include <stdlib.h>
21
#include "chameleon_quark.h"
22

23
/**
24
 *  Create new context
25
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
26
void RUNTIME_context_create( CHAM_context_t *chamctxt )
27
{
Mathieu Faverge's avatar
Mathieu Faverge committed
28
    chamctxt->scheduler = RUNTIME_SCHED_QUARK;
29 30 31 32
    /* Will require the static initialization if we want to use it in this code */
    return;
}

33
/**
34
 *  Clean the context
35
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
36
void RUNTIME_context_destroy( CHAM_context_t *chamctxt )
37
{
Mathieu Faverge's avatar
Mathieu Faverge committed
38
    (void)chamctxt;
39 40 41
    return;
}

42
/**
43 44
 *
 */
45
void RUNTIME_enable( void *runtime_ctxt, int lever )
46 47 48
{
    switch (lever)
    {
49 50 51 52 53 54 55 56 57 58 59 60
    case CHAMELEON_DAG:
        QUARK_Barrier( runtime_ctxt );
        QUARK_DOT_DAG_Enable( runtime_ctxt, 1 );
        break;
    case CHAMELEON_PROFILING_MODE:
        fprintf(stderr, "Profiling is not available with Quark\n");
        break;
    case CHAMELEON_BOUND:
        fprintf(stderr, "Bound computation is not available with Quark\n");
        break;
    default:
        return;
61 62 63 64
    }
    return;
}

65
/**
66
 *
67
 */
68
void RUNTIME_disable( void *runtime_ctxt, int lever )
69 70 71
{
    switch (lever)
    {
72 73 74 75 76 77 78 79 80 81 82 83
    case CHAMELEON_DAG:
        QUARK_Barrier( runtime_ctxt );
        QUARK_DOT_DAG_Enable( runtime_ctxt, 0 );
        break;
    case CHAMELEON_PROFILING_MODE:
        fprintf(stderr, "Profiling is not available with Quark\n");
        break;
    case CHAMELEON_BOUND:
        fprintf(stderr, "Bound computation is not available with Quark\n");
        break;
    default:
        return;
84 85 86
    }
    return;
}