@@ -2072,7 +2072,7 @@ def test_wf_nostate_cachelocations(plugin, tmpdir):
2072
2072
2073
2073
# checking execution time (for unix and cf)
2074
2074
# for win and dask/slurm the time for dir creation etc. might take much longer
2075
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2075
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2076
2076
assert t1 > 2
2077
2077
assert t2 < 0.5
2078
2078
@@ -2128,7 +2128,7 @@ def test_wf_nostate_cachelocations_a(plugin, tmpdir):
2128
2128
assert 8 == results2 .output .out
2129
2129
2130
2130
# for win and dask/slurm the time for dir creation etc. might take much longer
2131
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2131
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2132
2132
# checking execution time (second one should be quick)
2133
2133
assert t1 > 2
2134
2134
# testing relative values (windows or slurm takes much longer to create wf itself)
@@ -2189,7 +2189,7 @@ def test_wf_nostate_cachelocations_b(plugin, tmpdir):
2189
2189
assert 8 == results2 .output .out == results2 .output .out_pr
2190
2190
2191
2191
# for win and dask/slurm the time for dir creation etc. might take much longer
2192
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2192
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2193
2193
# checking execution time
2194
2194
assert t1 > 2
2195
2195
assert t2 < 0.5
@@ -2247,7 +2247,7 @@ def test_wf_nostate_cachelocations_setoutputchange(plugin, tmpdir):
2247
2247
assert 8 == results2 .output .out2
2248
2248
2249
2249
# for win and dask/slurm the time for dir creation etc. might take much longer
2250
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2250
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2251
2251
# checking execution time (the second wf should be fast, nodes do not have to rerun)
2252
2252
assert t1 > 2
2253
2253
# testing relative values (windows or slurm takes much longer to create wf itself)
@@ -2303,7 +2303,7 @@ def test_wf_nostate_cachelocations_setoutputchange_a(plugin, tmpdir):
2303
2303
assert 8 == results2 .output .out2
2304
2304
2305
2305
# for win and dask/slurm the time for dir creation etc. might take much longer
2306
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2306
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2307
2307
# checking execution time (the second wf should be fast, nodes do not have to rerun)
2308
2308
assert t1 > 2
2309
2309
# testing relative values (windows or slurm takes much longer to create wf itself)
@@ -2361,7 +2361,7 @@ def test_wf_nostate_cachelocations_forcererun(plugin, tmpdir):
2361
2361
assert 8 == results2 .output .out
2362
2362
2363
2363
# for win and dask/slurm the time for dir creation etc. might take much longer
2364
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2364
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2365
2365
# checking execution time
2366
2366
assert t1 > 2
2367
2367
assert t2 > 2
@@ -2427,7 +2427,7 @@ def test_wf_nostate_cachelocations_wftaskrerun_propagateTrue(plugin, tmpdir):
2427
2427
assert len (list (Path (cache_dir2 ).glob ("F*" ))) == 2
2428
2428
2429
2429
# for win and dask/slurm the time for dir creation etc. might take much longer
2430
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2430
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2431
2431
assert t1 > 2
2432
2432
assert t2 > 2
2433
2433
@@ -2486,10 +2486,10 @@ def test_wf_nostate_cachelocations_wftaskrerun_propagateFalse(plugin, tmpdir):
2486
2486
assert wf2 .output_dir .exists ()
2487
2487
2488
2488
# for win and dask/slurm the time for dir creation etc. might take much longer
2489
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2489
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2490
2490
# checking the time
2491
2491
assert t1 > 2
2492
- assert t2 > 2
2492
+ assert t2 < 0.5
2493
2493
2494
2494
# tasks should not be recomputed
2495
2495
assert len (list (Path (cache_dir1 ).glob ("F*" ))) == 2
@@ -2545,18 +2545,18 @@ def test_wf_nostate_cachelocations_taskrerun_wfrerun_propagateFalse(plugin, tmpd
2545
2545
results2 = wf2 .result ()
2546
2546
assert 8 == results2 .output .out
2547
2547
2548
- # for win and dask/slurm the time for dir creation etc. might take much longer
2549
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2550
- # checking the execution time
2551
- assert t1 > 2
2552
- assert t2 > 2
2553
- # checking if the second wf doesn't runs again
2554
2548
assert wf1 .output_dir .exists ()
2555
2549
assert wf2 .output_dir .exists ()
2556
2550
# the second task should be recomputed
2557
2551
assert len (list (Path (cache_dir1 ).glob ("F*" ))) == 2
2558
2552
assert len (list (Path (cache_dir2 ).glob ("F*" ))) == 1
2559
2553
2554
+ # for win and dask/slurm the time for dir creation etc. might take much longer
2555
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2556
+ # checking the execution time
2557
+ assert t1 > 2
2558
+ assert t2 > 2
2559
+
2560
2560
2561
2561
def test_wf_nostate_nodecachelocations (plugin , tmpdir ):
2562
2562
"""
@@ -2569,15 +2569,13 @@ def test_wf_nostate_nodecachelocations(plugin, tmpdir):
2569
2569
2570
2570
wf1 = Workflow (name = "wf" , input_spec = ["x" ], cache_dir = cache_dir1 )
2571
2571
wf1 .add (ten (name = "ten" , x = wf1 .lzin .x ))
2572
- wf1 .add (add2_wait (name = "add2" , x = wf1 .ten .lzout .out ))
2572
+ wf1 .add (add2 (name = "add2" , x = wf1 .ten .lzout .out ))
2573
2573
wf1 .set_output ([("out" , wf1 .add2 .lzout .out )])
2574
2574
wf1 .inputs .x = 3
2575
2575
wf1 .plugin = plugin
2576
2576
2577
- t0 = time .time ()
2578
2577
with Submitter (plugin = plugin ) as sub :
2579
2578
sub (wf1 )
2580
- t1 = time .time () - t0
2581
2579
2582
2580
results1 = wf1 .result ()
2583
2581
assert 12 == results1 .output .out
@@ -2589,24 +2587,17 @@ def test_wf_nostate_nodecachelocations(plugin, tmpdir):
2589
2587
cache_locations = cache_dir1 ,
2590
2588
)
2591
2589
wf2 .add (ten (name = "ten" , x = wf2 .lzin .x ))
2592
- wf2 .add (add2_wait (name = "add2" , x = wf2 .ten .lzout .out ))
2590
+ wf2 .add (add2 (name = "add2" , x = wf2 .ten .lzout .out ))
2593
2591
wf2 .set_output ([("out" , wf2 .add2 .lzout .out )])
2594
2592
wf2 .inputs .x = 2
2595
2593
wf2 .plugin = plugin
2596
2594
2597
- t0 = time .time ()
2598
2595
with Submitter (plugin = plugin ) as sub :
2599
2596
sub (wf2 )
2600
- t2 = time .time () - t0
2601
2597
2602
2598
results2 = wf2 .result ()
2603
2599
assert 12 == results2 .output .out
2604
2600
2605
- # for win and dask/slurm the time for dir creation etc. might take much longer
2606
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2607
- # checking the execution time
2608
- assert t1 > 2
2609
- assert t2 > 2
2610
2601
# checking if the second wf runs again, but runs only one task
2611
2602
assert wf1 .output_dir .exists ()
2612
2603
assert wf2 .output_dir .exists ()
@@ -2626,41 +2617,32 @@ def test_wf_nostate_nodecachelocations_upd(plugin, tmpdir):
2626
2617
2627
2618
wf1 = Workflow (name = "wf" , input_spec = ["x" ], cache_dir = cache_dir1 )
2628
2619
wf1 .add (ten (name = "ten" , x = wf1 .lzin .x ))
2629
- wf1 .add (add2_wait (name = "add2" , x = wf1 .ten .lzout .out ))
2620
+ wf1 .add (add2 (name = "add2" , x = wf1 .ten .lzout .out ))
2630
2621
wf1 .set_output ([("out" , wf1 .add2 .lzout .out )])
2631
2622
wf1 .inputs .x = 3
2632
2623
wf1 .plugin = plugin
2633
2624
2634
- t0 = time .time ()
2635
2625
with Submitter (plugin = plugin ) as sub :
2636
2626
sub (wf1 )
2637
- t1 = time .time () - t0
2638
2627
2639
2628
results1 = wf1 .result ()
2640
2629
assert 12 == results1 .output .out
2641
2630
2642
2631
wf2 = Workflow (name = "wf" , input_spec = ["x" , "y" ], cache_dir = cache_dir2 )
2643
2632
wf2 .add (ten (name = "ten" , x = wf2 .lzin .x ))
2644
- wf2 .add (add2_wait (name = "add2" , x = wf2 .ten .lzout .out ))
2633
+ wf2 .add (add2 (name = "add2" , x = wf2 .ten .lzout .out ))
2645
2634
wf2 .set_output ([("out" , wf2 .add2 .lzout .out )])
2646
2635
wf2 .inputs .x = 2
2647
2636
wf2 .plugin = plugin
2648
2637
# updating cache_locations after adding the tasks
2649
2638
wf2 .cache_locations = cache_dir1
2650
2639
2651
- t0 = time .time ()
2652
2640
with Submitter (plugin = plugin ) as sub :
2653
2641
sub (wf2 )
2654
- t2 = time .time () - t0
2655
2642
2656
2643
results2 = wf2 .result ()
2657
2644
assert 12 == results2 .output .out
2658
2645
2659
- # for win and dask/slurm the time for dir creation etc. might take much longer
2660
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2661
- # checking the execution time
2662
- assert t1 > 2
2663
- assert t2 > 2
2664
2646
# checking if the second wf runs again, but runs only one task
2665
2647
assert wf1 .output_dir .exists ()
2666
2648
assert wf2 .output_dir .exists ()
@@ -2719,7 +2701,7 @@ def test_wf_state_cachelocations(plugin, tmpdir):
2719
2701
assert results2 [1 ].output .out == 82
2720
2702
2721
2703
# for win and dask/slurm the time for dir creation etc. might take much longer
2722
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2704
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2723
2705
# checking the execution time
2724
2706
assert t1 > 2
2725
2707
assert t2 < 0.5
@@ -2786,7 +2768,7 @@ def test_wf_state_cachelocations_forcererun(plugin, tmpdir):
2786
2768
assert results2 [1 ].output .out == 82
2787
2769
2788
2770
# for win and dask/slurm the time for dir creation etc. might take much longer
2789
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2771
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2790
2772
# checking the execution time
2791
2773
assert t1 > 2
2792
2774
assert t2 > 2
@@ -2855,7 +2837,7 @@ def test_wf_state_cachelocations_updateinp(plugin, tmpdir):
2855
2837
assert results2 [1 ].output .out == 82
2856
2838
2857
2839
# for win and dask/slurm the time for dir creation etc. might take much longer
2858
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2840
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2859
2841
# checking the execution time
2860
2842
assert t1 > 2
2861
2843
assert t2 < 0.5
@@ -2971,7 +2953,7 @@ def test_wf_nostate_cachelocations_updated(plugin, tmpdir):
2971
2953
assert 8 == results2 .output .out
2972
2954
2973
2955
# for win and dask/slurm the time for dir creation etc. might take much longer
2974
- if sys .platform .startswith ("win" ) and plugin == "cf" :
2956
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
2975
2957
# checking the execution time
2976
2958
assert t1 > 2
2977
2959
assert t2 > 2
@@ -2992,16 +2974,14 @@ def test_wf_nostate_cachelocations_recompute(plugin, tmpdir):
2992
2974
2993
2975
wf1 = Workflow (name = "wf" , input_spec = ["x" , "y" ], cache_dir = cache_dir1 )
2994
2976
wf1 .add (multiply (name = "mult" , x = wf1 .lzin .x , y = wf1 .lzin .y ))
2995
- wf1 .add (add2_wait (name = "add2" , x = wf1 .mult .lzout .out ))
2977
+ wf1 .add (add2 (name = "add2" , x = wf1 .mult .lzout .out ))
2996
2978
wf1 .set_output ([("out" , wf1 .add2 .lzout .out )])
2997
2979
wf1 .inputs .x = 2
2998
2980
wf1 .inputs .y = 3
2999
2981
wf1 .plugin = plugin
3000
2982
3001
- t0 = time .time ()
3002
2983
with Submitter (plugin = plugin ) as sub :
3003
2984
sub (wf1 )
3004
- t1 = time .time () - t0
3005
2985
3006
2986
results1 = wf1 .result ()
3007
2987
assert 8 == results1 .output .out
@@ -3014,16 +2994,14 @@ def test_wf_nostate_cachelocations_recompute(plugin, tmpdir):
3014
2994
)
3015
2995
# different argument assigment
3016
2996
wf2 .add (multiply (name = "mult" , x = wf2 .lzin .y , y = wf2 .lzin .x ))
3017
- wf2 .add (add2_wait (name = "add2" , x = wf2 .mult .lzout .out ))
2997
+ wf2 .add (add2 (name = "add2" , x = wf2 .mult .lzout .out ))
3018
2998
wf2 .set_output ([("out" , wf2 .add2 .lzout .out )])
3019
2999
wf2 .inputs .x = 2
3020
3000
wf2 .inputs .y = 3
3021
3001
wf2 .plugin = plugin
3022
3002
3023
- t0 = time .time ()
3024
3003
with Submitter (plugin = plugin ) as sub :
3025
3004
sub (wf2 )
3026
- t2 = time .time () - t0
3027
3005
3028
3006
results2 = wf2 .result ()
3029
3007
assert 8 == results2 .output .out
@@ -3032,12 +3010,6 @@ def test_wf_nostate_cachelocations_recompute(plugin, tmpdir):
3032
3010
assert wf1 .output_dir .exists ()
3033
3011
assert wf2 .output_dir .exists ()
3034
3012
3035
- # for win and dask/slurm the time for dir creation etc. might take much longer
3036
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3037
- # checking the execution time
3038
- assert t1 > 2
3039
- assert t2 > 2
3040
-
3041
3013
# the second wf should have only one task run
3042
3014
assert len (list (Path (cache_dir1 ).glob ("F*" ))) == 2
3043
3015
assert len (list (Path (cache_dir2 ).glob ("F*" ))) == 1
@@ -3093,7 +3065,7 @@ def test_wf_ndstate_cachelocations(plugin, tmpdir):
3093
3065
assert results2 .output .out == [8 , 82 ]
3094
3066
3095
3067
# for win and dask/slurm the time for dir creation etc. might take much longer
3096
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3068
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
3097
3069
# checking the execution time
3098
3070
assert t1 > 2
3099
3071
assert t2 < 0.5
@@ -3157,7 +3129,7 @@ def test_wf_ndstate_cachelocations_forcererun(plugin, tmpdir):
3157
3129
assert results2 .output .out == [8 , 82 ]
3158
3130
3159
3131
# for win and dask/slurm the time for dir creation etc. might take much longer
3160
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3132
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
3161
3133
# checking the execution time
3162
3134
assert t1 > 2
3163
3135
assert t2 > 2
@@ -3219,7 +3191,7 @@ def test_wf_ndstate_cachelocations_updatespl(plugin, tmpdir):
3219
3191
assert results2 .output .out == [8 , 82 ]
3220
3192
3221
3193
# for win and dask/slurm the time for dir creation etc. might take much longer
3222
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3194
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
3223
3195
# checking the execution time
3224
3196
assert t1 > 2
3225
3197
assert t2 < 0.5
@@ -3282,7 +3254,7 @@ def test_wf_ndstate_cachelocations_recompute(plugin, tmpdir):
3282
3254
assert results2 .output .out == [8 , 10 , 62 , 82 ]
3283
3255
3284
3256
# for win and dask/slurm the time for dir creation etc. might take much longer
3285
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3257
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
3286
3258
# checking the execution time
3287
3259
assert t1 > 2
3288
3260
assert t2 > 2
@@ -3335,7 +3307,7 @@ def test_wf_nostate_runtwice_usecache(plugin, tmpdir):
3335
3307
assert cache_dir_content == os .listdir (wf1 .cache_dir )
3336
3308
3337
3309
# for win and dask/slurm the time for dir creation etc. might take much longer
3338
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3310
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
3339
3311
# checking the execution time
3340
3312
assert t1 > 2
3341
3313
assert t2 < 0.5
@@ -3384,7 +3356,7 @@ def test_wf_state_runtwice_usecache(plugin, tmpdir):
3384
3356
# checking if no new directory is created
3385
3357
assert cache_dir_content == os .listdir (wf1 .cache_dir )
3386
3358
# for win and dask/slurm the time for dir creation etc. might take much longer
3387
- if sys .platform .startswith ("win" ) and plugin == "cf" :
3359
+ if not sys .platform .startswith ("win" ) and plugin == "cf" :
3388
3360
# checking the execution time
3389
3361
assert t1 > 2
3390
3362
assert t2 < 0.5
0 commit comments