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

PIO segfaults on melvin #387

Closed
jgfouca opened this issue Oct 23, 2015 · 14 comments
Closed

PIO segfaults on melvin #387

jgfouca opened this issue Oct 23, 2015 · 14 comments
Assignees

Comments

@jgfouca
Copy link
Member

jgfouca commented Oct 23, 2015

Test: ERS.f45_g37.B1850C5
Platform: gcc/5.1.0, openmpi/1.8.7, netcdf/4.3.2, pnetcdf/1.5.0, netcdf-fortran/4.4.1

Seg fault:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7F5D8FB1BB77
#0 0x7F38B6AA5B77
#1 0x7F38B6AA4D70
#2 0x35D703269F
#3 0x7F38B829B36C
#4 0x7F38B827C14E
#5 0x7F38B8273A70
#1 0x7F5D8FB1AD70
#2 0x35D703269F
#3 0x7F5D9131136C
#4 0x7F5D912F214E
#5 0x7F5D912E9A70
#6 0x12A213E in nfmpi_put_vara_int_all_
#6 0x12A213E in nfmpi_put_vara_int_all_
#7 0x11DFB98 in __pionfput_mod_MOD_put_vara_1d_int
#7 0x11DFB98 in __pionfput_mod_MOD_put_vara_1d_int
#8 0x11EEA50 in __pionfput_mod_MOD_put_var_1d_int
#8 0x11EEA50 in __pionfput_mod_MOD_put_var_1d_int
#9 0x11EEB2E in __pionfput_mod_MOD_put_var_vdesc_1d_int
#9 0x11EEB2E in __pionfput_mod_MOD_put_var_vdesc_1d_int
#10 0x4A288A in __cam_history_MOD_wshist
#10 0x4A288A in __cam_history_MOD_wshist
#11 0x4ABBDF in __cam_history_MOD_write_restart_history
#11 0x4ABBDF in __cam_history_MOD_write_restart_history
#12 0x4BCAD9 in __cam_restart_MOD_cam_write_restart
#12 0x4BCAD9 in __cam_restart_MOD_cam_write_restart
#13 0x48EA0F in __cam_comp_MOD_cam_run4
#13 0x48EA0F in __cam_comp_MOD_cam_run4
#14 0x488A1B in __atm_comp_mct_MOD_atm_run_mct
#14 0x488A1B in __atm_comp_mct_MOD_atm_run_mct
#15 0x428059 in __component_mod_MOD_component_run
#15 0x428059 in __component_mod_MOD_component_run
#16 0x41705A in __cesm_comp_mod_MOD_cesm_run
#16 0x41705A in __cesm_comp_mod_MOD_cesm_run

@jayeshkrishna
Copy link
Contributor

I am able to reproduce this issue on my laptop (Ubuntu 14.04 + 64-bit + gnu 4.8.4 + mpich 1.5 + pnetcdf 1.6.1). The code segfaults in pnetcdf. The missing stack frames (not listed above) is shown below (from my laptop),

#3 0x466A9A in ncmpii_in_swapn at convert_swap.m4:185 (discriminator 2)
#3 0x466A9A in ncmpii_in_swapn at convert_swap.m4:185 (discriminator 2)
#4 0x439EF5 in ncmpii_getput_vars at getput.m4:863
#5 0x431B51 in ncmpi_put_vara_int_all at getput.m4:357 (discriminator 2)
#4 0x439EF5 in ncmpii_getput_vars at getput.m4:863
#6 0x40528E in nfmpi_put_vara_int_all_ at put_vara_int_allf.c:57

@jayeshkrishna
Copy link
Contributor

Since reproducing the issue takes about 3 hours (running the test until it crashes) I finally resorted to writing out PIO and pnetcdf test cases that can potentially reproduce the problem.
I am now able to reproduce the issue with a simple PIO test case that performs a put of an integer parameter and also using a pnetcdf test case that uses the underlying pnetcdf API used by PIO.

@jayeshkrishna
Copy link
Contributor

After consulting with Rob Latham (MPI I/O+ PnetCDF@ANL) and Wei Keng (PnetCDF @ northwestern) the problem seems to be a performance optimization (in place swapping to save memory) inside PnetCDF.
After turning off this optimization in PnetCDF the simple test cases work for me (no longer crashes). I am currently trying out the ACME case on my laptop and will soon update the results.

@rljacob
Copy link
Member

rljacob commented Dec 3, 2015

Great work! Might be faster to tell @jgfouca how to try it.

@jayeshkrishna
Copy link
Contributor

The PnetCDF performance optimization can be turned off by rebuilding PnetCDF with "--disable-in-place-swap" (./configure ... --disable-in-place-swap) and then rebuilding the case.

@jayeshkrishna
Copy link
Contributor

The ERS.f45_g37.B1850C5 runs successfully on my laptop after rebuilding the case with a version of PnetCDF with "in place swap" turned off (./configure ... --disable-in-place-swap).

@jgfouca
Copy link
Member Author

jgfouca commented Dec 3, 2015

@jayeshkrishna , I don't suppose there's a code change to PIO that could get around this?

@rljacob
Copy link
Member

rljacob commented Dec 3, 2015

What is the F-case doing to expose this bug?

@jayeshkrishna
Copy link
Contributor

The case (CAM history code) does a PIO put with a temp array created from an integer parameter. My assumption is that the gnu compiler does aggressive optimization and retains the "parameter status" of the variable while other compilers don't.
PIO puts with integers that are not parameters (integer, parameter) work fine on all machines+compilers.
Since this issue arises only with gcc on Linux I am not sure if it is worth our time to try "fixing" it in PIO (Note that none of this code will be used once we move to PIO2 - different calls, different language).

@jgfouca
Copy link
Member Author

jgfouca commented Dec 3, 2015

@jayeshkrishna , if the fix is hard, then don't worry about it. My concern is that, with the special configuration needed for pnetcdf, Melvin will no longer be able to use the supported pnetcdf, so we'll have to maintain our own pnetcdf build. Annoying, but hardly end of the world.

@jayeshkrishna
Copy link
Contributor

Actually apart from copying the integer parameters to a regular integer locally before a put (very hacky) I don't know of any other solutions right now. Creating these temp arrays (as in the current CAM history code) should have been the more elegant way if it worked (unfortunately it does not).

So I am not sure of a "clean way" of fixing this issue right now by modifying the source code. And as I mentioned above this issue will go away once we move to PIO2.

@jayeshkrishna
Copy link
Contributor

@jgfouca / @rljacob : Do we close this PR (Although Jim was not able to successfully run the test on Melvin after turning the PnetCDF optimizations off, he has now switched to NetCDF on Melvin for these tests. PIO+NetCDF does not exhibit the same issue and he is now able to run the tests successfully on Melvin)?

@jgfouca
Copy link
Member Author

jgfouca commented Dec 10, 2015

@jayeshkrishna , i have a viable workaround and, as you've said, PIO is going away, so I will close.

@jgfouca jgfouca closed this as completed Dec 10, 2015
@jayeshkrishna
Copy link
Contributor

PIO1 (not PIO) is going away, hopefully soon :)

rljacob added a commit that referenced this issue Aug 11, 2016
12d2135 Merge pull request #388 from ESMCI/jgfouca/need_to_report_build_exceptions
8f677cd Add test to ensure build fails report info to teststatus.log
7095ef0 Need to report build exception contents
7c9cc94 Merge pull request #387 from ESMCI/jgfouca/fix_case_build_return_code
bf941ed case.build needs to check success in order to return a sane error code
df432e8 update ChangeLog
154d5f8 Merge pull request #378 from ESMCI/rljacob/update-config-files
6b8fc76 Merge pull request #382 from ESMCI/sarich/fix-taskmaker-counter
5df46a2 Merge pull request #381 from jedwards4b/test_fixes
e58d624 component_compare_test was not properly reporting failures
0e0e577 Update acme config_files for mpas
84122dd Merge pull request #376 from ESMCI/jgfouca/changes_from_acme
38e2f8a More stuff from ACME
c86398e Merge pull request #375 from ESMCI/jgfouca/portable_run_cmd_utest
daaf621 Merge pull request #373 from ESMCI/jgfouca/enhance_bisect
e61ba96 Change MPAS compset for test
c77a64e Add homme python test
3031f00 Better support for 'none' module system
3ceef7b Make run_cmd_no_fail unit test more portable
bbd20fb Merge branch 'jgfouca/fix_module_list' (PR #374)
6eb8143 Reactivate creation of software_environment.txt
4dd30c6 Ensure module setup is sourced before list
c8bd20e fix bug in translation from perl
20a3412 cime_bisect: Add better support for modifying create_test run
77871de update changelog
e74906b comment out code until it works for tcsh users
4a13413 fix issue with module list
6ad4b2d update changelog
cef688d update changelog
835b511 Merge pull request #367 from jedwards4b/user_mod_0len_fix
b280b55 Merge pull request #362 from ESMCI/jgfouca/remove_perl_taskmaker
12a30ee Merge pull request #356 from ESMCI/jgfouca/minor_timing_chg
3fb0b80 Merge pull request #355 from ESMCI/jgfouca/wait_for_test_refactor
d083933 user_nl_ file was being removed if a user_nl file in any mods directory was missing
39de940 Fix comment
5d38420 Revert "Merge pull request #343 from ESMCI/wilke/scripts/xmlchange"
8dc2354 Merge pull request #363 from ESMCI/rljacob/machines/fix-acme
0773aac Increase default walltime for blues
c4dce0f Remove last uses of taskmaker.pl
76eb1bc Remove -A directive from edison
d67b267 Merge pull request #361 from billsacks/cism_nag
bf02e3e Merge pull request #357 from ekluzek/fixpionml
c9b8910 Seperate out modelio namelist definition since it uses the same names, but defines them differently
805ad7f Add -mismatch_all when compiling cism with nag
fff9a9b Set CHECK_TIMING to true in addition to SAVE_TIMING if --save-timing given to create_test
f25a518 wait_for_tests will now always specifically wait for the RUN phase
e19e72c Update drv buildnamelist test to work with cime5
db1538e Merge branch 'douglasjacobsen/add_lanl_machines' (PR #353)
893c6c6 Add support for LANL's mustang and wolf to cime
dea8a3a Merge pull request #350 from ESMCI/rerun_test_functionality
9b4488b Changes based on github feedback
c103e08 Add SAVE_TIMING_DIR for edison
98f95bb Merge pull request #341 from ESMCI/santos/fix-env-leakage
1b775e4 Fixes post-upstream-merge
ea97b56 Merge branch 'master' into rerun_test_functionality
1ca1b83 Merge pull request #348 from ESMCI/jayeshkrishna/machinefiles/get_acme_cime_dev_working_on_mira
252aea7 Merge pull request #343 from ESMCI/wilke/scripts/xmlchange
2db894f Add missing files
622b7d0 Complete
ba69385 progress
84000ee Fixing the runjob command for ACME on Mira
1a55232 Adding config for ERS_Ld3.ne30_g16_rx1.A test
d1df346 Error handling; check for correct length of key-value pair array after split
fa1cb49 listofsettings allways an array, test for length of array
a6a3d33 Changed number of expected positional arguments to 0 or 1 , warnings and debug statements
74d2100 checking for missing values in settings string from command line
cd350da Remove `GenericXML` check for env variables.
6ca6b59 progress
e7b334e Merge pull request #340 from ESMCI/douglasjacobsen/fix_test_template
43807a5 Add white space after batch directives in script templates
e061505 Merge pull request #337 from ESMCI/jgfouca/autosave_env_info
edc1671 Autosave environment information in case_setup.
33ce89b Merge pull request #336 from ESMCI/jgfouca/fix_create_test_not_catching_missing_project
c3f8f84 create_test was not failing the create_newcase phase when project info was missing
fef81df Merge pull request #335 from ESMCI/jgfouca/add_queue_option_to_create_test
731f8a0 Add ability to select queue to create_test and create_newcase
6f9613f Merge pull request #333 from ESMCI/jgfouca/even_more_sky_env_fixes
11877a2 Fix mismatch between MPI_PATH and the mpi module being loaded
d37e177 Merge pull request #322 from ESMCI/jgfouca/restore_good_python_version_error
ad18c34 Merge pull request #331 from ESMCI/jgfouca/reduce_output_from_check_input_data
0268cb7 Only report present files in debug mode
47b4216 Fix spelling mistake
dddd7f0 Merge pull request #327 from ESMCI/jgfouca/fix_more_sky_env_issues
07aeb52 Get cime_developer building again on skybridge.
0aceb94 Merge branch 'wilke/template/directives' (PR #324)
d8f331c moved batchdirectives to top of the template
dbbd3a1 Users should get a nice error when their python is too old
5eea798 Merge pull request #320 from ESMCI/jgfouca/fix_skybridge_env_issues
ca3e004 Fix skybridge environment problems, port to new SEMS modules
1a82a57 Merge pull request #318 from ESMCI/jgfouca/remove_sentinel_concept
e266dd9 Remove sentinel concept from jenkins_generic_job
aae8e30 comments for cime5.0.5
e20f807 Merge pull request #317 from billsacks/restore_lii
1967bb3 Restore LII test
c404dfa Merge remote-tracking branch 'origin/master'
0406b7d updates for cime5.0.4
7930cd7 Merge pull request #316 from ESMCI/jgfouca/update_code_checker
009f7a1 code_checker: Leverage .gitignore by using git ls-files instead of find to get list of ifles to check
c5555c7 Merge pull request #315 from Katetc/master
c4817d7 fix issue 314
7a493a0 remove multiple run lines from test file
c269ab9 Merge pull request #313 from ESMCI/jgfouca/correctly_report_problem_in_test
734e4b4 Rolling the Intel compiler back to v15.0.2
9a46a99 On batch systems, be sure to report that the problem is with wait_for_tests, not create_test
0e95d19 add some more info to README file
e9586c1 Changes required to support the new Hobart cluster configuration
cdb7805 update documentation for --xml options
98a0380 Merge pull request #307 from ESMCI/rljacob/tests/add-readme
46ff3c6 work on test rerunability
c5f2ae9 Merge pull request #308 from ESMCI/jgfouca/fix_check_input_bug
bddea72 document ERR test
8639ba1 create ability to run tests in same case more than once
b18580b Fix minor erroneous output bug in check_input_data
6f3e448 Add README back to Testcases
fd001a7 Add README back to SystemTests
929f05a Merge pull request #305 from ESMCI/jgfouca/advanced_profiling_tool
20c2e22 Make prof tools a bit more user friendly
1f9b49b Merge pull request #304 from jedwards4b/dynamic_system_test_dirs
0ba7f50 handle so that we dont have a list of test names to maintain
92a266e handle so that we dont have a list of test names to maintain
99f3d35 New tool 'advanced-py-prof'
4e6f7f5 initialize contents
3703d94 machine specific fixes for edison/cori/slurm systems
f6dc40a fixes git issue 303
7bacf48 repeat change for acme
503d5ad load system test directories dynamically based on paths in config_files.xml
b28ddff Merge pull request #302 from ESMCI/jgfouca/profiling_tool_etc
0e1553f Add a new tool for very simple python profiling
1eb2a56 Merge pull request #301 from jedwards4b/shell_commands_delete
2f78ec7 remove any existing shell_commands files from case before writing new ones
5f85c05 update changelog for tag
4ef656d pylint fixes
8624ece fix needed for scripts_regression_tests following PR298
6cc9110 These were supposed to be in PR296
d19afa9 Merge remote-tracking branch 'jedwards/testing_fixes' (PR #296)
b302243 Merge pull request #298 from ESMCI/jgfouca/restore_verbose
0a95b04 component_compare_test should fail if one of the components to be compared is not found"
9aa8683 Reintroduce verbose option into the refactored logging system
a796384 fix for lii test and response to review
d8c9b2e Merge pull request #286 from jedwards4b/buildnml_output_fix
1894e28 improve documetation of debug option, remove incorrect documentation of verbose option
21ef9ae remove whitespace surrounding test names
f6fdbb7 fix erp test update ChangeLog
b8b4723 Fix LII test
daa0c63 rename bisect unit test from acme to cime
4f1a079 move pecount code from create_test to create_newcase
24eb48f move clm include directory to prevent build confusion
1ee4449 add support for ascii testfile, allow multiple compilers in tests
d6c28b4 fix memleak test giving error if baseline not found
8ff5f19 Merge pull request #287 from ESMCI/nag_mismatch
a57e410 Remove `-mismatch_all` from NAG options in CESM.
5040500 output from buildnml scripts now prints

git-subtree-dir: cime
git-subtree-split: 12d2135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants