Skip to content

Conversation

@PaulWessel
Copy link
Member

GMT_Read_Data assigns a new object number to what is read, but if input file is a set of tiles it calls gmt_assemble_grid which also creates an object to pass from grdblend. However, once we get it back from grdblend we only want to keep the grid and discard the container since GMT_Read_Data already has a container for it.

gmtmex('grdcut @earth_relief_01m -R-37.0/-35.0/-2.3/-1.0')

works when built with this PR.

GMT_Read_Data assigns a new object number to what is read, but for tiles it calls gmt_assemble_grid which also creates an object to pass to grdblend.  However, once we get it back from grdblend we only want to keep the grid and discard the container since GMT_Read_Data already has a container for it.
@PaulWessel PaulWessel added bug Something isn't working backport 6.1 Backport this PR to 6.1 branch labels Jul 29, 2020
@PaulWessel PaulWessel requested review from joa-quim and seisman July 29, 2020 22:02
@PaulWessel PaulWessel self-assigned this Jul 29, 2020
@PaulWessel PaulWessel changed the title Do not let the API object for the assembled grid live one Do not let the API object for the assembled grid live on Jul 29, 2020
@PaulWessel PaulWessel merged commit 46ff226 into master Jul 29, 2020
@PaulWessel PaulWessel deleted the assemble-grid-fix branch July 29, 2020 22:37
@github-actions
Copy link
Contributor

The backport to 6.1 failed:

The process 'git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-6.1 6.1
# Navigate to the new working tree
cd .worktrees/backport-6.1
# Create a new branch
git switch --create backport-3771-to-6.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 46ff22613bbbc181bb4bf5b9ad4ebc928c1bab5f
# Push it to GitHub
git push --set-upstream origin backport-3771-to-6.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-6.1

Then, create a pull request where the base branch is 6.1 and the compare/head branch is backport-3771-to-6.1.

@PaulWessel
Copy link
Member Author

Pinging @seisman

@seisman
Copy link
Member

seisman commented Jul 29, 2020

OK, will see what happened later.

@seisman
Copy link
Member

seisman commented Jul 30, 2020

So there is a conflict in src/gmt_internal.h

++<<<<<<< HEAD
++=======
+ EXTERN_MSC int gmtlib_delete_virtualfile  (void *API, const char *string);
+ EXTERN_MSC bool gmtlib_file_lock (struct GMT_CTRL *GMT, int fd);
+ EXTERN_MSC bool gmtlib_file_unlock (struct GMT_CTRL *GMT, int fd);
++>>>>>>> 46ff22613b... Do not let the API object for the assembled grid live one (#3771)

These two functions were added in PR #3735, but not backported to 6.1 branch. So they shouldn't be added to 6.1.

+ EXTERN_MSC bool gmtlib_file_lock (struct GMT_CTRL *GMT, int fd);
+ EXTERN_MSC bool gmtlib_file_unlock (struct GMT_CTRL *GMT, int fd);

seisman pushed a commit that referenced this pull request Jul 30, 2020
GMT_Read_Data assigns a new object number to what is read, but for tiles it calls gmt_assemble_grid which also creates an object to pass to grdblend.  However, once we get it back from grdblend we only want to keep the grid and discard the container since GMT_Read_Data already has a container for it.
@PaulWessel
Copy link
Member Author

yes, correct.

seisman added a commit that referenced this pull request Jul 30, 2020
)

GMT_Read_Data assigns a new object number to what is read, but for tiles it calls gmt_assemble_grid which also creates an object to pass to grdblend.  However, once we get it back from grdblend we only want to keep the grid and discard the container since GMT_Read_Data already has a container for it.

Co-authored-by: Paul Wessel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 6.1 Backport this PR to 6.1 branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants