MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / NGS_ParallelRun

Function NGS_ParallelRun

solve/ngsolve.cpp:873–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871
872
873void NGS_ParallelRun (const string & message)
874{
875 TaskManager::SetNumThreads (1);
876
877 NGSOStream::SetGlobalActive (false);
878
879 // make sure to have lapack loaded (important for newer MKL !!!)
880 Matrix<> a(100), b(100), c(100);
881 a = 1; b = 2; c = a*b | Lapack;
882
883
884 if (getenv ("NGSPROFILE"))
885 {
886 stringstream filename;
887 filename << "ngs.prof." << NgMPI_Comm(NG_MPI_COMM_WORLD).Rank();
888 NgProfiler::SetFileName (filename.str());
889 }
890
891 if ( message == "ngs_loadngs" )
892 {
893 // MPI_Comm_dup ( MPI_COMM_WORLD, &ngs_comm);
894 }
895
896
897#ifdef NGS_PYTHON
898 else if (message.substr(0,7) == "ngs_py " )
899 {
900
901 string command = message.substr(7);
902 std::thread( [](string a_command){
903 Parallel_InitPython ();
904 AcquireGIL gil_lock;
905 pythread_id = std::this_thread::get_id();
906 // PythonEnvironment & py_env = PythonEnvironment::getInstance();
907 pyenv.exec(a_command);
908 pythread_id = mainthread_id;
909
910 }, command).detach();
911 }
912#endif
913 return;
914}
915
916
917void Parallel_Exit ()

Callers

nothing calls this directly

Calls 2

Parallel_InitPythonFunction · 0.85
execMethod · 0.80

Tested by

no test coverage detected