[CIG-SEISMO] Unsuccessuful SW4 test (João Fontiela)

Tyler Esser tjesser at ucdavis.edu
Wed Nov 15 17:33:26 PST 2017


Anders, the hyperlink text was probably added by the mailing list. I'd
guess that the filename, refine-el-1.in, was automatically treated as a
URL. I expect my email will be similarly mangled.

João, I think I was able to replicate your issue. It looks like the error
was caused by the way the Python script calls mpirun. In pytest/test_sw4.py,
lines 200 - 211 setup the mpirun command and handle the resulting error. In
particular, line 206:

status = os.system(run_cmd)
>

executes a string created on line 201:

run_cmd = sw4_mpi_run + ' ' + sw4_input_file + ' >& ' + sw4_stdout_file
>

I think the culprit is the output redirect: ' >& ', as apparently that
syntax is only supported in csh and tcsh shells. (
https://unix.stackexchange.com/a/176224) It would be helpful to have more
information on your system environment so that we can figure out whether
you are using one of those system shells, or if your problem comes from
something else.

However, the Python documentation recommends against using os.system() to
execute commands, instead recommending the subprocess python module: (
https://docs.python.org/3/library/os.html#os.system). The subprocess module
should allow output redirection in a system agnostic way, which I think
will prevent your issue. Anders, if you agree with this assessment, I can
write a patch using the subprocess module and submit it to the Github repo.


Tyler Esser

P.S. Here's the error I got when running on my system:

tyler at Latitude:~/Downloads/sw4-v2.0/pytest$ ./test_sw4.py -v
>
pytest_dir = /home/tyler/Downloads/sw4-v2.0/pytest
>
sw4_base_dir = /home/tyler/Downloads/sw4-v2.0
>
optimize_dir = /home/tyler/Downloads/sw4-v2.0/optimize
>
reference_dir = /home/tyler/Downloads/sw4-v2.0/pytest/reference

os.uname= posix.uname_result(sysname='Linux', nodename='Latitude',
> release='4.4.0-98-generic', version='#121-Ubuntu SMP Tue Oct 10 14:24:03
> UTC 2017', machine='x86_64')
>
node_name= Latitude
>
sys_name= Linux
> mpirun_cmd =  mpirun -np 1
>
Running all tests for level 0 ...
>
Starting test # 1 in directory: meshrefine with input file: refine-el-1.in
>
sh: 1: Syntax error: Bad fd number
>
ERROR: Test refine-el-1.in : sw4 returned non-zero exit status= 512
> aborting test
>
run_cmd= mpirun -np 1 /home/tyler/Downloads/sw4-v2.0/optimize/sw4
> /home/tyler/Downloads/sw4-v2.0/pytest/reference/meshrefine/refine-el-1.in
> >& refine-el-1.out
>
DID YOU USE THE CORRECT SW4 EXECUTABLE? (SPECIFY DIRECTORY WITH -d OPTION)
>
test_sw4 was unsuccessful





On Wed, Nov 15, 2017 at 4:33 PM, Petersson, Anders <petersson1 at llnl.gov>
wrote:

> Hi Joao,
> Sorry to hear about your difficulties testing SW4.
> You have some strange characters in the output from the test script. The
> first line is:
> Starting test # 1 in directory: meshrefine with input file: refine-el-1.in
> <http://refine-el-1.in/>
> The hyperlink should not be there (<http://refine-el-1.in/>).
>
> Can you can run the test manually from the pytest directory?
> > cd pytest
> > mpirun –np 1 ../optimize/sw4  reference/meshrefine/refine-el-1.in
>
> Good luck,
> Anders
>
> On 11/15/17, 12:05 PM, "CIG-SEISMO on behalf of cig-seismo-request@
> geodynamics.org" <cig-seismo-bounces at geodynamics.org on behalf of
> cig-seismo-request at geodynamics.org> wrote:
>
>     Send CIG-SEISMO mailing list submissions to
>         cig-seismo at geodynamics.org
>
>     To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo
>     or, via email, send a message with subject or body 'help' to
>         cig-seismo-request at geodynamics.org
>
>     You can reach the person managing the list at
>         cig-seismo-owner at geodynamics.org
>
>     When replying, please edit your Subject line so it is more specific
>     than "Re: Contents of CIG-SEISMO digest..."
>
>
>     Today's Topics:
>
>        1. Unsuccessuful SW4 test (João Fontiela)
>
>
>     ----------------------------------------------------------------------
>
>     Message: 1
>     Date: Wed, 15 Nov 2017 11:49:42 +0000
>     From: João Fontiela <jfontiela at uevora.pt>
>     To: cig-seismo at geodynamics.org
>     Subject: [CIG-SEISMO] Unsuccessuful SW4 test
>     Message-ID: <2E1502C9-B63E-4C1F-9B8C-88A3EC744B47 at uevora.pt>
>     Content-Type: text/plain; charset="utf-8"
>
>     Dear all,
>
>
>     We installed SW4 (latest release) successfully nevertheless when we
> execute test_sw4.py (we have installed also python3) we got the following
> error:
>
>     [root at terra pytest]# ./test_sw4.py
>     Running all tests for level 0 ...
>     Starting test # 1 in directory: meshrefine with input file:
> refine-el-1.in <http://refine-el-1.in/>
>     ERROR: Test refine-el-1.in <http://refine-el-1.in/> : sw4 returned
> non-zero exit status= 32512 aborting test
>     run_cmd= mpirun -np 1 /share/apps/sw4-master/optimize/sw4
> /share/apps/sw4-master/pytest/reference/meshrefine/refine-el-1.in <
> http://refine-el-1.in/> >& refine-el-1.out
>     DID YOU USE THE CORRECT SW4 EXECUTABLE? (SPECIFY DIRECTORY WITH -d
> OPTION)
>     test_sw4 was unsuccessful
>
>     Make.inc configuration is:
>     FC = gfortran
>     CXX = mpicxx
>     EXTRA_LINK_FLAGS =-L/usr/lib64/atlas -llapack -lblas -lgfortran
>
>     Can anyone help understand what is going on?
>
>     Yours,
>     João Fontiela
>
>     *********************
>     *********************
>     João Fontiela
>     PhD Student
>     skype: fontiela
>     email: fontiela at gmail.com
>     mobile phone +351 917 862 830
>
>     Profissional contacts:
>     email: jfontiela at uevora.pt
>     Tel: (+351) 266 745 354 ext: 5395 or 5413
>     Fax: (+351) 266 745 394
>
>     Profissional address:
>     Universidade de Évora
>     Instituto de Ciências da Terra
>     Colégio Luís Verney
>     Rua Romão Ramalho, 59
>     7000-671 Évora - Portugal
>
>     ResearchGate: https://www.researchgate.net/profile/Joao_Fontiela
>
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL: <http://lists.geodynamics.org/pipermail/cig-seismo/
> attachments/20171115/901b5718/attachment-0001.html>
>
>     ------------------------------
>
>     Subject: Digest Footer
>
>     _______________________________________________
>     CIG-SEISMO mailing list
>     CIG-SEISMO at geodynamics.org
>     http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo
>
>     ------------------------------
>
>     End of CIG-SEISMO Digest, Vol 118, Issue 8
>     ******************************************
>
>
> _______________________________________________
> CIG-SEISMO mailing list
> CIG-SEISMO at geodynamics.org
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/cig-seismo/attachments/20171115/63725427/attachment-0001.html>


More information about the CIG-SEISMO mailing list