Skip to content

Commit

Permalink
Smarter input/outputfile zipping, depends now on whether the middlewa…
Browse files Browse the repository at this point in the history
…re has that feature in it's option
  • Loading branch information
Markus Binsteiner committed Nov 7, 2013
1 parent 36d0129 commit a3a4d24
Show file tree
Hide file tree
Showing 5 changed files with 358 additions and 299 deletions.
35 changes: 31 additions & 4 deletions grisu-client/src/main/java/grisu/frontend/model/job/GrisuJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
import grisu.jcommons.constants.JobSubmissionProperty;
import grisu.model.FileManager;
import grisu.model.GrisuRegistryManager;
import grisu.model.UserEnvironmentManager;
import grisu.model.dto.DtoJob;
import grisu.model.dto.GridFile;
import grisu.model.info.ResourceInformation;
import grisu.model.info.dto.*;
import grisu.model.info.dto.Queue;
import grisu.model.job.JobCreatedProperty;
import grisu.model.job.JobDescription;
import grisu.model.status.StatusObject;
Expand Down Expand Up @@ -171,8 +175,8 @@ public File downloadOutput(String path, int retries, int secondsInbetweenRetries

private String description = null;

private boolean compressInputFiles = ClientPropertiesManager.isCompressInputFiles();
private boolean compressOutputFiles = ClientPropertiesManager.isCompressOutputFiles();
private Boolean compressInputFiles = null;
private Boolean compressOutputFiles = null;

public void setCompressInputFiles(boolean compress_input_files) {
this.compressInputFiles = compress_input_files;
Expand Down Expand Up @@ -449,7 +453,7 @@ public int compareTo(GrisuJob o2) {
* means the backend will not change the jobname you specified -- if there
* is a job with that jobname already the backend will throw an exception).
* <p/>
* Also, this method uses teh "none" group ({@link Constants.NON_VO_FQAN})
* Also, this method uses the "none" group ({@link Constants.NON_VO_FQAN})
* <p/>
* Be aware, that once that is done, you can't change any of the basic job
* parameters anymore. The backend calculates all the (possibly) missing job
Expand Down Expand Up @@ -515,7 +519,30 @@ public final String createJob(final String fqan)
public final String createJob(final String fqan,
final String jobnameCreationMethod) throws JobPropertiesException {

// if we use the compress option, we need to add the uncompressing of the input files to the prolog
// checking whether to compress in/outputfiles
String subLoc = getSubmissionLocation();
if ( StringUtils.isBlank(subLoc)) {
compressInputFiles = false;
compressOutputFiles = false;
} else {
ResourceInformation ri = GrisuRegistryManager.getDefault(serviceInterface).getResourceInformation();
boolean subLocSupportsPrologEpilog = ri.submissionLocationSupportsPrologEpilog(subLoc);

if ( ! subLocSupportsPrologEpilog ) {
compressInputFiles = false;
compressOutputFiles = false;
} else {
if ( compressInputFiles == null ) {
compressInputFiles = ClientPropertiesManager.isCompressInputFiles();
}
if ( compressOutputFiles == null ) {
compressOutputFiles = ClientPropertiesManager.isCompressOutputFiles();
}
}

}

// if we use the compress option, we need to add the uncompressing of the input files to the prolog
if (compressInputFiles) {

String existingProlog = getEnvironmentVariables().get("PROLOG");
Expand Down
2 changes: 1 addition & 1 deletion grisu-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,6 @@

<properties>
<jgrith.version>1.0.3</jgrith.version>
<grid-jcommons.version>2.11</grid-jcommons.version>
<grid-jcommons.version>2.12-SNAPSHOT</grid-jcommons.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
/**
* Classes that implement this interface provide general information about the
* grid.
*
*
* @author markus
*
*
*/
public interface ResourceInformation {

/**
* Convenience method to get a list of sites out of a set of
* submissionlocations.
*
*
* @param submissionLocations
* the submissionLocations
* @return the sites
Expand All @@ -30,7 +30,7 @@ Set<String> distillSitesFromSubmissionLocations(
/**
* Convenience method to filter all submissionlocations out of a list of
* submissionlocations that are located at the specified site.
*
*
* @param site
* the site
* @param submissionlocations
Expand All @@ -42,14 +42,14 @@ Set<String> filterSubmissionLocationsForSite(String site,

/**
* A list of all applications that are available grid-wide.
*
*
* @return all application packages
*/
Application[] getAllApplications();

/**
* A list of all applications that are available for a particular vo.
*
*
* @param fqan
* the vo
* @return the applications
Expand All @@ -59,7 +59,7 @@ Set<String> filterSubmissionLocationsForSite(String site,
/**
* Returns a list of all sites a user that is member of the specified fqan
* can access.
*
*
* @param fqan
* the fqan
* @return the list of sites
Expand All @@ -68,7 +68,7 @@ Set<String> filterSubmissionLocationsForSite(String site,

/**
* All the submissionLocations the user has got access to with this fqan.
*
*
* @param fqan
* the fqan
* @return all submissionLocations
Expand All @@ -77,15 +77,22 @@ Set<String> filterSubmissionLocationsForSite(String site,

/**
* Returns a list of all available submission locations, regardless of VO.
*
*
* @return all submission locations
*/
Queue[] getAllSubmissionLocations();

/**
* Returns the {@link Queue} object for the specified submissionlocation string.
*
* @param subLoc the submission location string
* @return the Queue object
*/
Queue getSubmissionLocation(String subLoc);

/**
* Calculates the best staging filesystem for this submissionLocation.
*
*
* @param subLoc
* the submissionLocation
* @return the staging filesystem
Expand All @@ -95,7 +102,7 @@ Set<String> filterSubmissionLocationsForSite(String site,
/**
* Returns the name of the site the specified submission location or ulr
* belongs to.
*
*
* @param urlOrSubmissionLocation
* the submission location or url
* @return the name of the site
Expand All @@ -105,11 +112,19 @@ Set<String> filterSubmissionLocationsForSite(String site,
/**
* A list of all available staging filesystems for this submissionlocation.
* In order of relevance.
*
*
* @param subLoc
* the submissionLocation
* @return the staging filesystems
*/
List<String> getStagingFilesystemsForSubmissionLocation(String subLoc);

/**
* Returns whether the specified submission location has the middleware configured in a way that a job can extract input/output files.
*
* @param subLoc
* @return
*/
boolean submissionLocationSupportsPrologEpilog(String subLoc);

}
Loading

0 comments on commit a3a4d24

Please sign in to comment.