Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_sys_tests doesn't run under Python-3 and ncar_pylib #692

Closed
ekluzek opened this issue Apr 24, 2019 · 3 comments · Fixed by #696
Closed

run_sys_tests doesn't run under Python-3 and ncar_pylib #692

ekluzek opened this issue Apr 24, 2019 · 3 comments · Fixed by #696
Assignees
Labels
bug something is working incorrectly priority: low Background task that doesn't need to be done right away.

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Apr 24, 2019

Brief summary of bug

run_sys_tests fails when running with python-3 and the ncar_pylib environment.

General bug information

CTSM version you are using: ctsm1.0.dev035-7-g0b2970e (will be ctsm1.0.dev036)
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected: run_sys_tests on cheyenne with python3 and ncar_pylib

Details of bug

It fails in the use of subprocess which is a python module for PBS qsub. It seems to work fine with either python-2.7 or python-3.6 on their own, as well as python-2.7 with ncar_pylib, but fails when you combine python-3.6 with ncar_pylib.

Important details of your setup / configuration so we can reproduce the bug

you have to both load python/3 AND run the ncar python environment...

Currently Loaded Modules Matching: python

  1. python/3.6.8

[(NPL) ] erik/ctsm_cisofix> which ncar_pylib
ncar_pylib: aliased to source /gpfs/u/apps/ch/opt/python/3.6.8/gnu/7.3.0/bin/ncar_pylib.csh

Important output or errors that show the problem

[(NPL) ] erik/ctsm_cisofix> ./run_sys_tests -s clm_short --skip-compare --skip-generate
Testroot: /glade/scratch/erik/tests_0424-103123ch

Current hash: 0b2970e Change ciso test so that you don't have to exclude all the carbon isotope fields

cisofix...ekluzek/cisofix

?? cases/
?? run_sys_test.log

manage_externals status:
Processing externals description file : Externals.cfg
Processing externals description file : Externals_CLM.cfg
Processing externals description file : Externals_CISM.cfg
Checking status of externals: clm, fates, ptclm, cism, source_cism, rtm, mosart, cime,
./cime
clean sandbox, on ctsm/ctsm1.0/cime5.7.9/n03
./components/cism
clean sandbox, on release-cesm2.0.04
./components/cism/source_cism
clean sandbox, on release-cism2.1.03
./components/mosart
clean sandbox, on release-cesm2.0.00
./components/rtm
clean sandbox, on release-cesm2.0.00
./src/fates
clean sandbox, on fates_s1.8.1_a3.0.0_rev2
./tools/PTCLM
clean sandbox, on PTCLM2_180611

Traceback (most recent call last):
File "./run_sys_tests", line 22, in
main(cime_path=cime_path)
File "/gpfs/fs1/work/erik/ctsm_cisofix/python/ctsm/run_sys_tests.py", line 72, in main
extra_create_test_args=args.extra_create_test_args)
File "/gpfs/fs1/work/erik/ctsm_cisofix/python/ctsm/run_sys_tests.py", line 151, in run_sys_tests
dry_run=dry_run)
File "/gpfs/fs1/work/erik/ctsm_cisofix/python/ctsm/run_sys_tests.py", line 464, in _run_test_suite
dry_run=dry_run)
File "/gpfs/fs1/work/erik/ctsm_cisofix/python/ctsm/run_sys_tests.py", line 490, in _run_create_test
dry_run=dry_run)
File "/gpfs/fs1/work/erik/ctsm_cisofix/python/ctsm/joblauncher/job_launcher_base.py", line 89, in run_command
self.run_command_impl(command, stdout_path, stderr_path)
File "/gpfs/fs1/work/erik/ctsm_cisofix/python/ctsm/joblauncher/job_launcher_qsub.py", line 29, in run_command_impl
(out, err) = qsub_process.communicate(' '.join(command))
File "/glade/u/apps/ch/opt/python/3.6.8/gnu/7.3.0/lib/python3.6/subprocess.py", line 863, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/glade/u/apps/ch/opt/python/3.6.8/gnu/7.3.0/lib/python3.6/subprocess.py", line 1519, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'

@ekluzek ekluzek added priority: low Background task that doesn't need to be done right away. bug something is working incorrectly labels Apr 24, 2019
@billsacks
Copy link
Member

I think we may need universal_newlines in the call to subprocess.Popen. I'll try that out.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Apr 24, 2019

Dick Valent of CISL consulting is looking into it. Here's the CISL ticket for it 287972.

billsacks added a commit to billsacks/ctsm that referenced this issue Apr 24, 2019
Without this, we run into the issue noted in
ESCOMP#692. This fixes the problem. I
don't fully understand the need for this, but from reading some stack
overflow posts, I'm not surprised that we need this.
billsacks added a commit to billsacks/ctsm that referenced this issue Apr 24, 2019
Without this, we run into the issue noted in
ESCOMP#692. This fixes the problem. I
don't fully understand the need for this, but from reading some stack
overflow posts, I'm not surprised that we need this.

Resolves ESCOMP#692
@billsacks
Copy link
Member

My sense is that this is a legitimate problem with run_sys_tests using recent python versions. See #696 for a fix. Please go ahead and merge that PR if you feel it fixes the problem.

@ekluzek ekluzek self-assigned this Apr 25, 2019
ekluzek added a commit to ekluzek/CTSM that referenced this issue Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is working incorrectly priority: low Background task that doesn't need to be done right away.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants