Alpine-DAV / ascent

A flyweight in situ visualization and analysis runtime for multi-physics HPC simulations
https://alpine-dav.github.io/ascent/
Other
200 stars 66 forks source link

Vector arrays #1329

Open cyrush opened 4 months ago

cyrush commented 4 months ago

Discussed in https://github.com/Alpine-DAV/ascent/discussions/1328

Originally posted by **yslan** July 10, 2024 Hi, I wonder what's the proper way to pass a vector field to Ascent. - 3 scalars I know we can break it into scalars like this. ``` mesh_data["fields/velocity_x/association"] = "vertex"; mesh_data["fields/velocity_x/topology"] = "mesh"; mesh_data["fields/velocity_x/values"].set_external((dfloat *)o_u.ptr(), N); mesh_data["fields/velocity_y/association"] = "vertex"; mesh_data["fields/velocity_y/topology"] = "mesh"; mesh_data["fields/velocity_y/values"].set_external((dfloat *)o_v.ptr(), N); mesh_data["fields/velocity_z/association"] = "vertex"; mesh_data["fields/velocity_z/topology"] = "mesh"; mesh_data["fields/velocity_z/values"].set_external((dfloat *)o_w.ptr(), N); ``` And, we can composite back to vector in `ascent_actions.yaml` This approach is robust and well-tested in my code. - vector I've also managed to send the vector like this (Is this the correct way?). ``` mesh_data["fields/velocity/association"] = "vertex"; mesh_data["fields/velocity/topology"] = "mesh"; mesh_data["fields/velocity/values/u"].set_external((dfloat *)o_u.ptr(), N); mesh_data["fields/velocity/values/v"].set_external((dfloat *)o_v.ptr(), N); mesh_data["fields/velocity/values/w"].set_external((dfloat *)o_w.ptr(), N); ``` Then, from vector, it can extract components in `ascent_actions.yaml` - Can we have both? The question occurs when I have both vector and 3-scalars implementation with the same pointer. The idea is to keep "vector of arrays" structure, but also make sure both vector and scalar components are visible in ascent_actions.yaml, which saves a lots of conversion. This works when I run it on CPU backend but it gets SEGV when running with GPU. Both CPU and GPU are tested on Polaris. I appreciate any suggestions. Thanks, Yu-Hsiang
cyrush commented 4 months ago

Second case (presented as a vector field directly) is crashing for GPU case.

jfavre commented 1 month ago

I guess I ran into this particular bug when attempting to validate my CUDA-enabled compilations using the provided test from https://github.com/Alpine-DAV/ascent/pull/1370. This is a very valuable toy example, but it crashes on both of my installations (laptop with RTX CUDA 12.6) and Grace-Hopper nodes (CUDA 12.4). I managed to make the test pass by commenting out the device_move(data["fields/vel/values/?"]) and device_cleanup(data["fields/vel/values/?"]) instructions. The "vel" data is not used anyway in the Ascent actions. Am curious as whether this test passes on a HIP device.