예제 #1
0
파일: Log.cpp 프로젝트: DukhangLee/SKIRT
void Log::setupSelfBefore()
{
    SimulationItem::setupSelfBefore();

    ProcessCommunicator* comm;

    try
    {
        // get a pointer to the ProcessCommunicator without performing setup
        // to avoid catching (and hiding) fatal errors during such setup
        comm = find<ProcessCommunicator>(false);
    }
    catch (FatalError)
    {
        return;
    }

    // Do the find operation again, now to perform the setup of the
    // PeerToPeerCommunicator so that the correct rank is initialized
    comm = find<ProcessCommunicator>();

    if (comm->isMultiProc()) setRank(comm->rank());
}