Fix Semaphore count overflow problem in InplaceReduction.
Fix Semaphore count overflow problem in InplaceReduction.

buaasun/grappa,uwsampa/grappa,alexfrolov/grappa,alexfrolov/grappa,uwsampa/grappa,alexfrolov/grappa,alexfrolov/grappa,buaasun/grappa,uwsampa/grappa,buaasun/grappa,buaasun/grappa,uwsampa/grappa,uwsampa/grappa,alexfrolov/grappa,uwsampa/grappa,buaasun/grappa,uwsampa/grappa,buaasun/grappa,buaasun/grappa,alexfrolov/grappa,alexfrolov/grappa