[Runtime.exec] Java et mpi
Bonjour
Sur un cluster disposant de mpi (pour de la parallélisation), je veux lancer l'environnement via une classe Java.
Voici la méthode que j'ai écrit :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
private int lamboot(){
String cmd = "lamboot -ssi boot_rsh_agent 'ssh -x' -ssi rsh_agent 'ssh -x' lamhosts";
System.out.println(cmd);
try{
java.lang.Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
this.error = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream()));
this.stdout = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()));
Thread tout = new Thread(){
public void run(){
String out = "";
try{
while((out = mpiBLAST.this.stdout.readLine())!=null){
System.out.println(out);
}
}
catch(java.io.IOException ioe){
return;
}
}
};
tout.start();
Thread terr = new Thread(){
public void run(){
String err = "";
try{
while((err = mpiBLAST.this.error.readLine())!=null){
System.err.println(err);
}
}
catch(java.io.IOException ioe){
return;
}
}
};
terr.start();
}
catch(IOException ioe){
return 1;
}
catch(InterruptedException ie){
return 1;
}
return 0;
} |
Ok, la méthode n'est pas supère mais là n'est pas le problème.
Mon souci est que lorsque j'invoque le exec, le process lamboot me lance l'aide, synonyme d'une erreur. Pourtant, si je tape la même ligne en shell, tout se passe bien. Y a t'il un détail qui m'a échappé ?
Merci d'avance.
@++