Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into jay/reflectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Jay Billings committed Jan 12, 2015
2 parents b753e3a + 960e18a commit 5ed1a43
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
Expand Up @@ -167,7 +167,19 @@
* </p>
* </td>
* </tr>
* *
* <tr>
* <td>
* <p>
* projectSpaceDir
* </p>
* </td>
* <td>
* <p>
* The absolute path string of the ICE project directory. This can be found with
* IProject.getLocation().toOSString().
* </p>
* </td>
* </tr>
* <tr>
* <td>
* <p>
Expand Down Expand Up @@ -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;

/**
* <!-- begin-UML-doc -->
* <p>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"));
}

Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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));
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ed1a43

Please sign in to comment.