Skip to content

Conversation

vsht
Copy link
Member

@vsht vsht commented Jun 17, 2020

The idea is to have a useful visualization of calculations that go like

res = Map[evalFun[#]&, aLotOfAmps]

Currently there is no nice way to see

  • How many amplitudes have already been calculated?
  • How many amplitudes still need to be evaluated?

Remaining tasks

  • Terminal output (when no front end is available)
  • Documentation
  • Customizable styles (cf. LiteRed)
  • Timings
  • Unit tests

the progress of an evaluation using Map.
@vsht vsht self-assigned this Jun 17, 2020
@vsht
Copy link
Member Author

vsht commented Aug 11, 2020

This solution
https://mathematica.stackexchange.com/questions/213537/how-to-create-a-progress-bar-using-wolframscript
should be sufficient to make the progress bar work in terminal.

@HBelusca
Copy link
Contributor

HBelusca commented Jan 28, 2021

Would be nice to allow for a parallel version of this (useful when aLotOfAmps is a huge list, and evalFun takes time).
To give you an idea, I often use this sort of construct:

(** Suppose there exists a user-defined $ParallelizeOptions variable that
 ** holds a list of options to control the behaviour of ParallelMap[],
 ** and that parallelization can be controlled with a $Parallelize boolean. **)

len=Length@aLotOfAmps;
Module[{counter}, SetSharedVariable[counter];counter=0;

  Print(*Temporary*)["Element: ", Dynamic[counter], "/", len];

  res = If[$Parallelize, ParallelMap[##, Sequence@@$ParallelizeOptions]&, Map][
          (
            counter++;
            ClearSystemCache[]; (* To clean up as much memory as possible in the parallel kernel *)
            evalFun[#]
          )&
          , #]& @ aLotOfAmps;
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants