Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr-ressources
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Learning Lab
mooc-rr-ressources
Commits
bef31968
Commit
bef31968
authored
Jul 20, 2018
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let's rely on pyton rather than perl
parent
1d0a618a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
30 deletions
+31
-30
article.org
module2/ressources/replicable_article/article.org
+31
-30
No files found.
module2/ressources/replicable_article/article.org
View file @
bef31968
...
@@ -97,37 +97,38 @@ echo 'file:measurements.txt'
...
@@ -97,37 +97,38 @@ echo 'file:measurements.txt'
* Extracting traces from data files :noexport:
* Extracting traces from data files :noexport:
#+begin_src perl :results output raw :exports both :var input="measurements.txt" output="data.csv"
#+begin_src python :results output raw :exports both :var input="measurements.txt" output="data.csv"
use strict;
import re,sys
open INPUT, $input;
open OUTPUT, "> $output";
INPUT = open(input, "r")
OUTPUT = open(output, "w")
my($line);
my($size);
OUTPUT.writelines("Size, Seq, Par, Libc\n")
my($seq,$par,$libc);
for line in INPUT.readlines():
print OUTPUT "Size, Seq, Par, Libc\n" ;
m = re.match('^Size: ([\d\.]*)$',line)
while($line=<INPUT>) {
if(m):
chomp $line;
size = m.group(1)
if($line =~/^Size: ([\d\.]*)$/) {
continue
$size = $1;
m = re.match('^Sequential quicksort.*: ([\d\.]*) sec.$',line)
next;
if(m):
}
seq = m.group(1)
if($line =~/^Sequential quicksort.*: ([\d\.]*) sec.$/) {
continue
$seq=$1; next;
m = re.match('^Parallel quicksort.*: ([\d\.]*) sec.$',line)
}
if(m):
if($line =~/^Parallel quicksort.*: ([\d\.]*) sec.$/) {
par = m.group(1)
$par=$1; next;
continue
}
m = re.match('^Built-in quicksort.*: ([\d\.]*) sec.$',line)
if($line =~/^Built-in quicksort.*: ([\d\.]*) sec.$/) {
if(m):
$libc=$1;
libc = m.group(1)
print OUTPUT "$size, $seq, $par, $libc\n";
OUTPUT.writelines(size+", "+seq+", "+par+", "+libc+"\n")
next;
}
print "[[file:"+output+"]]"
}
print "file:$output"
#+end_src
#+end_src
#+RESULTS:
[[file:data.csv]]
* R functions :noexport:
* R functions :noexport:
Initialization and reading of the data.
Initialization and reading of the data.
#+begin_src R :results output :session *R* :exports both
#+begin_src R :results output :session *R* :exports both
...
@@ -248,7 +249,7 @@ our own experimental testbed with support of our university.
...
@@ -248,7 +249,7 @@ our own experimental testbed with support of our university.
# Local Variables:
# Local Variables:
# eval: (add-to-list 'load-path ".")
# eval: (add-to-list 'load-path ".")
# eval: (require 'org-install)
# eval: (require 'org-install)
# eval: (org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (R . t)
(perl . t)
(python . t) ))
# eval: (org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (R . t) (python . t) ))
# eval: (setq org-confirm-babel-evaluate nil)
# eval: (setq org-confirm-babel-evaluate nil)
# eval: (unless (boundp 'org-latex-classes) (setq org-latex-classes nil))
# eval: (unless (boundp 'org-latex-classes) (setq org-latex-classes nil))
# eval: (add-to-list 'org-latex-classes '("IEEEtran"
# eval: (add-to-list 'org-latex-classes '("IEEEtran"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment