sync lib with memreduce branch