mwhamilton
Technical User
I am essentially trying to create a job queing system. We use a simulator to simulate all of our new hardware designs, and the vhdl simulator is quite slow. The simulator is called with a perl script. I have created a script that checks for machine availability, and also inputs the different test names that should be simulated. I am having one problem when using fork() to spawn processes. Each time I fork, I need to rsh into a different machine on the network. I am not sure when to use system or exec. The simulation takes a long time, so I need multiple simulations running on different machines at the same time. Also, I need to send all of the output back to the original xterm window. Please help! Thanks so much!
# START A NEW CHILD
if ( ( $pid = fork()) == 0 )
{
# CHILD
#Here is where I need to rsh into a new machine
#here is where I need to change directories on the remote machine
#Here is where I need to run the simulation on the remote machine
exit(1);
}
else
{
# PARENT
$children{$pid} = $command_to_execute; #hash links command line to the pid
$count++; #increment number of processes running
}
}
# START A NEW CHILD
if ( ( $pid = fork()) == 0 )
{
# CHILD
#Here is where I need to rsh into a new machine
#here is where I need to change directories on the remote machine
#Here is where I need to run the simulation on the remote machine
exit(1);
}
else
{
# PARENT
$children{$pid} = $command_to_execute; #hash links command line to the pid
$count++; #increment number of processes running
}
}