MilesCranmer commited on
Commit
41d0599
1 Parent(s): 683071f

Switch syntax out of to-be-deprecated @spawn

Browse files
Files changed (1) hide show
  1. julia/sr.jl +4 -4
julia/sr.jl CHANGED
@@ -634,7 +634,7 @@ function regEvolCycle(pop::Population, T::Float32)::Population
634
  # Batch over each subsample. Can give 15% improvement in speed; probably moreso for large pops.
635
  # but is ultimately a different algorithm than regularized evolution, and might not be
636
  # as good.
637
- if fast_cycle:
638
  shuffle!(pop.members)
639
  n_evol_cycles = round(Integer, pop.n/ns)
640
  babies = Array{PopMember}(undef, n_evol_cycles)
@@ -830,13 +830,13 @@ function fullRun(niterations::Integer;
830
  hallOfFame = HallOfFame()
831
 
832
  for i=1:npopulations
833
- future = @spawn Population(npop, 3)
834
  push!(allPops, future)
835
  end
836
 
837
  # # 2. Start the cycle on every process:
838
  @sync for i=1:npopulations
839
- @async allPops[i] = @spawn run(fetch(allPops[i]), ncyclesperiteration, verbosity=verbosity)
840
  end
841
  println("Started!")
842
  cycles_complete = npopulations * niterations
@@ -914,7 +914,7 @@ function fullRun(niterations::Integer;
914
  end
915
 
916
  @async begin
917
- allPops[i] = @spawn let
918
  tmp_pop = run(cur_pop, ncyclesperiteration, verbosity=verbosity)
919
  for j=1:tmp_pop.n
920
  if rand() < 0.1
 
634
  # Batch over each subsample. Can give 15% improvement in speed; probably moreso for large pops.
635
  # but is ultimately a different algorithm than regularized evolution, and might not be
636
  # as good.
637
+ if fast_cycle
638
  shuffle!(pop.members)
639
  n_evol_cycles = round(Integer, pop.n/ns)
640
  babies = Array{PopMember}(undef, n_evol_cycles)
 
830
  hallOfFame = HallOfFame()
831
 
832
  for i=1:npopulations
833
+ future = @spawnat :any Population(npop, 3)
834
  push!(allPops, future)
835
  end
836
 
837
  # # 2. Start the cycle on every process:
838
  @sync for i=1:npopulations
839
+ @async allPops[i] = @spawnat :any run(fetch(allPops[i]), ncyclesperiteration, verbosity=verbosity)
840
  end
841
  println("Started!")
842
  cycles_complete = npopulations * niterations
 
914
  end
915
 
916
  @async begin
917
+ allPops[i] = @spawnat :any let
918
  tmp_pop = run(cur_pop, ncyclesperiteration, verbosity=verbosity)
919
  for j=1:tmp_pop.n
920
  if rand() < 0.1