common.R 3.14 KB
Newer Older
1 2
"%IN%" <- function(x, y) interaction(x) %in% interaction(y)

Martin Khannouz's avatar
Martin Khannouz committed
3
get_data_subset <- function(f, n, h, p, b)
Martin Khannouz's avatar
Martin Khannouz committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
{
    d <- read.csv(file=f,comment.char = "#", sep=",", quote = "\"", head=TRUE,
                  dec=".", colClasses=
	    c("factor",	# model
		"factor",	# algorithm
		"integer",	# nnode
		"integer",	# nthread
		"integer",	# npart
		"integer",	# height
		"integer",	# bsize
		"numeric",	# global_time
		"numeric",	# runtime_time
		"numeric",	# task_time
		"numeric",	# idle_time
		"numeric",	# scheduling_time
		"numeric",	# communuication_time
20
		"numeric",	# communuication_vol
Martin Khannouz's avatar
Martin Khannouz committed
21 22 23 24 25 26 27 28 29 30 31
		"numeric"	# rmen
		))

    d$npart     <- ordered(d$npart)
    d$height    <- ordered(d$height)
    d$bsize     <- ordered(d$bsize)

    if (n)
        d <- subset(d, npart == n)
    if (h)
        d <- subset(d, height == h)
Martin Khannouz's avatar
Martin Khannouz committed
32 33
    if (b)
        d <- subset(d, bsize == b | algo == "simple-mpi")
Martin Khannouz's avatar
Martin Khannouz committed
34 35 36 37 38 39

    return (d)
}

get_breaks_runtime <- function()
{
Martin Khannouz's avatar
Martin Khannouz committed
40
    return (c('implicit-variable-bsize', 'explicit-variable-bsize', 'implicit limited', 'simple-mpi', 'implicit-two-by', 'implicit', 'explicit'))
Martin Khannouz's avatar
Martin Khannouz committed
41 42 43 44
}

get_labels_runtime <- function()
{
Martin Khannouz's avatar
Martin Khannouz committed
45
    return (c('Implicit (STF)', 'Explicit (Hybrid STF+MPI)', 'Implicit Limited', 'Native MPI+OpenMP', 'Implicit two by', 'Implicit (2000)', 'Explicit (2000)'))
Martin Khannouz's avatar
Martin Khannouz committed
46 47 48 49
}

get_colors_runtime <- function()
{
Martin Khannouz's avatar
Martin Khannouz committed
50 51 52 53 54 55 56
    return (c('implicit'  = "#96007d", # --> violet
              'explicit'   = "#00af1b",# --> Vert
			  'implicit limited' = "#f85c00", # --> orange
			  'simple-mpi' = "#266d83", #--> bleu
			  'implicit-two-by' = "#50de11",
			  'implicit-variable-bsize' = "#e2aa00", #--> jaune
			  'explicit-variable-bsize' = "#e20025")) #--> rouge
Martin Khannouz's avatar
Martin Khannouz committed
57 58
}

Martin Khannouz's avatar
Martin Khannouz committed
59
get_bsize_reference <- function()
Martin Khannouz's avatar
Martin Khannouz committed
60
{
Martin Khannouz's avatar
Martin Khannouz committed
61
	return (2000)
Martin Khannouz's avatar
Martin Khannouz committed
62
}
63 64 65 66 67 68 69 70
get_one_node_reference_algorithm <- function()
{
	return ("starpu")
}
get_output_directory <- function()
{
	return ("output")
}
Martin Khannouz's avatar
Martin Khannouz committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
# Timings
get_breaks_timings <- function()
{
    return (c('runtime_time', 'communication_time', 'scheduling_time', 'pipeline_time', 'task_time', 'parallel_time'))
}

get_labels_timings <- function()
{
    return (c('Runtime', 'Communication', 'Scheduling', 'Pipeline', 'Task', 'Parallel'))
}

get_colors_timings <- function()
{
    return (c('task_time'       = "#619dff",
              'runtime_time'    = "#01ba38",
              'pipeline_time'   = "#f9766e",
              'scheduling_time' = "#fdbc43",
		      'communication_time' = "#9D2FEA",
              'parallel_time'   = "#000000"))
}
npart_labeller <- function(value)
{
    return (paste("N =", format(as.numeric(value), scientific=TRUE)))
}

height_labeller <- function(value)
{
    return (paste("h =", value))
}
100 101 102 103 104 105 106 107
group_size_labeller <- function(value)
{
    return (paste("bs =", value))
}
nnode_labeller <- function(value)
{
    return (paste("node =", value))
}
Martin Khannouz's avatar
Martin Khannouz committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121
data_distribution_labeller <- function(value)
{
    return (value)
}
get_theme <- function()
{
	(theme(legend.text = element_text(size = 14)) +
	 theme(legend.title = element_text(size = 16)) +
	 theme(axis.title.x = element_text(size = 13)) +
	 theme(axis.title.y = element_text(size = 13)) +
	 theme(strip.text.x = element_text(size = 13)) +
	 theme(strip.text.y = element_text(size = 13)) +
	 theme(text = element_text(size = 13)))
}