[hts-users:02211] Bug Report: Multi-process supporting patch for HTS-demo_CMU-ARCTIC-SLT
- Subject: [hts-users:02211] Bug Report: Multi-process supporting patch for HTS-demo_CMU-ARCTIC-SLT
- From: 康世胤 <kangshiyin@xxxxxxxxx>
- Date: Fri, 4 Sep 2009 14:40:36 +0800
- Delivered-to: hts-users@xxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=VbTIhUr3Uf3ph9iKWQrlgE4uU6Enk/3F8lD4Tj/DlNA=; b=xppzTYzNPuJ/kCHH0WpLttioa+U+9bfGe/M0BHNIq5Xrj6rD4dgRaPDjTm84995Vph cYyRn2LRV4Bg207aQlKGRn/UmmWG/jbGWYD7mtUyb9bUWb0Djny7ysUj2zymWjJBLtOg hynV0IcL4zrm5VnAKLu7fMoNkBvRv4Ut+Q7Vc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Q/f3467s3zd49/uEnSjCnuEiuNlZhmHIxSQ1cx04ZHsWpSXsn1KxiLrASM/sHFXJ/Y 5ysiJKsHySAK/uzi2ZaPFQWL7nC1MocW6chPKTlxF9mDfrNnpf1kwsUeJ9igbwCzJKt3 aO4bPMBHn3absVxKCtTlWH7pCASGI/mj7ozGk=
hi, all
I think there is a potential bug in Multi-process supporting patch for HTS-demo_CMU-ARCTIC-SLT,whoese patch package may called "HHEd-JM-Patch_for_HTS-2.1-demo.tar.bz2".
And this bug may also exist in [hts-users:02210] Multi-process supporting patch for HTS-demo_CMU-ARCTIC-ADAPT
This bug will not impact you if you do everything right while training,
but if you do something wrong in data preparation or use the option "-T 3" in HHEd,
the whole training process may stop and never terminate unless been killed manually, and you can not see any output from HHEd.
In these patches, the following code is used to creat sub processes.
Every child processes write their output to a separate pipe.
if ($pids[$i] = open($subPipe[$i], "-|")) { # Parent
$nSubProc++;
} else { # Child
die "Cannot fork: $!" unless defined $pids[$i];
shell("$HHEd{'trn'} -H $clusmmf{$set} $mdl{$type} -w $clusmmf{$i.$set} $cxc{$i.$type} $lst{'ful'}");
exit;
}
The following code shows that the parent process will not collect the output of child processes untill all child processes terminate.
# Wait all subprocesses to terminate
for ($i=2;$i<=$n+1;$i++) {
waitpid($pids[$i],0);
# Catch output of subprocess
while(readline($subPipe[$i])) {
$subOutput[$i] .= $_;
}
close($subPipe[$i]);
print STDOUT $subOutput[$i];
}
Question is, the size of the pipe buffer is limited. If the child process's output full fill the pipe buffer before it terminates, the pipe will stop the child process and wait the parent process to clear the buffer. The whole training process will be locked here due to the code above.
--
康世胤
Shiyin Kang