Skip to content

Function signal_mem, crashes for small cells #2

@justinchen7141

Description

@justinchen7141

if max_mem < mem*alpha:
return int(mem*alpha)//int(max_mem), Nq
else:
return 1, int(Nq*mem*alpha/(max_mem))

Expected Behavior:
Return optimal partitioning of Nq and Nframes for each MPI task, based on the memory available to each MPI rank.

Problem:
For small supercells (small Nq, Natoms), evaluation of memory requirements can be less than one, resulting in invalid partitioning.
int(max_mem)=0 if max_mem less than 1 byte --> divide by 0 error on line 63 in utils.py

Note:
(line 65 does not have a similar problem for large cells (max_mem-->inf), due to safeguard in lines 97-99 in signals.py)

Fix:
utils.py line 63:
OLD: return int(max_mem)
Recommended FIX: return max(1,int(max_mem)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions