Index: /issm/trunk/src/m/classes/@model/model.m
===================================================================
--- /issm/trunk/src/m/classes/@model/model.m	(revision 6217)
+++ /issm/trunk/src/m/classes/@model/model.m	(revision 6218)
@@ -232,4 +232,5 @@
 	md.element_debugid=NaN;
 	md.mem_debug=0;
+	md.gprof=0;
 	md.memoryleaks=NaN;
 
Index: /issm/trunk/src/m/classes/clusters/astrid.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/astrid.m	(revision 6217)
+++ /issm/trunk/src/m/classes/clusters/astrid.m	(revision 6218)
@@ -58,5 +58,10 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+		 function BuildQueueScript(cluster,md) %{{{1
+		 
+			 %retrieve parameters
+			 modelname=md.name;
+			 analysis_type=md.analysis_type;
+			 mem_debug=md.mem_debug;
 
 			 %open file for writing: 
@@ -70,4 +75,8 @@
 				 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
 				 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 end
+
+			 if md.gprof,
+				 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
 			 end
 
Index: /issm/trunk/src/m/model/solveparallel.m
===================================================================
--- /issm/trunk/src/m/model/solveparallel.m	(revision 6217)
+++ /issm/trunk/src/m/model/solveparallel.m	(revision 6218)
@@ -21,5 +21,5 @@
 
 %Now, we need to build the queuing script, used by the cluster to launch the job.
-cluster.BuildQueueScript(md.name,md.analysis_type,md.mem_debug);
+cluster.BuildQueueScript(md);
 
 %Now, launch the queueing script
