Skip to content

Commit

Permalink
relion_convert_to_tiff: repair issue #985 properly (random shuffle was
Browse files Browse the repository at this point in the history
not guaranteed to give the same result among MPI ranks)
  • Loading branch information
biochem-fan committed Dec 5, 2023
1 parent 3a23106 commit db97177
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/tiff_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ void TIFFConverter::initialise(int _rank, int _total_ranks)
fn_first = fn_in;
}

// Shuffle the input list so that (almost) all MPI processes get new movies
if (do_estimate || total_ranks > 1)
if (do_estimate)
MD.randomiseOrder();

if (fn_first.getExtension() != "mrc" && fn_first.getExtension() != "mrcs" && !EERRenderer::isEER(fn_first))
Expand Down Expand Up @@ -509,9 +508,8 @@ void TIFFConverter::processOneMovie(FileName fn_movie, FileName fn_tiff)
void TIFFConverter::run()
{
long int my_first, my_last;
divide_equally(MD.numberOfObjects(), total_ranks, rank, my_first, my_last); // MPI parallelization

for (long i = my_first; i <= my_last; i++)
for (long i = rank; i < MD.numberOfObjects(); i += total_ranks)
{
FileName fn_movie, fn_tiff;
MD.getValue(EMDL_MICROGRAPH_MOVIE_NAME, fn_movie, i);
Expand Down

0 comments on commit db97177

Please sign in to comment.