finish a version of interface code in bgdallreduce