#11 infinite loop in regtest while bogusly waiting for tasks to finish

Current_Trunk
closed
nobody
None
5
2014-03-05
2014-03-03
No

The regtest logic appears to be wrong if I try to run it with 2 OpenMP-threads, while keeping maxtasks at 1.

around line 790 of tools/regtesting/do_regtest:

runningtasks=10000
while (( runningtasks >= maxtasks/(numprocs*OMP_NUM_THREADS) )); do
sleep 1
runningtasks=ls -1 ${dir_out}/status/REGTEST_RUNNING-* 2>/dev/null | wc -l
done

In this case, the denominator is > 1, and bash's integer arithmetic evaluates the right hand side to 0, thus keeping the while-loop running endlessly.

I believe changing the while loop from ">=" to ">" fixes this (at least it does for me) - certainly the inequality should never hold if REGTEST_RUNNING-* is not present.

Discussion

  • Matthias Krack

    Matthias Krack - 2014-03-03

    maxtasks should always be larger (or equal) than numprocs*OMP_NUM_THREADS as it is suggested in the comment for maxtasks in all .conf files in cp2k/tools/regtesting/regtest_conf/. In principle do_regtest should stop if maxtasks is smaller like in your case.

     
  • Michael Banck

    Michael Banck - 2014-03-03

    Fair enough, in this case a check is missing/failing then, it might have gotten lost during the makeover last year, cause I cannot see any off-hand.

    I have to admit I didn't read through all of the regtest configs and assumed maxtasks were the number or cp2k processes I'd like to keep running in parallel. As I have only two cores, I wanted one cp2k process using two threads (to test a psmp build). I'll change my config then.

    For the record, this is the config I was using:

    FORT_C_NAME=gfortran
    dir_base="pwd/../../"
    cp2k_version=psmp
    dir_triplet=uname-uname -m-gfortran
    cp2k_dir=
    maxtasks=1
    export OMP_NUM_THREADS=2
    emptycheck="NO"
    leakcheck="NO"
    quick="quick"
    nobuild="nobuild"
    nosvn="nosvn"

     
  • Matthias Krack

    Matthias Krack - 2014-03-03

    do_regtest returns now an error for your case (just committed). Many thanks for reporting this issue.

     
  • Matthias Krack

    Matthias Krack - 2014-03-05
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks