Example #1
0
int main(int argc, char * argv[] ) {

	time_t now = time(0);
	int rank ,size;

	SRAssembler* srassembler = NULL;
	try {
		mpi_init(argc,argv);
		size=mpi_get_size();
		rank=mpi_get_rank();

		srassembler = SRAssembler::getInstance(rank);
		int ret = srassembler->init(argc, argv, rank, size);
		if (ret == -1) {
			throw -1;
		}
		srassembler->do_preprocessing();
		srassembler->do_walking();
	} catch (int e) {
		mpi_code code;
		code.action = ACTION_EXIT;
		code.value1 = 0;
		code.value2 = 0;
		mpi_bcast(get_mpi_code_value(code));
		finalized();
		return -1;
	}
	finalized();
	if (rank == 0) {
		string str = "Execution time: " + int2str(time(0) - now) + " seconds";
        srassembler->get_logger()->info(str);
	}
	return 0;
}
Example #2
0
 ~environment()
 {
     if (!initialized_) return; // we are not in control, don't mess up other's logic.
     if (finalized()) return; // MPI is finalized --- don't touch it.
     if (abort_on_exception_ && std::uncaught_exception()) {
         this->abort(255); // FIXME: make the return code configurable?
     }
     MPI_Finalize();
 }
void QuickGlobalStateTransition::finalize() {
    if (m_finalized)
    {
        qCritical() << "GlobalStateTransition: Attempting to finalized an already finalized transition.";
        return;
    }

    m_finalized = true;
    emit finalizedChanged();
    emit finalized(this);
}
Example #4
0
void SyncObject::finishInitializtion() {
    initialized = true;
    qDebug() << "Added SyncObject: " << name << "with" << args.size() << "arguments.";
    emit finalized(this);
}