Index: ../trunk-jpl/src/c/solutions/issm.cpp
===================================================================
--- ../trunk-jpl/src/c/solutions/issm.cpp	(revision 13531)
+++ ../trunk-jpl/src/c/solutions/issm.cpp	(revision 13532)
@@ -34,9 +34,8 @@
 	char *rootpath       = NULL;
 
 	/*time*/
-	IssmPDouble   start, finish;
+	IssmPDouble   finish;
 	IssmPDouble   start_core, finish_core;
-	IssmPDouble   start_init, finish_init;
 	int      ierr;
 
 	/*profiling*/   
@@ -50,12 +49,8 @@
 	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
 	EnvironmentInit(argc,argv);
 	
-		#ifdef _HAVE_MPI_
-	MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime();
-	#else
-	start=(IssmPDouble)clock();
-	#endif
-
+	/*Some profiling: */
+	profiler=new Profiler(); profiler->Tag(Start);
 	
 	/*First process inputs*/
 	_pprintLine_("");
@@ -68,11 +63,8 @@
 	AnalysisConfiguration(&analyses,&numanalyses,solution_type);
 
 	/*Create femmodel, using input file: */
-	#ifdef _HAVE_MPI_
-	MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime();
-	#else
-	start_init=(IssmPDouble)clock();
-	#endif
+	profiler->Tag(StartInit);
+	
 	femmodel=new FemModel(rootpath,binfilename,outbinfilename,solution_type,analyses,numanalyses);
 	
 	/*get type of solution we are going to run: */
@@ -95,11 +87,8 @@
 	femmodel->parameters->FindParam(&profiling,DebugProfilingEnum); 
 	femmodel->parameters->FindParam(&autodiff,AutodiffIsautodiffEnum);
 
-	#ifdef _HAVE_MPI_
-	MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
-	#else
-	finish_init=(IssmPDouble)clock();
-	#endif
+	/*Profiling: */
+	profiler->Tag(FinishInit);
 	
 	/*If running AD, then initialize a placeholder with which to work: */
 	#ifdef _HAVE_ADOLC_
@@ -118,11 +107,7 @@
 	#endif
 
 	_pprintLine_("call computational core:");
-	#ifdef _HAVE_MPI_
-	MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
-	#else
-	start_core=(IssmPDouble)clock();
-	#endif
+	profiler->Tag(StartCore);
 	
 	if(profiling)ProfilingStart(&Time_start,&Flops_start);
 
@@ -161,12 +146,8 @@
 	}
 	#endif
 
+	profiler->Tag(FinishCore);
 
-	#ifdef _HAVE_MPI_
-	MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
-	#else
-	finish_core=(IssmPDouble)clock();
-	#endif
 	
 	_pprintLine_("write results to disk:");
 	OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
Index: ../trunk-jpl/src/c/solutions/EnvironmentInit.cpp
===================================================================
--- ../trunk-jpl/src/c/solutions/EnvironmentInit.cpp	(revision 13531)
+++ ../trunk-jpl/src/c/solutions/EnvironmentInit.cpp	(revision 13532)
@@ -1,7 +1,13 @@
 /*!\file:  EnvironmentInit.cpp
  * \brief: initialize Petsc, MPI, you name it
  */ 
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
 
+
 void EnvironmentInit(int argc,char** argv){
 
 	/*Initialize environments: Petsc, MPI, etc...: */
