Index: issm/trunk-jpl/src/m/solve/solve.js
===================================================================
--- issm/trunk-jpl/src/m/solve/solve.js	(revision 19780)
+++ issm/trunk-jpl/src/m/solve/solve.js	(revision 19793)
@@ -107,67 +107,81 @@
 
 	//Write all input files
-	marshall(md);                                          // bin file
-	ToolkitsFile(md.toolkits,md.miscellaneous.name + '.toolkits'); // toolkits file
-	cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota); // queue file
+	fid = marshall(md);                                          // bin file
+	toolkitsstring= md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file
 
-	//Stop here if batch mode
-	if (options.getfieldvalue('batch','no') === 'yes'){
-		if (md.verbose.solution){
-			console.log('batch mode requested: not launching job interactively');
-			console.log('launch solution sequence on remote cluster by hand');
+	if (cluster.classname() != 'local'){ //{{{
+
+		throw Error('non local clusters not supported yet!');
+
+		cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota); // queue file
+
+		//Stop here if batch mode
+		if (options.getfieldvalue('batch','no') === 'yes'){
+			if (md.verbose.solution){
+				console.log('batch mode requested: not launching job interactively');
+				console.log('launch solution sequence on remote cluster by hand');
+			}
+			return;
 		}
-		return;
-	}
 
-	//Upload all required files
-	modelname = md.miscellaneous.name;
-	filelist  = [modelname + '.bin ',modelname + '.toolkits '];
-	if (ispc){
-		filelist.push(modelname + '.bat ');
-	}
-	else{
-		filelist.push(modelname + '.queue ');
-	}
+		//Upload all required files
+		modelname = md.miscellaneous.name;
+		filelist  = [modelname + '.bin ',modelname + '.toolkits '];
+		if (ispc){
+			filelist.push(modelname + '.bat ');
+		}
+		else{
+			filelist.push(modelname + '.queue ');
+		}
 
-	if (md.qmu.isdakota){
-		filelist.push(modelname + '.qmu.in');
-	}
+		if (md.qmu.isdakota){
+			filelist.push(modelname + '.qmu.in');
+		}
 
-	if (restart == ''){
-		cluster.UploadQueueJob(md.miscellaneous.name,md.private.runtimename,filelist);
-	}
+		if (restart == ''){
+			cluster.UploadQueueJob(md.miscellaneous.name,md.private.runtimename,filelist);
+		}
 
-	//launch queue job: 
-	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart);
+		//launch queue job: 
+		cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart);
 
-	//wait on lock
-	if (md.settings.waitonlock == 'NaN'){
-		//load when user enters 'y'
-		console.log('solution launched on remote cluster. log in to detect job completion.');
-		throw Error("solve error message: user detection of successfull completion of job not support yet!");
-		/*choice=input('Is the job successfully completed? (y/n)','s');
-		if ~strcmp(choice,'y'), 
-			console.log('Results not loaded... exiting'); 
-		else
-			md=loadresultsfromcluster(md);
-		end*/
-	}
-	else if (md.settings.waitonlock>0){
-		//we wait for the done file
-		done=waitonlock(md);
-		if (md.verbose.solution){
-			console.log('loading results from cluster');
+		//wait on lock
+		if (md.settings.waitonlock == 'NaN'){
+			//load when user enters 'y'
+			console.log('solution launched on remote cluster. log in to detect job completion.');
+			throw Error("solve error message: user detection of successfull completion of job not support yet!");
+			/*choice=input('Is the job successfully completed? (y/n)','s');
+			  if ~strcmp(choice,'y'), 
+			  console.log('Results not loaded... exiting'); 
+			  else
+			  md=loadresultsfromcluster(md);
+			  end*/
 		}
-		loadresultsfromcluster(md);
-	}
-	else if (md.settings.waitonlock==0){
-		 console.log('Model results must be loaded manually with md=loadresultsfromcluster(md);');
-	}
+		else if (md.settings.waitonlock>0){
+			//we wait for the done file
+			done=waitonlock(md);
+			if (md.verbose.solution){
+				console.log('loading results from cluster');
+			}
+			loadresultsfromcluster(md);
+		}
+		else if (md.settings.waitonlock==0){
+			console.log('Model results must be loaded manually with md=loadresultsfromcluster(md);');
+		}
 
-	//post processes qmu results if necessary
-	if (md.qmu.isdakota){
-		/*if ~strncmpi(options.getfieldvalue('keep','y'),'y',1)
-			system(['rm -rf qmu' num2str(feature('GetPid'))]);
-		end*/
+		//post processes qmu results if necessary
+		if (md.qmu.isdakota){
+			/*if ~strncmpi(options.getfieldvalue('keep','y'),'y',1)
+			  system(['rm -rf qmu' num2str(feature('GetPid'))]);
+			  end*/
+		}
+	} //}}}
+	else{ //if (cluster.classname() == 'local') 
+
+		/*We are running locally on the machine, using the issm module:*/
+		console.log('running issm locally');
+		
+		//Call issm:
+		issm(fid, toolkitsstring, solutionstring, md.miscellaneous.name);
 	}
 }
