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

Writing keywords with ecl_file on OS X fails #103

Merged
merged 4 commits into from
Jun 8, 2017

Conversation

markusdregi
Copy link
Contributor

@markusdregi markusdregi commented Jun 6, 2017

Task

The EclKW test fails on OS X.

Approach

It turned out to be an problem with ecl_file/fortio in C. The problem occurred in ecl_file_save_kw and the solution was to flush the fortio stream after skipping the header, but before writing the data.

Pre un-WIP checklist

  • Statoil tests pass locally
  • Have completed graphical integration test steps

return -1;

int flush_status = fflush(fortio->stream);
if(flush_status != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the ftell( ) and fseek( ) calls necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because the position in the stream after a flush is undefined. And in particular, it results in funky behaviour with clang on OS X..

@markusdregi markusdregi merged commit 6b27192 into equinor:master Jun 8, 2017
@markusdregi markusdregi deleted the osx_kwtest branch June 8, 2017 06:26
@markusdregi markusdregi changed the title WIP: Writing keywords with ecl_file on OS X fails Writing keywords with ecl_file on OS X fails Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants