@@ -85,6 +85,7 @@ |
int chunks; |
boolean custom = false; |
|
+ |
/** |
* Run the model. |
* |
@@ -136,6 +137,7 @@ |
run(file, outputDir, dataDir, workDir, delta, start_year, end_year, ages_files, geotiffs, multi_run, custom); |
} |
|
+ |
/** |
* run lamps. |
* |
@@ -364,7 +366,6 @@ |
|
LOG.info("===> Reading AOI"); |
|
- |
chunks = CSIP_Read_AND_SPLIT.URL_Read_Geometry_File_new(geomUrl, workspace, multi_run, LOG); |
|
LOG.info("slice file into " + chunks + " chunks"); |
@@ -380,8 +381,7 @@ |
|
final String fileName = fileName_pre; |
|
-// Services.runParallel(chunks, 1, new Services.CallableFactory() { |
- Services.runParallel(multi_run, new Services.CallableFactory() { |
+ Services.runParallel(chunks, new Services.CallableFactory() { |
|
@Override |
public Callable create(final int i) { |
@@ -454,6 +454,7 @@ |
LOG.info("===> Total LAMPS application time : " + difference + " s"); |
} |
|
+ |
@Override |
|
protected void postProcess() throws IOException { |
@@ -486,6 +487,7 @@ |
putResult(new File(getWorkspaceDir(), CSIP_Const.AOI_LAMPS_CONF_result), "output file5"); |
} |
|
+ |
public static <T> List<List<T>> chopIntoParts(final List<T> ls, final int iParts) { |
final List<List<T>> lsParts = new ArrayList<>(); |
final int iChunkSize = ls.size() / iParts; |
@@ -503,6 +505,7 @@ |
return lsParts; |
} |
|
+ |
/** |
* allow rewriting peer URL to avoid leaving AWS for example. |
* |
@@ -526,6 +529,7 @@ |
return b.build(); |
} |
|
+ |
private String[] stats(List<Long> list) { |
if (list.isEmpty()) { |
return new String[]{ |
@@ -555,6 +559,7 @@ |
}; |
} |
|
+ |
static void combineFiles(File out, int chunks) throws IOException { |
for (int i = 0; i < chunks; i++) { |
File of = new File(out.getParentFile(), out.getName() + "-" + i); |