void TransientMultiApp::resetApp(unsigned int global_app, Real /*time*/) // FIXME: Note that we are passing in time but also grabbing it below { if (hasLocalApp(global_app)) { unsigned int local_app = globalAppToLocal(global_app); // Grab the current time the App is at so we can start the new one at the same place Real time = _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset(); // Extract the file numbers from the output, so that the numbering is maintained after reset std::map<std::string, unsigned int> m = _apps[local_app]->getOutputWarehouse().getFileNumbers(); // Reset the Multiapp MultiApp::resetApp(global_app, time); // Reset the file numbers of the newly reset apps _apps[local_app]->getOutputWarehouse().setFileNumbers(m); MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm); setupApp(local_app, time, false); // Swap back Moose::swapLibMeshComm(swapped); } }
void TransientMultiApp::resetApp( unsigned int global_app, Real /*time*/) // FIXME: Note that we are passing in time but also grabbing it below { if (hasLocalApp(global_app)) { unsigned int local_app = globalAppToLocal(global_app); // Grab the current time the App is at so we can start the new one at the same place Real time = _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset(); // Reset the Multiapp MultiApp::resetApp(global_app, time); Moose::ScopedCommSwapper swapper(_my_comm); // Setup the app, disable the output so that the initial condition does not output // When an app is reset the initial condition was effectively already output before reset FEProblemBase & problem = appProblemBase(local_app); problem.allowOutput(false); setupApp(local_app, time); problem.allowOutput(true); } }
void AgoApp::setup() { setupLogging(); setupAgoConnection(); setupSignals(); setupApp(); setupIoThread(); //Send event app is started //This is useful to monitor app (most of the time systemd restarts app before agosystem find it has crashed) //And it fix enhancement #143 qpid::types::Variant::Map content; content["process"] = appShortName; //no internalid specified, processname is in event content agoConnection->emitEvent("", "event.monitoring.processstarted", content); }
int main( int argc, char *argv[] ){ bool loopEnd = false; clock_t startTime; // handle arguments from the command line handleTerminalInput( argc, argv, inputDataPrefix, outputDataPrefix, flags->graphicalMode, flags->delay, flags->suppressOutput, loopEnd, confFilesCommander, pixelDataFileName, zStepDataFileName, positDataFileName, metadataFileName ); if( loopEnd ) exit( 1 ); atexit( terminateApp ); // if in graphical mode, create screens if( flags->graphicalMode ){ printf( "\n=== GRAPHICAL MODE SELECTED ===\n" ); graphics = new graphInterface(); } else { printf( "\n=== NON-GRAPHICAL MODE SELECTED ===\n" ); graphics = NULL; } // setup application printf( ">>> setConfFiles \n" ); setConfFiles( confFilesCommander, atomTypesFile, scanningParams, moleculeParams, tipParams ); printf( ">>> setupApp() \n" ); setupApp( loopEnd ); if( loopEnd ) exit( 1 ); startTime = clock(); printf( ">>> app->Loop() \n" ); app->loop( 1e6 ); // calculate the time for which the main loop has been executed int minutes, hours; double seconds; getTime( startTime, hours, minutes, seconds ); printf( "\nLoop lasted for %i hours, %i minutes and %lf seconds.\n", hours, minutes, seconds ); // terminate // exportMetadata( metadataFileName ); // exportMetadata( metadataFileName, atomTypesFile, confFilesCommander, minStep, numOfMoleculeInstances, glob_molToDraw_orig, glob_atomToDraw_orig, posProbe, rotProbe, zSampling, scanType, xoffset, yoffset, zoffset, xstep, ystep, zstep, xdim, ydim, zdim, glob_maxIters, glob_dtmax, glob_damping, molOfInterest, hours, minutes, seconds ); exit( 0 ); }
void TransientMultiApp::initialSetup() { MultiApp::initialSetup(); if (!_has_an_app) return; Moose::ScopedCommSwapper swapper(_my_comm); if (_has_an_app) { _transient_executioners.resize(_my_num_apps); // Grab Transient Executioners from each app for (unsigned int i = 0; i < _my_num_apps; i++) setupApp(i); } }
void TransientMultiApp::resetApp(unsigned int global_app, Real /*time*/) // FIXME: Note that we are passing in time but also grabbing it below { if (hasLocalApp(global_app)) { unsigned int local_app = globalAppToLocal(global_app); // Grab the current time the App is at so we can start the new one at the same place Real time = _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset(); // Reset the Multiapp MultiApp::resetApp(global_app, time); MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm); setupApp(local_app, time, false); // Swap back Moose::swapLibMeshComm(swapped); } }
void TransientMultiApp::init() { MultiApp::init(); if (!_has_an_app) return; MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm); if (_has_an_app) { _transient_executioners.resize(_my_num_apps); // Grab Transient Executioners from each app for(unsigned int i=0; i<_my_num_apps; i++) setupApp(i); } // Swap back Moose::swapLibMeshComm(swapped); }