
# Test ADLB store/retrieve
# Does not use Turbine features

package require turbine 0.0.1

namespace import turbine::string_*

turbine::init $env(TURBINE_ENGINES) $env(ADLB_SERVERS)

if { ! [ adlb::amserver ] } {

    set count 10
    if { [ info exists env(COUNT) ] > 0 } {
        set count $env(COUNT)
    }

    set size [ adlb::size ]
    set rank [ adlb::rank ]
    if { $rank == 0 } {
        puts "COUNT: $count"
    }

    # puts "MPI size: $size"
    for { set i $rank } { $i <= $count } { incr i $size } {
        adlb::create $i string:
        adlb::store $i string:data
    }
} else {
    adlb::server
}

turbine::finalize

puts OK


# Test ADLB store/retrieve
# Does not use Turbine features

package require turbine 0.0.1

namespace import turbine::string_*

turbine::init $env(TURBINE_ENGINES) $env(ADLB_SERVERS)

if { ! [ adlb::amserver ] } {

    set count 10
    if { [ info exists env(COUNT) ] > 0 } {
        set count $env(COUNT)
    }

    set size [ adlb::size ]
    set rank [ adlb::rank ]
    if { $rank == 0 } {
        puts "COUNT: $count"
    }

    # puts "MPI size: $size"
    set r [ expr $rank + 1 ]
    for { set i $r } { $i <= $count } { incr i $size } {
        adlb::create $i string:
        adlb::store $i string:data
    }
} else {
    adlb::server
}

turbine::finalize

puts OK

Fix test: data id=0 is ADLB_DATA_ID_NULL
Fix test: data id=0 is ADLB_DATA_ID_NULL


git-svn-id: 4403cc1077de9de61ebbb06aa07b0a825c555f62@1860 dc4e9af1-7f46-4ead-bba6-71afc04862de
