-
Notifications
You must be signed in to change notification settings - Fork 458
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
Regression tests failed with invalid syntax error #444
Comments
Could you try with a newer version of Python? It may be that the error plotting module was written for the latest version of Python. |
Thanks for your reply. Indeed I did tried using a different version of python after posting my query here but forgot to update it here. I can confirm the problem is resolved when I use Python 3.7.5. However, I am not sure if this still works with other higher versions of Python. I think it could be a good idea to make it more clear about which versions of Python work, in Section 2.2.1.3. Dependencies for the test suite, to help OpenFast users in future. |
It's true, it would be good to have a matrix of tests for different operating systems and Python versions. While developing these tools, we used Python 3.7 so its of course difficult to know what doesn't work on lower versions of Python. Generally, language features will work in larger minor version numbers but not necessarily for smaller minor versions, so we can reasonably assume everything works fine in Python 3.8. In any case, thanks for reporting back and I'll update the documentation accordingly. |
Updated in |
Dear all, While trying to do the regression tests for OpenFAST on a HPC cluster, many tests failed. To check what the cause of the fails was, I checked the verbose output of one test run. I get the following error while running ctest -V -R AWT_YFix_WSt: test 1 1: Test command: /usr/bin/python "/XXXX/OpenFAST/reg_tests/executeOpenfastRegressionCase.py" "AWT_YFix_WSt" "/XXXX/OpenFAST/build/glue-codes/openfast/openfast" "/XXXX/OpenFAST/reg_tests/.." "/XXXX/OpenFAST/build/reg_tests/glue-codes/openfast" "0.00001" "Linux" "Intel" It seems that the synthax '*performance' is invalid. How can I solve this issue? Thank you in advance! Sincerely, |
Hi @Christophe-delFosse can you verify that you're using Python 3? |
I am using Python 3.7.4 compiled with GCCcore (module on HPC cluster is called Python/3.7.4-GCCcore-8.3.0). This module was loaded before I ran the regression tests. |
Try running that test command (the stuff after "Test command:") on its own outside of CTest. You can copy the command directly from the CTest output. |
Dear @rafmudaf I tried running the test command outside of CTest, but I get the same syntax error from line 167 in the python script "executeOpenfastRegressionCase.py". The arrow points at the '*' symbol in '*performance'. Is this meant to be a multiplication? /XXXX/OpenFAST/build $ /usr/bin/python "/XXXX/OpenFAST/reg_tests/executeOpenfastRegressionCase.py" "AWT_YFix_WSt" "/XXXX/OpenFAST/build/glue-codes/openfast/openfast" "/XXXX/OpenFAST/reg_tests/.." "/XXXX/OpenFAST/build/reg_tests/glue-codes/openfast" "0.00001" "Linux" "Intel" Sincerely, |
If its not a Python version problem, then I'm not sure what else might be happening. Just verify again that you're using the Python you intend to use. Typically, the Python at Here's the difference regarding the line in question with Python 2 and 3:
|
Dear @rafmudaf I loaded the python 3.6.5 module on the supercomputer. When I run the python command I get the following:
Running /usr/bin/python is indeed resulting in the use of Python version 2: The following thing I tried was to run the test command outside ctest by using python instead of /usr/bin/python, but I have the following error: When I try to just run OpenFAST without ctest, it works fine: OpenFAST Copyright (C) 2021 National Renewable Energy Laboratory This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY. OpenFAST-v2.5.0
OpenFAST terminated normally. I would really like to check if all functionalities in OpenFAST are running properly. So I would really appreciate being able to run the ctest command properly and seing the tests pass. Could you help me further please? Thank you in advance! Sincerely, |
Just a tip - its generally safer and more clear to use the entire path to your Python interpreter (or any program). So in your case, you can do What are the permissions on the OpenFAST executable ( |
How can I change CTest to choose the correct path to my Python interpreter instead of /usr/bin/python? The permissions on the OpenFAST executable are as follows: I am running CTest directly on an interactive node. Later when everything runs fine, I will start using a job scheduler. |
You can set this CMake flag:
I see that this is not documented in readthedocs, so that's my bad. |
Thank you for all the tips. I am able to have more passed tests now. However, there are still 21 failed tests: /XXXX/OpenFAST/build $ ctest 59% tests passed, 21 tests failed out of 51 Label Time Summary: Total Test time (real) = 2446.91 sec The following tests FAILED: Which of these failed tests are important and should normally pass? I assume that the data to which the test results is compared has slightly different results, but I want to be sure that my installation of OpenFAST behaves as it should. |
Did you compile the driver codes for the regression tests? If not, you'll need to do |
Are these driver codes for the regression tests also compiled when running the following: cmake .. -DBUILD_TESTING=ON -DPYTHON_EXECUTABLE='path-to-python' Or is there some other code I must download and install? |
Yes, they're compiled in the |
You were right! I changed the permissions again with chmod 755 for the three drivers. Now I have only the following failed tests remaining: Are these tests important? |
You can ignore 9 and 16. For the others, you can start to drill down into each one individually. You already know what to do... run each with the verbose flag and see if there's some syntax error or permissions problems or something else that is preventing the simulation from running. If it runs, then check the log file that will be listed in the If the simulation terminates normally, then you can inspect the outputs by generating error plots. Check back in before you get to that point and I'll list those steps. |
I checked test 19 - 5MW_OC3Trpd_DLL_WSt_WavesReg (Failed) and the log file shows that the simulation terminates normally. Could you list the steps to generate the error plots please? Thank you in advance. |
Tests 19, 20, 31, 32 and 46 give normal simulation terminations. For tests 27 and 28 I get the following message in the log file: No OpenMP support. |
For 27 and 28, is that the last line of the log or does it continue to output the time sequence? More importantly, does it end with |
For 27 and 28 it is the last line of the log. I don't have the 'OpenFAST terminated normally'. |
@andrew-platt @ebranlard Do you have any thought on this? It looks like its on the main branch (v2.5.0). |
Would it be possible to list those extra steps to generate error plots please? This way I can check whether the error is very large or not. Thanks a lot for the help so far! |
First, you'll need to install the Bokeh python package at version 1.4 ( Then, add the plotting flag to the CMake configuration: Finally, run the failing tests individually and look for the html file in those case directories. |
I ran the cmake .. -DCTEST_PLOT_ERRORS=ON command and I have installed the Bokeh==1.4 package through miniconda and activated an environment that includes this package. When I run the individual test case 31: Ideal_Beam_Fixed_Free_Linear, I don't get a html file in the case directory /XXXX/OpenFAST/build/reg_tests/glue-codes/openfast/Ideal_Beam_Fixed_Free_Linear. What am I doing wrong? |
The linearization tests are slightly different and will not generate a plot. If you want to understand the differences there, you'll have to dive deeper into the comparison of the .lin files. |
All my regression tests have failed with invalid syntax in errorPlotting.py file.
I compiled openfast on mac os (version 10.15.2) and gfortran version 4.9.2 and ran the ctest following the instructions in Section 3.2.2.4.1. I appreciate your help in resolving this issue.
FYI: I have python 3.5.4 with numpy and matplot lib installed.
The below is the output produced by running the ctest -V -R AWT_YFix_WSt
1: Test timeout computed to be: 5400
1: Traceback (most recent call last):
1: File "/XXXX/openfast/reg_tests/executeOpenfastRegressionCase.py", line 35, in
1: from errorPlotting import exportCaseSummary
1: File "/Users/sramiset/Desktop/openfast/reg_tests/lib/errorPlotting.py", line 194
1: _path = os.path.join(plot_path, f'{plot}_script.txt')
^
1: SyntaxError: invalid syntax
1/1 Test #1: AWT_YFix_WSt .....................***Failed 0.35 sec
0% tests passed, 1 tests failed out of 1
Label Time Summary:
aerodyn14 = 0.35 secproc (1 test)
elastodyn = 0.35 secproc (1 test)
openfast = 0.35 secproc (1 test)
servodyn = 0.35 secproc (1 test)
Total Test time (real) = 0.36 sec
The following tests FAILED:
1 - AWT_YFix_WSt (Failed)
Errors while running CTest
The text was updated successfully, but these errors were encountered: