From 292b28f183d7537c58d0013211760464477fbd6a Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 24 Nov 2015 15:31:34 -0500 Subject: [PATCH 1/1] 6309: Add runtime constraint keep_cache_mb_per_task --- doc/api/schema/Job.html.textile.liquid | 2 ++ sdk/cli/bin/crunch-job | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/api/schema/Job.html.textile.liquid b/doc/api/schema/Job.html.textile.liquid index dba0fe9418..8abd42250a 100644 --- a/doc/api/schema/Job.html.textile.liquid +++ b/doc/api/schema/Job.html.textile.liquid @@ -64,4 +64,6 @@ table(table table-bordered table-condensed). |min_ram_mb_per_node|integer|Require that each node assigned to this Job have the specified amount of real memory (in MiB)|✓| |min_scratch_mb_per_node|integer|Require that each node assigned to this Job have the specified amount of scratch storage available (in MiB)|✓| |max_tasks_per_node|integer|Maximum simultaneous tasks on a single node|✓| +|keep_cache_mb_per_task|integer|Size of file data buffer for per-task Keep directory ($TASK_KEEPMOUNT), in MiB. Default is 256 MiB. Increase this to reduce cache thrashing in situtations such as accessing multiple large (64+ MiB) files at the same time, or accessing different parts of a large file at the same time.|✓| +|min_ram_per_task|integer|Minimum real memory (KiB) per task|| |min_ram_per_task|integer|Minimum real memory (KiB) per task|| diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job index 5177434b25..2c3783ff0e 100755 --- a/sdk/cli/bin/crunch-job +++ b/sdk/cli/bin/crunch-job @@ -886,6 +886,11 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++) my $stdbuf = " stdbuf --output=0 --error=0 "; + my $arv_file_cache = "--file-cache=" . (256 * 1024 * 1024); + if (defined($Job->{'runtime_constraints'}->{'keep_cache_mb_per_task'})) { + $arv_file_cache = "--file-cache=" . ($Job->{'runtime_constraints'}->{'keep_cache_mb_per_task'} * 1024 * 1024); + } + my $command = "if [ -e $ENV{TASK_WORK} ]; then rm -rf $ENV{TASK_WORK}; fi; " ."mkdir -p $ENV{CRUNCH_TMP} $ENV{JOB_WORK} $ENV{TASK_WORK} $ENV{TASK_KEEPMOUNT} " @@ -896,7 +901,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++) .q{&& SWAP=$(awk '($1 == "SwapTotal:"){print $2}'