Changeset d2ad151 for tests


Ignore:
Timestamp:
Nov 20, 2022, 10:24:14 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
910e1d0
Parents:
25b0fde
Message:

major update of PRNG

Location:
tests
Files:
1 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/nested_function.txt

    r25b0fde rd2ad151  
    1 total 105
     1total 80
  • tests/PRNG.cfa

    r25b0fde rd2ad151  
    88// Created On       : Wed Dec 29 09:38:12 2021
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Sat Apr  9 15:21:14 2022
    11 // Update Count     : 344
     10// Last Modified On : Sun Nov 20 22:17:35 2022
     11// Update Count     : 377
    1212//
    1313
     
    2222#include <mutex_stmt.hfa>
    2323
     24#ifdef __x86_64__                                                                               // 64-bit architecture
     25#define PRNG PRNG64
     26#else                                                                                                   // 32-bit architecture
     27#define PRNG PRNG32
     28#endif // __x86_64__
     29
    2430#ifdef TIME                                                                                             // use -O2 -nodebug
    2531#define STARTTIME start = timeHiRes()
     
    5460
    5561
    56 uint32_t seed = 1009;
     62unsigned int seed = 1009;
    5763
    5864thread T1 {};
     
    158164#if 1
    159165        PRNG prng;
     166
    160167        if ( seed != 0 ) set_seed( prng, seed );
    161168
     
    164171        for ( 20 ) {
    165172                sout | wd(13, prng( prng )) | nonl;                             // cascading => side-effect functions called in arbitary order
    166                 sout | wd(10, prng( prng, 5 )) | nonl;
    167                 sout | wd(13, prng( prng, 0, 5 ));
     173                sout | wd(10, prng( prng, 5z )) | nonl;
     174                sout | wd(13, prng( prng, 0, 5z ));
    168175        } // for
    169176        sout | sepEnable;
     
    199206        for ( 20 ) {
    200207                sout | wd(13, prng()) | nonl;                                   // cascading => side-effect functions called in arbitary order
    201                 sout | wd(10, prng( 5 )) | nonl;
    202                 sout | wd(13, prng( 0, 5 ));
     208                sout | wd(10, prng( 5z )) | nonl;
     209                sout | wd(13, prng( 0, 5z ));
    203210        } // for
    204211        sout | sepEnable;
     
    235242        for ( 20 ) {
    236243                sout | wd(13, prng( th )) | nonl;                               // cascading => side-effect functions called in arbitary order
    237                 sout | wd(10, prng( th, 5 )) | nonl;
    238                 sout | wd(13, prng( th, 0, 5 ));
     244                sout | wd(10, prng( th, 5z )) | nonl;
     245                sout | wd(13, prng( th, 0, 5z ));
    239246        } // for
    240247        sout | sepEnable;
  • tests/concurrent/barrier/generation.cfa

    r25b0fde rd2ad151  
    3737                for(c; 'A' ~= 'Z') {
    3838                        // Yield for chaos
    39                         yield(prng(this, 10));
     39                        yield( (unsigned)prng(this, 10) );
    4040
    4141                        // Print the generation, no newline because
     
    4343
    4444                        // Yield again for more chaos
    45                         yield(prng(this, 10));
     45                        yield( (unsigned)prng(this, 10) );
    4646
    4747                        // Block on the barrier
  • tests/concurrent/barrier/order.cfa

    r25b0fde rd2ad151  
    3737        for(l; NUM_LAPS) {
    3838                // Yield for chaos
    39                 yield(prng(this, 10));
     39                yield( (unsigned)prng(this, 10) );
    4040
    4141                // Block and what order we arrived
  • tests/concurrent/once.cfa

    r25b0fde rd2ad151  
    3030
    3131                // sometime yields
    32                 yield(prng(this, 3));
     32                yield( (unsigned)prng(this, 3) );
    3333        }
    3434}
  • tests/concurrent/readyQ/leader_spin.cfa

    r25b0fde rd2ad151  
    2626}
    2727
    28 PRNG lead_rng;
     28PRNG64 lead_rng;
    2929volatile unsigned leader;
    3030volatile size_t lead_idx;
    3131
    32 const unsigned nthreads = 17;
    33 const unsigned stop_count = 327;
     32const uint64_t nthreads = 17;
     33const uint64_t stop_count = 327;
    3434
    3535thread$ * the_main;
  • tests/io/away_fair.cfa

    r25b0fde rd2ad151  
    6767                #endif
    6868
    69                 yield( prng( this, 15 ) );
     69                yield( (unsigned)prng( this, 15 ) );
    7070
    7171                #if CFA_HAVE_LINUX_IO_URING_H
  • tests/io/comp_basic.cfa

    r25b0fde rd2ad151  
    5858                block( globals.bar );
    5959
    60                 yield( prng( this, 15 ) );
     60                yield( (unsigned)prng( this, 15 ) );
    6161
    6262                unsigned i = __atomic_add_fetch( &counter, 1, __ATOMIC_SEQ_CST );
  • tests/io/comp_fair.cfa

    r25b0fde rd2ad151  
    7878                block( globals.bar );
    7979
    80                 yield( prng( this, 15 ) );
     80                yield( (unsigned)prng( this, 15 ) );
    8181
    8282                unsigned i = __atomic_add_fetch( &counter, 1, __ATOMIC_SEQ_CST );
Note: See TracChangeset for help on using the changeset viewer.