diff --git a/src/org.eclipse.ice.item/src/org/eclipse/ice/item/action/JobLaunchAction.java b/src/org.eclipse.ice.item/src/org/eclipse/ice/item/action/JobLaunchAction.java index e472a4e64..fd5306dee 100644 --- a/src/org.eclipse.ice.item/src/org/eclipse/ice/item/action/JobLaunchAction.java +++ b/src/org.eclipse.ice.item/src/org/eclipse/ice/item/action/JobLaunchAction.java @@ -167,7 +167,19 @@ *

* * - * * + * + * + *

+ * projectSpaceDir + *

+ * + * + *

+ * The absolute path string of the ICE project directory. This can be found with + * IProject.getLocation().toOSString(). + *

+ * + * * * *

@@ -342,6 +354,12 @@ public class JobLaunchAction extends Action implements Runnable { */ private String username; + /** + * The absolute path of the IProject being used by this job launch. It can + * be retrieved with IProject.getLocation().toOSString(). + */ + private String projectSpaceDir; + /** * *

@@ -804,11 +822,12 @@ protected void launchLocally() { // Local Declarations FormStatus launchStatus; - String separator = System.getProperty("file.separator"); - String userHome = System.getProperty("user.home"); - String localProjectDir = userHome + separator + "ICEFiles" + separator - + "default"; - File workingDirectory = new File(execDictionary.get("workingDir")); + // String separator = System.getProperty("file.separator"); + // String userHome = System.getProperty("user.home"); + // String localProjectDir = userHome + separator + "ICEFiles" + + // separator + // + "default"; + // File workingDirectory = new File(execDictionary.get("workingDir")); // Loop over the stages and launch them so long as the status marks them // as processed. This needs to be done sequentially, so use a regular, @@ -1062,18 +1081,17 @@ protected void launchRemotely() { String homeDir = System.getProperty("user.home"); String localDirectoryPath = ""; - // Create a local directory where created files can be downloaded + // Create a local directory where created files can be downloaded // from the remote host - localDirectoryPath = homeDir + separator + "ICEFiles" + separator - + "default" + separator + "jobs" + separator + localDirectoryPath = projectSpaceDir + separator + "jobs" + separator + "remoteIceLaunch_" + shortDate.format(currentDate); localStorageDir = new File(localDirectoryPath); - + // Create the directory if it doesn't already exist if (!localStorageDir.exists()) { localStorageDir.mkdirs(); } - + // Place this in the action map so others can reference it later execDictionary.put("workingDir", localDirectoryPath); @@ -1524,8 +1542,7 @@ private void setWorkingDirectoryName() { // Set the name of the working directory properly if it is a local // launch if (isLocal.get()) { - launchDir = homeDir + separator + "ICEFiles" + separator - + "default" + separator + "jobs" + separator + launchDir = projectSpaceDir + separator + "jobs" + separator + workingDirectoryBaseName; } else if (execDictionary.get("hostname").equals("titan.ccs.ornl.gov")) { // Get the project directory @@ -1571,6 +1588,7 @@ public void run() { stdOutFileName = execDictionary.get("stdOutFileName"); stdErrFileName = execDictionary.get("stdErrFileName"); hostname = execDictionary.get("hostname"); + projectSpaceDir = execDictionary.get("projectSpaceDir"); uploadInput = Boolean.valueOf(execDictionary.get("uploadInput")); } diff --git a/src/org.eclipse.ice.item/src/org/eclipse/ice/item/jobLauncher/JobLauncher.java b/src/org.eclipse.ice.item/src/org/eclipse/ice/item/jobLauncher/JobLauncher.java index 7ca58b630..480fc20e8 100644 --- a/src/org.eclipse.ice.item/src/org/eclipse/ice/item/jobLauncher/JobLauncher.java +++ b/src/org.eclipse.ice.item/src/org/eclipse/ice/item/jobLauncher/JobLauncher.java @@ -606,6 +606,9 @@ private FormStatus fillActionDataMap() { Entry fileEntry = null, mpiEntry = null; int numProcs = 1, numTBBThreads = 1; + // Get the project space directory + String projectSpace = project.getLocation().toOSString(); + // Assign the data components fileData = (DataComponent) form.getComponent(JobLauncherForm.filesId); parallelData = (DataComponent) form @@ -704,6 +707,7 @@ private FormStatus fillActionDataMap() { actionDataMap.put("hostname", hostname); actionDataMap.put("os", os); actionDataMap.put("accountCode", accountCode); + actionDataMap.put("projectSpaceDir", projectSpace); // Add the number of processors to the action data dictionary. It will // always be at least 1. actionDataMap.put("numProcs", String.valueOf(numProcs)); diff --git a/tests/org.eclipse.ice.client.test/src/org/eclipse/ice/client/test/ItemProcessorTester.java b/tests/org.eclipse.ice.client.test/src/org/eclipse/ice/client/test/ItemProcessorTester.java index 5fb3bea6b..e387d972d 100644 --- a/tests/org.eclipse.ice.client.test/src/org/eclipse/ice/client/test/ItemProcessorTester.java +++ b/tests/org.eclipse.ice.client.test/src/org/eclipse/ice/client/test/ItemProcessorTester.java @@ -163,7 +163,7 @@ public void checkProcessing() { // Give the thread a little time to do its work try { - Thread.sleep(500); + Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); // Fail if an exception is caught @@ -205,7 +205,7 @@ public void checkProcessing() { // Give the thread a little time to do its work try { - Thread.sleep(500); + Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); // Fail if an exception is caught @@ -237,7 +237,7 @@ public void checkProcessing() { itemProcessor.cancelled(); // Give the thread a little time to do its work try { - Thread.sleep(500); + Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); // Fail if an exception is caught