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

convert 1D shape into largest perfect md shape possible #514

Closed
wants to merge 8 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ def get_multidimensional_slices(
atoms_per_core = app_vertex.get_max_atoms_per_dimension_per_core()
n_atoms = app_vertex.atoms_shape
if len(atoms_per_core) != len(n_atoms):
raise PacmanConfigurationException(
"The length of atoms_per_core doesn't match the number of"
" dimensions")
if len(atoms_per_core) == 1:
sides = round(atoms_per_core[0] ** (1.0 / len(n_atoms)))
if sides ** len(n_atoms) > atoms_per_core[0]:
sides -= 1
atoms_per_core = (sides,) * len(n_atoms)
else:
raise PacmanConfigurationException(
"The length of atoms_per_core doesn't match the number of"
" dimensions")

if len(app_vertex.atoms_shape) == 1:
return get_single_dimension_slices(app_vertex)
Expand Down