Mark's scratchpad for improvements¶
Here I'm just collecting things that seem like we should want to improve them, so that hopefully a priority or feasible thing emerges. So, the current contents will just reflect whatever code I've been looking at lately.
Unify cr->duty, GPU context-to-task mapping into a common high-level object?
High-level GPU things¶
gmx_gpu_info_t carries around bDetectGPUs simply so that we can report on detection appropriately e.g. so that a non-GPU binary doesn't report that no GPUs were found because that is confusing to a user.
gmx_gpu_info_t and gmx_gpu_opt_t both carry n_dev_compatible. We should have a container of detected GPUs, perhaps filter that into a container of compatible GPUs and filter that into a container of GPUs being used (howsoever selected by the user) and
gmx_parse_gpu_ids gives a fatal error if the gpu_id string was set. This should be handled at a higher level. The env variable is being re-used such that its name is no longer accurate. The function is not part of hardware detection, so should live in a different file. It's being called from check_and_update_hw_opt_1 which does not seem best either.
An alternative for GPU context management is an object whose switch method caches which context is active and does not switch unless necessary.
free_cuda_gpu reuses gpuid, and expects both to have an implicit context and to be passed in a GPU. Clarify/fix.