| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 | 
							- # StarPU --- Runtime system for heterogeneous multicore architectures.
 
- #
 
- # Copyright (C) 2008-2020  Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
 
- #
 
- # StarPU is free software; you can redistribute it and/or modify
 
- # it under the terms of the GNU Lesser General Public License as published by
 
- # the Free Software Foundation; either version 2.1 of the License, or (at
 
- # your option) any later version.
 
- #
 
- # StarPU is distributed in the hope that it will be useful, but
 
- # WITHOUT ANY WARRANTY; without even the implied warranty of
 
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
- #
 
- # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
- #
 
- max <- 30
 
- sizelist <- seq(64, max*1024, 64);
 
- #schedlist <- c("greedy", "prio", "dm", "random", "no-prio", "ws", "lws");
 
- #schedlist <- c("greedy", "prio", "dm", "random");
 
- #grainlist <- c(256, 512, 1024)
 
- grainlist <- c(512, 1024)
 
- gflops <- function (x, size)
 
- {
 
- 	2*size*size*size/(3000000*x);
 
- }
 
- parse <- function (size, grain)
 
- {
 
- 	filename = paste("timing/granularity", grain, size, sep=".");
 
- 	if (file.exists(filename))
 
- 	{
 
- 		ret <- scan(filename);
 
- 		return(ret);
 
- 	}
 
- 	return (NA);
 
- }
 
- handle_size <- function (size, grain)
 
- {
 
- 	parsed <- parse(size, grain);
 
- 	if (is.na(parsed))
 
- 	{
 
- 		return (NA);
 
- 	}
 
- 	gflops <- gflops(parsed, size);
 
- 	return(gflops);
 
- }
 
- handle_grain <- function(grain)
 
- {
 
- 	gflopstab <- NULL;
 
- 	sizetab <- NULL;
 
- 	for (size in sizelist)
 
- 	{
 
- 		list <- handle_size(size, grain);
 
- 		if (!is.na(list))
 
- 		{
 
- 			gflopstab <- c(gflopstab, list);
 
- 			sizetab <- c(sizetab, array(size, c(length(list))));
 
- 		}
 
- 	}
 
- 	return(
 
- 		data.frame(gflops=gflopstab, size=sizetab, grain=array(grain, c(length(gflopstab)) ))
 
- 	);
 
- }
 
- handle_grain_mean <- function(grain)
 
- {
 
- 	meantab <- NULL;
 
- 	sizetab <- NULL;
 
- 	for (size in sizelist)
 
- 	{
 
- 		list <- mean(handle_size(size, grain));
 
- 		if (!is.na(list))
 
- 		{
 
- 			meantab <- c(meantab, list);
 
- 			sizetab <- c(sizetab, array(size, c(length(list))));
 
- 		}
 
- 	}
 
- 	return(
 
- 		data.frame(gflops=meantab, size=sizetab, grain=array(grain, c(length(meantab)) ))
 
- #		meantab
 
- 	);
 
- }
 
- parse_nm <- function (size, grain)
 
- {
 
- 	filename = paste("timing/granularity.nomodel", grain, size, sep=".");
 
- 	if (file.exists(filename))
 
- 	{
 
- 		ret <- scan(filename);
 
- 		return(ret);
 
- 	}
 
- 	return (NA);
 
- }
 
- handle_size_nm <- function (size, grain)
 
- {
 
- 	parsed <- parse_nm(size, grain);
 
- 	if (is.na(parsed))
 
- 	{
 
- 		return (NA);
 
- 	}
 
- 	gflops <- gflops(parsed, size);
 
- 	return(gflops);
 
- }
 
- handle_grain_nm <- function(grain)
 
- {
 
- 	gflopstab <- NULL;
 
- 	sizetab <- NULL;
 
- 	for (size in sizelist)
 
- 	{
 
- 		list <- handle_size_nm(size, grain);
 
- 		if (!is.na(list))
 
- 		{
 
- 			gflopstab <- c(gflopstab, list);
 
- 			sizetab <- c(sizetab, array(size, c(length(list))));
 
- 		}
 
- 	}
 
- 	return(
 
- 		data.frame(gflops=gflopstab, size=sizetab, grain=array(grain, c(length(gflopstab)) ))
 
- 	);
 
- }
 
- handle_grain_mean_nm <- function(grain)
 
- {
 
- 	meantab <- NULL;
 
- 	sizetab <- NULL;
 
- 	for (size in sizelist)
 
- 	{
 
- 		list <- mean(handle_size_nm(size, grain));
 
- 		if (!is.na(list))
 
- 		{
 
- 			meantab <- c(meantab, list);
 
- 			sizetab <- c(sizetab, array(size, c(length(list))));
 
- 		}
 
- 	}
 
- 	return(
 
- 		data.frame(gflops=meantab, size=sizetab, grain=array(grain, c(length(meantab)) ))
 
- #		meantab
 
- 	);
 
- }
 
- handle_grain_mean <- function(grain)
 
- {
 
- 	meantab <- NULL;
 
- 	sizetab <- NULL;
 
- 	for (size in sizelist)
 
- 	{
 
- 		list <- mean(handle_size(size, grain));
 
- 		if (!is.na(list))
 
- 		{
 
- 			meantab <- c(meantab, list);
 
- 			sizetab <- c(sizetab, array(size, c(length(list))));
 
- 		}
 
- 	}
 
- 	return(
 
- 		data.frame(gflops=meantab, size=sizetab, grain=array(grain, c(length(meantab)) ))
 
- #		meantab
 
- 	);
 
- }
 
- trace_grain <- function(grain, color, style)
 
- {
 
- #	points(handle_grain(grain)$size, handle_grain(grain)$gflops, col=color);
 
- 	pouet <- handle_grain_mean(grain);
 
- 	pouetgflops <- pouet$gflops;
 
- 	pouetsize <- pouet$size;
 
- 	lines(pouetsize, pouetgflops, col=color, legend.text=TRUE, type = "o", pch = style, lwd=2);
 
- 	pouet <- handle_grain_mean_nm(grain);
 
- 	pouetgflops <- pouet$gflops;
 
- 	pouetsize <- pouet$size;
 
- 	lines(pouetsize, pouetgflops, col=color, legend.text=TRUE, type = "o", pch = style, lwd=1);
 
- }
 
- display_grain <- function()
 
- {
 
- 	xlist <- range(sizelist);
 
- 	ylist <- range(c(0,100));
 
- 	plot.new();
 
- 	plot.window(xlist, ylist, log="");
 
- 	i <- 0;
 
- 	colarray <- c("magenta", "blue", "peru", "green3", "navy", "red", "green2", "black", "orange");
 
- 	for (grain in grainlist)
 
- 	{
 
- 		trace_grain(grain, colarray[i+1], -1);
 
- 		i <- i + 1;
 
- 	}
 
- 	#axis(1, at=seq(0, max*1024, 1024), log="x")
 
- 	axis(1)
 
- 	axis(2, at=seq(0, 100, 10), tck=1)
 
- #	axis(4, at=seq(0, 100, 10))
 
- 	box(bty="u")
 
- 	labels <- c("256", "256 no model", "512", "512 no model", "1024", "1024 no model");
 
- 	legend("bottomright", inset=.05, title="Tile size", labels, lwd=2, lty=c(1, 1, 1, 1, 1, 1), pch=-1, col=c("magenta", "magenta", "blue", "blue", "peru", "peru"), bty="y", bg="white")
 
- 	mtext("matrix size", side=1, line=2, cex=1.6)
 
- 	mtext("GFlops", side=2, line=2, las=0, cex=1.6)
 
- 	title("Effect of granularity on the impact of scheduling");
 
- }
 
- display_grain()
 
- # boxplot(result, col=c("yellow", "red", "green"), xlab=sizelist);
 
- # plot(c(sizelist,sizelist,sizelist), c(result_greedy, result_prio, result_dm));
 
- # plot(sizelist, result_dm);
 
- # plot.new()
 
- # plot.window(range(c(sizelist,0) ), c(0, 6))
 
 
  |