tadd exclusive parameter to run function - sphere - GPU-based 3D discrete eleme… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 4c75e1c617dcd38cbe85ca9a70ccb07d0328ed35 | |
parent 639dd1b8bbce46456fd562c2a21def4e19092f87 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 28 Jul 2014 10:23:01 +0200 | |
add exclusive parameter to run function | |
Diffstat: | |
M python/sphere.py | 10 ++++++++-- | |
1 file changed, 8 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -3063,7 +3063,7 @@ class sim: | |
return numpy.array(porosity), numpy.array(depth) | |
def run(self, verbose=True, hideinputfile=False, dry=False, valgrind=False, | |
- cudamemcheck=False): | |
+ cudamemcheck=False, exclusive_mode=False): | |
''' | |
Start ``sphere`` calculations on the ``sim`` object | |
t@@ -3082,6 +3082,8 @@ class sim: | |
check for device memory leaks and errors. This causes a significant | |
increase in computational time. | |
:type cudamemcheck: bool | |
+ :param exclusive_mode: The system GPUs are running in exclusive mode. | |
+ :type exclusive_mode: bool | |
''' | |
self.writebin(verbose=False) | |
t@@ -3090,6 +3092,7 @@ class sim: | |
stdout = "" | |
dryarg = "" | |
fluidarg = "" | |
+ exclusivearg = "" | |
valgrindbin = "" | |
cudamemchk = "" | |
binary = "sphere" | |
t@@ -3105,9 +3108,12 @@ class sim: | |
cudamemchk = "cuda-memcheck --leak-check full " | |
if (self.fluid == True): | |
fluidarg = "--fluid " | |
+ if (exclusive_mode == True): | |
+ exclusivearg = "--exclusive " | |
cmd = "cd ..; " + valgrindbin + cudamemchk + "./" + binary + " " \ | |
- + quiet + dryarg + fluidarg + "input/" + self.sid + ".bin " + … | |
+ + quiet + dryarg + fluidarg + exclusivearg + \ | |
+ "input/" + self.sid + ".bin " + stdout | |
#print(cmd) | |
status = subprocess.call(cmd, shell=True) | |