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

Number of components in a mesh tag is more than INT8_MAX #24

Closed
zhangchonglin opened this issue Sep 21, 2021 · 5 comments
Closed

Number of components in a mesh tag is more than INT8_MAX #24

zhangchonglin opened this issue Sep 21, 2021 · 5 comments

Comments

@zhangchonglin
Copy link

Copying the same issue from XGCm for better location.

When the number of components for a mesh tag exceeds INT8_MAX, which is 127, it is problematic as this could often happen.

Simply inferring from the below assert (OMEGA_H_CHECK) statement, INT8_MAX seems to be the upper limit manually set currently for the number of components. From my understanding, it may not be a simple manual limit to change, and could be related to many other operations:

template <typename T>
void Mesh::add_tag(Int ent_dim, std::string const& name, Int ncomps,
Read<T> array, bool internal) {
check_dim2(ent_dim);
auto it = tag_iter(ent_dim, name);
auto had_tag = (it != tags_[ent_dim].end());
Tag<T>* tag;
if (had_tag) {
tag = as<T>(it->get());
OMEGA_H_CHECK(ncomps == tag->ncomps());
} else {
check_tag_name(name);
OMEGA_H_CHECK(ncomps >= 0);
OMEGA_H_CHECK(ncomps <= Int(INT8_MAX));
OMEGA_H_CHECK(tags_[ent_dim].size() < size_t(INT8_MAX));
tag = new Tag<T>(name, ncomps);
TagPtr ptr(tag);
tags_[ent_dim].push_back(std::move(ptr));
}
/* internal typically indicates migration/adaptation/file reading,
when we do not want any invalidation to take place.
the invalidation is there to prevent users changing coordinates
etc. without updating dependent fields */
if (!internal) react_to_set_tag(ent_dim, name);
tag->set_array(array);
}

@jacobmerson
Copy link
Collaborator

@zhangchonglin is this still a problem for you?

@zhangchonglin
Copy link
Author

I think we can close this as long as we are not using more than 127 components for a mesh tag.

@jacobmerson
Copy link
Collaborator

There are checks in place so Omega_h should crash if you use more than INT8 max. The question is more for you...do you still need more than 127 tags in XGCm?

@zhangchonglin
Copy link
Author

I think we are fine for now as this is mostly a visualization issue.

@zhangchonglin
Copy link
Author

This is fine for XGCm for now.

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

No branches or pull requests

2 participants