2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
2015-06-01 15:28:29 +00:00
|
|
|
#include "trick/MonteCarlo.hh"
|
|
|
|
#include "trick/message_proto.h"
|
|
|
|
#include "trick/message_type.h"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
/** @par Detailed Design: */
|
|
|
|
int Trick::MonteCarlo::execute_monte() {
|
|
|
|
|
|
|
|
if (enabled) {
|
|
|
|
if (is_master()) {
|
|
|
|
if (master_init() != 0) {
|
|
|
|
message_publish(MSG_ERROR, "Monte : An error occurred during Monte Carlo initialization. Exiting.\n") ;
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
master();
|
|
|
|
} else {
|
|
|
|
slave_init();
|
2017-03-23 17:22:40 +00:00
|
|
|
execute_as_slave();
|
2015-02-26 15:02:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|