Index: /issm/branches/trunk-larour-SLPS2022/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 27076)
+++ /issm/branches/trunk-larour-SLPS2022/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 27077)
@@ -20,4 +20,6 @@
 		int world_rank;
 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&world_rank);
+		void     (*solutionprecore)(FemModel*) = NULL;
+		int        solution_type;
 
 		/*Build an femmodel if you are a slave, using the corresponding communicator:*/
@@ -25,4 +27,9 @@
 			femmodel_init= new FemModel(argc,argv,evaluation_comm);
 			femmodel_init->profiler->Start(CORE);
+
+			/*Launch cores that build data only once, for all future solutions during the uncertainty quantification: */
+			femmodel_init->parameters->FindParam(&solution_type,SolutionTypeEnum);
+			WrapperPreCorePointerFromSolutionEnum(&solutionprecore,femmodel_init->parameters,solution_type);
+			if(solutionprecore)solutionprecore(femmodel_init);
 		}
 
@@ -55,5 +62,4 @@
 		bool       control_analysis         = false;
 		void     (*solutioncore)(FemModel*) = NULL;
-		void     (*solutionprecore)(FemModel*) = NULL;
 		bool       nodakotacore             = true;
 
@@ -94,8 +100,4 @@
 		/*Initialize responses: */
 		responses=xNewZeroInit<IssmDouble>(numFns);
-
-		/*Launch cores that are not used during the uncertainty quantification: */
-		WrapperPreCorePointerFromSolutionEnum(&solutionprecore,femmodel_init->parameters,solution_type);
-		if(solutionprecore)solutionprecore(femmodel_init);
 
 		/*Make a copy of femmodel, so we start this new evaluation run for this specific sample with a brand 
