From 00ed0f0f6119f6745f5b50bf654a472001e9965c Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Wed, 27 Jul 2011 17:33:48 -0700
Subject: [PATCH] Add huge page support for srun2aprun wrapper

---
 contribs/cray/srun.pl | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/contribs/cray/srun.pl b/contribs/cray/srun.pl
index 985d248069c..9bf61f4d217 100755
--- a/contribs/cray/srun.pl
+++ b/contribs/cray/srun.pl
@@ -344,6 +344,17 @@ my %node_opts;
 my $command;
 
 if ($have_job == 0) {
+	for ($memory_per_cpu) {
+		$i = index($memory_per_cpu, "hs");
+		if ($i >= 0) {
+			$memory_per_cpu = substr($memory_per_cpu, 0, $i);
+		}
+		$i = index($memory_per_cpu, "h");
+		if ($i >= 0) {
+			$memory_per_cpu = substr($memory_per_cpu, 0, $i);
+		}
+	}
+
 	$command = "$salloc";
 	$command .= " --account=$account"		if $account;
 	$command .= " --acctg-freq=$acctg_freq"		if $acctg_freq;
@@ -848,10 +859,11 @@ Applies only when creating a job allocation.
 Specify the real memory required per node in MegaBytes.
 Applies only when creating a job allocation.
 
-=item B<--mem-per-cpu=MB>
+=item B<--mem-per-cpu=MB>[h|hs]
 
 Specify the real memory required per CPU in MegaBytes.
 Applies only when creating a job allocation.
+Append "h" or "hs" for huge page support.
 
 =item B<--mem_bind=type>
 
-- 
GitLab