Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision 30e32b2b00dfeda222cacf523a031087c59f8fe0)
+++ Jenkinsfile	(revision 3898392b5d2efa001a4fbf7190b44348f3a7c869)
@@ -1,3 +1,5 @@
 #!groovy
+
+import groovy.transform.Field
 
 //===========================================================================================================
@@ -22,6 +24,4 @@
 		wrap([$class: 'TimestamperBuildWrapper']) {
 
-			notify_server(0)
-
 			Settings = prepare_build()
 
@@ -34,6 +34,4 @@
 				checkout()
 
-				notify_server(0)
-
 				build()
 
@@ -50,6 +48,4 @@
 			BuildDir  = pwd tmp: true
 			SrcDir    = pwd tmp: false
-
-			notify_server(45)
 		}
 	}
@@ -72,7 +68,5 @@
 	finally {
 		//Send email with final results if this is not a full build
-		if( Settings && !Settings.Silent ) {
-			email(log_needed, Settings.IsSandbox)
-		}
+		email(log_needed)
 
 		echo 'Build Completed'
@@ -116,5 +110,5 @@
 			//Also specify the compiler by hand
 			targets=""
-			if( Settings.RunAllTests ) {
+			if( Settings.RunAllTests || Settings.RunBenchmark ) {
 				targets="--with-target-hosts='host:debug,host:nodebug'"
 			} else {
@@ -153,5 +147,5 @@
 		dir (BuildDir) {
 			//Append bench results
-			sh "${SrcDir}/benchmark/jenkins.sh ${Settings.GitNewRef} ${Settings.Architecture} ${BuildDir}/bench.json"
+			sh "make --no-print-directory -C benchmark jenkins"
 		}
 	}
@@ -177,7 +171,17 @@
 
 		if( !Settings.Publish ) return
+		if( !Settings.RunBenchmark ) {
+			echo 'No results to publish!!!'
+			return
+		}
+
+		def groupCompile = new PlotGroup('Compilation', 'seconds', true)
+		def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false)
 
 		//Then publish the results
-		sh 'curl --silent --show-error -H \'Content-Type: application/json\' --data @${BuildDir}/bench.json https://cforall.uwaterloo.ca:8082/jenkins/publish > /dev/null || true'
+		do_plot('compile'  , groupCompile    , 'Compilation')
+		do_plot('ctxswitch', groupConcurrency, 'Context Switching')
+		do_plot('mutex'    , groupConcurrency, 'Mutual Exclusion')
+		do_plot('signal'   , groupConcurrency, 'Internal and External Scheduling')
 	}
 }
@@ -196,23 +200,31 @@
 
 	return """
+<pre>
 The branch ${env.BRANCH_NAME} has been updated.
 ${gitUpdate}
-
-Check console output at ${env.BUILD_URL} to view the results.
-
-- Status --------------------------------------------------------------
-
-BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}
-
-- Log -----------------------------------------------------------------
+</pre>
+
+<p>Check console output at ${env.BUILD_URL} to view the results.</p>
+
+<p>- Status --------------------------------------------------------------</p>
+
+<p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>
+
+<p>- Log -----------------------------------------------------------------</p>
+
+<pre>
 ${gitLog}
------------------------------------------------------------------------
+</pre>
+
+<p>-----------------------------------------------------------------------</p>
+<pre>
 Summary of changes:
 ${gitDiff}
+</pre>
 """
 }
 
 //Standard build email notification
-def email(boolean log, boolean bIsSandbox) {
+def email(boolean log) {
 	//Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
 	//Configurations for email format
@@ -221,12 +233,12 @@
 	def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
 	def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
-	def email_body = """This is an automated email from the Jenkins build machine. It was
+	def email_body = """<p>This is an automated email from the Jenkins build machine. It was
 generated because of a git hooks/post-receive script following
-a ref change which was pushed to the Cforall repository.
+a ref change which was pushed to the C∀ repository.</p>
 """ + GitLogMessage()
 
-	def email_to = "cforall@lists.uwaterloo.ca"
-
-	if( Settings && !Settings.IsSandbox ) {
+	def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
+
+	if( Settings && !Settings.Silent ) {
 		//send email notification
 		emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
@@ -311,4 +323,5 @@
 		}
 
+		this.IsSandbox          = (branch == "jenkins-sandbox")
 		this.RunAllTests        = param.RunAllTests
 		this.RunBenchmark       = param.RunBenchmark
@@ -316,5 +329,4 @@
 		this.Publish            = param.Publish
 		this.Silent             = param.Silent
-		this.IsSandbox          = (branch == "jenkins-sandbox")
 
 		def full = param.RunAllTests ? " (Full)" : ""
@@ -333,4 +345,16 @@
 		this.GitNewRef = ''
 		this.GitOldRef = ''
+	}
+}
+
+class PlotGroup implements Serializable {
+	public String name
+	public String unit
+	public boolean log
+
+	PlotGroup(String name, String unit, boolean log) {
+		this.name = name
+		this.unit = unit
+		this.log = log
 	}
 }
@@ -398,9 +422,4 @@
 }
 
-def notify_server(int wait) {
-	sh """curl --silent --show-error --data "wait=${wait}" -X POST https://cforall.uwaterloo.ca:8082/jenkins/notify > /dev/null || true"""
-	return
-}
-
 def make_doc() {
 	def err = null
@@ -417,2 +436,27 @@
 	}
 }
+
+def do_plot(String file, PlotGroup group, String title) {
+	echo "file is ${BuildDir}/benchmark/${file}.csv, group ${group}, title ${title}"
+	dir("${BuildDir}/benchmark/") {
+		plot csvFileName: "cforall-${env.BRANCH_NAME}-${file}.csv",
+			csvSeries: [[
+				file: "${file}.csv",
+				exclusionValues: '',
+				displayTableFlag: false,
+				inclusionFlag: 'OFF',
+				url: ''
+			]],
+			group: "${group.name}",
+			title: "${title}",
+			style: 'lineSimple',
+			exclZero: false,
+			keepRecords: false,
+			logarithmic: group.log,
+			numBuilds: '120',
+			useDescr: true,
+			yaxis: group.unit,
+			yaxisMaximum: '',
+			yaxisMinimum: ''
+	}
+}
