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

OpenFAST Simulink compilation in dev branch crashing. #692

Open
aidowu opened this issue Mar 23, 2021 · 29 comments
Open

OpenFAST Simulink compilation in dev branch crashing. #692

aidowu opened this issue Mar 23, 2021 · 29 comments

Comments

@aidowu
Copy link

aidowu commented Mar 23, 2021

I want to ask if you can give a timeline for when the Simulink OpenFAST version (at least up to the TCF MOD2 merge) in the development branch will be ready?

We tried compiling currently as is, to get started on our work, pending the time the updates gets completed. While the OpenFAST compiled for the command line works, the Simulink compilation keeps crashing MATLAB.

@andrew-platt
Copy link
Collaborator

How are you compiling it, which compiler, and which platform?

@aidowu
Copy link
Author

aidowu commented Mar 23, 2021

I am compiling following the steps listed in the attached file which I found on this forum. I am compiling for windows x64. It does compile and I generate the S-Function from the compilation but when I try running it, it crashes MATLAB. I have followed the steps in the attached document to compile the main branch and that runs well.

So I want to verify if the Simulink compilation process has been validated or when it will be validated?
OpenFAST_Simulink.pdf

@andrew-platt
Copy link
Collaborator

andrew-platt commented Mar 23, 2021

Are there any errors from the create_FAST_SFunc.m script?

@aidowu
Copy link
Author

aidowu commented Mar 23, 2021

There are no errors. Here is a picture of the directory containing the compiled files.
image

@andrew-platt
Copy link
Collaborator

andrew-platt commented Mar 23, 2021

What version of the Intel Fortran compiler are you using with Visual Studio? And which version of MATLAB?

Which Simulink example case are you running?

Also, I'm not entirely sure what you are asking about in terms of timeline. The TCF MODS2 branch was merged in January, but did not contain any updates for control channels. If you are asking about the cable control channels, there is a branch in development associated with this pull request: #664.

@aidowu
Copy link
Author

aidowu commented Mar 23, 2021

I am using Intel Parallel Studio X17 and I didn't run any of the Simulink example cases but ran a project case that worked with the main dev Simulink compilation. I will go run an example case to see if I can narrow down where the issue might be.

Looking through the pull request you mentioned above, I'll modify my question by asking if the Simulink version in the development branch has been validated for the cable control updates? That way I can know if the error is from my path or if it might be a bug?

@andrew-platt
Copy link
Collaborator

andrew-platt commented Mar 23, 2021

Did you update the input file set for your project? Several input files have changed between the main branch and the development branch. There had been some error handling issues that were causing MATLAB to crash when there were input file errors -- I those had been corrected in the development branch.

The development branch does not currently contain any of the cable control functionality. We hope to merge that in by the end of the month (#664).

@aidowu
Copy link
Author

aidowu commented Mar 25, 2021

Hi Andrew, thanks for the update on the status of the cable control capability.
Yes, I did update the input file. I found that deleting the temp file created by Simulink helped the simulation advance but I am now getting an error of "size of NumOutputs is invalid". I have attached a screenshot of this error. Can you help provide some insight on why I might be getting this error?
image

@andrew-platt
Copy link
Collaborator

Which branch are you using?

If you are using the branch in PR #664, there are some changes in the Simulink interface from the OpenFAST main and dev branches.

@aidowu
Copy link
Author

aidowu commented Mar 25, 2021

Yes, I am using the branch PR #664. Does that mean that I need to change the open loop block I have to the open loop block in the Simulink example folder?
What I have done initially was just compile the SFunc using the branch PR #664, modify the input files (ServoDyn) and run the simulation using a previous simulink model that worked with the OpenFAST main branch.

@andrew-platt
Copy link
Collaborator

Yes. You will need to change your Similink model to match the setup in the examples. There are an additional 43 channels in the new block configuration in 3 groups:

  • airfoil command: 3
  • Cable DeltaL command: 20
  • Cable DeltaLDot command: 20

Screen Shot 2021-03-25 at 10 37 21 AM

@aidowu
Copy link
Author

aidowu commented Mar 25, 2021

Thanks a lot Andrew. I'll make the modifications and see how it goes.

@andrew-platt
Copy link
Collaborator

Hi @aidowu,

There might be another issue going on here with the output handling within OpenFAST that is causing a mismatch between the list of output channels passed to Simulink and the size of the array holding the output channel data. The current suspicion is that one of the modules has a bug with this and is causing the FAST_Start:size of NumOutputs is invalid. error.

Can you post your outlist section for the HydroDyn input file?

@aidowu
Copy link
Author

aidowu commented Mar 29, 2021

Hi @Andrew-P, I attached the output section of my HydroDyn input file (It's only Wave1Elev).

I am yet to get the Simulink running. It's currently just hanging and no longer getting to the point of returning the "size of NumOutputs is invalid" error after updating the model and input files.

image
latt ,

@bjonkman
Copy link
Contributor

One other thought: How many output channels are in your model? You should be able to check how many there are in the OpenFAST summary file that is generated at initialization. That error might be triggered if you've exceeded the max number of outputs allowed in the Simulink interface (4000).

@aidowu
Copy link
Author

aidowu commented Mar 30, 2021

Hi @bjonkman, my model has 465 outputs channels.

@Andrew-P
Copy link

Hi @Andrew-P, I attached the output section of my HydroDyn input file (It's only Wave1Elev).

I am not involved in this project. Please direct comments to @andrew-platt, not @Andrew-P.

@andrew-platt
Copy link
Collaborator

The issue has been found (see #702). This will be updated shortly in the dev branch and in my branch (for #664).

@andrew-platt
Copy link
Collaborator

Corrected in dev and in branch for #664.

@andrew-platt
Copy link
Collaborator

PR #702 only partially fixed things. Now it seems to hang. Looking into it.

@Cookiewyf
Copy link

‎您是否更新了项目设置的输入文件?主分支和开发分支之间发生了若干输入文件更改。当输入文件错误时,出现了一些错误处理问题,导致 MATLAB 崩溃 - I 这些问题已在开发分支中更正。‎

‎开发分支目前不包含任何电缆控制功能。我们希望在月底之前合并‎‎(#664‎).

hi I met the same question, I use matlab(2020b) and I also tried 2019. they all crashed, and I have the openfast-simulink_x64.dll,also created the mexw64.But when I want to run openloop.m, the matlab crashed.(I download the openfast2.6)
image

@bjonkman
Copy link
Contributor

@Cookiewyf, You can try using the files I've uploaded here: https://github.com/bjonkman/openfast/releases/tag/v2.6.0. The OpenLoop example runs with them on Matlab 2019.

@jjonkman
Copy link
Collaborator

@rafmudaf -- Can you take these precompiled versions of OpenFAST v2.6 for MATLAB / Simulink on Windows from Bonnie, along with the precompiled executable for Windows and put them on the main OpenFAST v2.6 release page? Thanks,

@rafmudaf
Copy link
Collaborator

Yes. I only see the Simulink files. Where is the precompiled executable?

@jjonkman
Copy link
Collaborator

Haven't you been generating those with each release (except v2.6)? Otherwise, Bonnie likely has one as well.

@rafmudaf
Copy link
Collaborator

I generate those manually but I'm working on moving the process to an automated system, so it is delayed. If @bjonkman has already compiled this, I'll add it to the release.

@bjonkman
Copy link
Contributor

@rafmudaf , I just uploaded the additional file. Note that it does not require the Intel redistributables.

@rafmudaf
Copy link
Collaborator

Thanks! Its all now included in the OpenFAST v2.6.0 release.

@jjonkman
Copy link
Collaborator

Thanks!

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

7 participants