Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| """Initializes computations for signal""" | ||
| traj = trajectory_h5(traj_file, vel_flag = not (len(opts) == 1 and opts[0] == 'dens')) | ||
|
|
||
| if os.path.exists(f"qrid.h5"): |
There was a problem hiding this comment.
Bug: Typo in file check prevents loading custom Q-grid
The file existence check uses "qrid.h5" but the correct filename is "qgrid.h5" (missing 'g'). This causes the code to never detect a user's custom Q-grid file even when it exists. The from_file() function in qgrids.py opens "qgrid.h5", and the documentation also references qgrid.h5. Users who create custom Q-grid files following the documentation will find their files silently ignored, with the code falling back to lattice-based grid generation instead.
|
|
||
| start_time_init = time.time() | ||
|
|
||
| mem = info.free/2**20/(comm.size//num_of_devices) |
There was a problem hiding this comment.
Bug: Division by zero when fewer processes than GPUs
The memory calculation mem = info.free/2**20/(comm.size//num_of_devices) causes a ZeroDivisionError when the number of MPI processes is less than the number of GPUs. For example, running with 2 processes on a 4-GPU system results in comm.size//num_of_devices = 2//4 = 0. This is a common scenario when testing or running quick analyses on multi-GPU systems.
GPU modules for the VVCORE library
Note
Introduce a CuPy/MPI-based GPU pipeline for current/density computations with GPU-aware I/O and memory management, and remove the previous MPI/C-extension implementation.
signals.pywith CuPy-based computation ofdens,cur,cur_L,cur_T, including longitudinal/transverse projections and VRAM-aware partitioning.trajectory_reader.pythat reads HDF5 (H5MD) directly to GPU arrays (cupy) and slices frames per-rank.VVCORE.pyentrypoint orchestrating MPI ranks, NVML GPU assignment, GPU memory queries, compute, gather, and HDF5 output.utils.pyhelpers updated for CuPy arrays: index loading fromind.h5, device-to-host transfer (dict_from_device), stacking, saving, and memory splitting (signal_mem).qgrids.pyGPU-branch generators for FCC/BCC/SC and optional file-based grids.device_count_test.py,test-cuda-aware-mpi4py.py,test_parallel_h5py.py,memory_*_test.py) andrun.sh(SLURM example).data/NaBr_T300K.h5.README.mdfor the GPU branch: setup, usage, MPI multi-GPU, configuration, API, and troubleshooting.VVCORElib_mpipackage, CLI scripts (VVCORE_mpi*), C extensions (src/_rho_j_k.c), andsetup.py.Written by Cursor Bugbot for commit bf42977. This will update automatically on new commits. Configure here.