Skip to content

Commit

Permalink
Change nCPUs to ncpus
Browse files Browse the repository at this point in the history
This commit changes all references to `nCPUs` in the smarts/testManager.py and
in all tests from `nCPUs` to `ncpus`.
  • Loading branch information
MiCurry committed Jun 1, 2020
1 parent 0a3c23d commit be753c2
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions smarts/testManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def list_test(self, tests, **kwargs):
description = getattr(testMod, 'test_description')
else:
description = None
if hasattr(testMod, 'nCPUs'):
ncpus = getattr(testMod, 'nCPUs')
if hasattr(testMod, 'ncpus'):
ncpus = getattr(testMod, 'ncpus')
else:
ncpus = None
if hasattr(testMod, 'dependencies'):
Expand Down Expand Up @@ -375,10 +375,10 @@ def run_tests(self, tests, *args, **kwargs):
tests.append(dependent)

# Check to see if this test does not require more resources then whats available
if test.test.nCPUs > avaliable_cpus:
if test.test.ncpus > avaliable_cpus:
print("ERROR: The test '", test.test.test_name, " requires more cpus the available!", sep='')
print("ERROR: The machine: '", self.env.name, "' has ", avaliable_cpus, " cpus available", sep='')
print("ERROR: And '", test.test.test_name, "' requested: ", test.test.nCPUs, sep='')
print("ERROR: And '", test.test.test_name, "' requested: ", test.test.ncpus, sep='')
sys.exit(-1)

# If tests pass all the checks above, then set its status to SCHEDULED
Expand All @@ -387,10 +387,10 @@ def run_tests(self, tests, *args, **kwargs):

""" Check to see if this test does not require more resources then whats available """
for test in loaded_tests:
if test.test.nCPUs > avaliable_cpus:
if test.test.ncpus > avaliable_cpus:
print("ERROR: The test '", test.test.test_name, " requires more cpus the available!", sep='')
print("ERROR: The machine: '", self.env.name, "' has ", avaliable_cpus, " cpus available", sep='')
print("ERROR: And '", test.test.test_name, "' requested: ", test.test.nCPUs, sep='')
print("ERROR: And '", test.test.test_name, "' requested: ", test.test.ncpus, sep='')
sys.exit(-1)


Expand Down Expand Up @@ -419,10 +419,10 @@ def run_tests(self, tests, *args, **kwargs):
then start it """
for test in loaded_tests:
# If we have enought resources
if (test.test.nCPUs <= avaliable_cpus and test.isScheduled()):
if (test.test.ncpus <= avaliable_cpus and test.isScheduled()):
# Check dependencies
if all(self._get_depends_status(test, loaded_tests)):
avaliable_cpus -= test.test.nCPUs
avaliable_cpus -= test.test.ncpus
print("SMARTS: Launching:", test.test.test_name)
test.start() # TODO: Try Accept here ??
test.status = RUNNING
Expand All @@ -434,7 +434,7 @@ def run_tests(self, tests, *args, **kwargs):
if test.isFinished():
test.join(.01)
test.status = JOINED
avaliable_cpus += test.test.nCPUs
avaliable_cpus += test.test.ncpus
print("SMARTS: Joining with:", test.test.test_name, "Result:", test.result.result)

if test.result.result is None:
Expand Down
Empty file removed tests/compile_mpas_gnu/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion tests/example_test/example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class example_test:
test_name = "Example Test"
test_description = "Create a Hello World program in C and Fortran and try to compile it"
nCPUs = 1
ncpus = 1
test_dependencies = None

""" This test will load a GNU modset, create a Hello World C and Fortram program and
Expand Down
2 changes: 1 addition & 1 deletion tests/gnu_check/gnu_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class gnu_check:
test_name = "GNU Compiler Check"
test_description = "Check to see if there is a GNU compiler is on the machine and able to be" \
" found by SMARTs"
nCPUs = 1
ncpus = 1

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):
# Load GNU Compilers
Expand Down
2 changes: 1 addition & 1 deletion tests/intel_check/intel_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class intel_check:
test_name = "Intel Compiler Check"
test_description = "Check to see if there is a Intel compiler is on the machine and able to be" \
" found by SMARTs"
nCPUs = 1
ncpus = 1

def run(self, env, result, src_dir, test_dir, hpc, *args, **kwargs):
# Load INTEL Compilers
Expand Down
2 changes: 1 addition & 1 deletion tests/mpas_atm_gnu_compile/mpas_atm_gnu_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class mpas_atm_gnu_compile:
test_name = "MPAS Atmosphere GNU Compile"
test_description = "Compile MPAS Atmosphere with GNU (If possible)"
dependencies = ['gnu_check', 'mpas_gnu_libs_check']
nCPUs = 4
ncpus = 4

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/mpas_atm_intel_compile/mpas_atm_intel_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class mpas_atm_intel_compile:
test_name = "MPAS Atmosphere Intel Compile"
test_description = "Compile MPAS Atmosphere with Intel (If possible)"
dependencies = ['intel_check', 'mpas_intel_libs_check']
nCPUs = 4
ncpus = 4

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/mpas_gnu_libs_check/mpas_gnu_libs_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class mpas_gnu_libs_check:
test_description = "Check to see if we can access/user the MPAS IO libs by compiling simple"\
"programs"
dependencies = ['gnu_check']
nCPUs = 1
ncpus = 1

def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs):

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/mpas_intel_libs_check/mpas_intel_libs_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class mpas_intel_libs_check:
test_description = "Check to see if we can access/user the MPAS IO libs by compiling simple"\
"programs with Intel"
dependencies = ['intel_check']
nCPUs = 1
ncpus = 1

def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/mpas_pgi_libs_check/mpas_pgi_libs_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class mpas_pgi_libs_check:
test_description = "Check to see if we can access/user the MPAS IO libs by compiling simple"\
"programs with PGI"
dependencies = ['pgi_check']
nCPUs = 1
ncpus = 1

def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/pbs_test/pbs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class pbs_test:
test_name = "Test HPC.launch_job - PBS"
test_description = "Launch a PBS job via HPC.launch_job"
nCPUs = 1
ncpus = 1
test_dependencies = None

def run(self, env, result, srcDir, testDir, hpc):
Expand Down
2 changes: 1 addition & 1 deletion tests/pbs_test_script/pbs_test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class pbs_test_script:
test_name = "Launch Script Test - PBS"
test_description = "PBS Test Script - Submit a PBS job via HPC.launch_script"
nCPUs = 1
ncpus = 1
test_dependencies = None

def run(self, env, result, srcDir, testDir, hpc):
Expand Down
2 changes: 1 addition & 1 deletion tests/pgi_check/pgi_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class pgi_check:
test_name = "PGI Compiler Check"
test_description = "Check to see if there is a PGI compiler is on the machine and able to be" \
" found by SMARTs"
nCPUs = 1
ncpus = 1

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/smiol_gnu/smiol_gnu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class smiol_gnu:
test_name = "SMIOL GNU Test"
test_description = "See if SMIOL runs successfully with GNU"
nCPUs = 1
ncpus = 1

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/smiol_intel/smiol_intel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class smiol_intel:
test_name = "SMIOL Intel Test"
test_description = "Compiler and run SMIOL with Intel"
nCPUs = 1
ncpus = 1

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):

Expand Down
2 changes: 1 addition & 1 deletion tests/smiol_pgi/smiol_pgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class smiol_pgi:
test_name = "SMIOL PGI Test"
test_description = "See if SMIOL runs successfully with PGI"
nCPUs = 1
ncpus = 1

def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs):

Expand Down

0 comments on commit be753c2

Please sign in to comment.