diff --git a/.github/workflows/jenkins-trigger.yml b/.github/workflows/jenkins-trigger.yml index eabbb5328..239b3bbaa 100644 --- a/.github/workflows/jenkins-trigger.yml +++ b/.github/workflows/jenkins-trigger.yml @@ -1,4 +1,5 @@ name: Trigger Jenkins CI + # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the main branch @@ -6,20 +7,18 @@ on: branches: [ master ] pull_request: branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel + jobs: - # This workflow contains a single job called "build" - build: - name: Build + trigger-jenkins-job: runs-on: ubuntu-latest steps: - - name: Trigger jenkins job - uses: anaegel/jenkins-githubaction@master + - id: triggerjenkinsjob + uses: mickeygoussetorg/trigger-jenkins-job@v1 with: - url: ${{ secrets.JENKINS_URL }} - job_name: ug-build-pipeline - username: ${{ secrets.JENKINS_USER }} - api_token: ${{ secrets.JENKINS_TOKEN }} - timeout: "3600" - interval: "300" + jenkins-server: ${{ secrets.JENKINS_URL }} # URL of the jenkins server. ex: http://myjenkins.acme.com:8080 + jenkins-job: "ug-build-pipeline" # The name of the jenkins job to run + jenkins-username: ${{ secrets.JENKINS_USER }} # user name for accessing jenkins + jenkins-pat: ${{ secrets.JENKINS_TOKEN }} # personal Access token for accessing Jenkins + poll-time: 90 # how often (seconds) to poll the jenkins server for results + timeout-value: 3600 # How long (seconds) to poll before timing out the action + verbose: true # true/false - turns on extra logging diff --git a/scripts/shell/schedulers/pbs-generic b/scripts/shell/schedulers/pbs-generic index 6e0299eb7..74170d6b2 100755 --- a/scripts/shell/schedulers/pbs-generic +++ b/scripts/shell/schedulers/pbs-generic @@ -34,7 +34,7 @@ function UJS_Submit # PBSnodes="-l select=$nnodes:node_type=rome:mpiprocs=$nppn" - PBSnodes="" + PBSnodes="-l select=$nnodes:ncpus=$nppn:mpiprocs=$nppn" if [ -z "$queue" ]; then @@ -82,7 +82,7 @@ function UJS_Submit exit fi jobid=`echo $jobid | sed 's/\([0-9]*\).*/\1/'` - fi + fi } diff --git a/ugbase/bridge/grid_bridges/file_io_bridge.cpp b/ugbase/bridge/grid_bridges/file_io_bridge.cpp index 0f832ab5c..f22de584d 100644 --- a/ugbase/bridge/grid_bridges/file_io_bridge.cpp +++ b/ugbase/bridge/grid_bridges/file_io_bridge.cpp @@ -35,7 +35,6 @@ #include "lib_grid/multi_grid.h" #include "lib_grid/file_io/file_io.h" #include "lib_grid/file_io/file_io_ugx.h" -#include "lib_grid/file_io/file_io_vtu.h" using namespace std; @@ -78,13 +77,6 @@ bool SaveGridHierarchy(MultiGrid& mg, const char* filename) return SaveGridToFile(mg, mg.get_hierarchy_handler(), filename); } -void SetVTURegionOfInterestIdentifier( char const * regOfInt ) -{ - PROFILE_FUNC_GROUP("grid"); - GridReaderVTU::setRegionOfInterestIdentifier( std::string( regOfInt ) ); - return; -} - void RegisterGridBridge_FileIO(Registry& reg, string parentGroup) { @@ -137,8 +129,7 @@ void RegisterGridBridge_FileIO(Registry& reg, string parentGroup) .add_function("SaveParallelGridLayout", &SaveParallelGridLayout, grp, "", "mg#filename#offset") .add_function("SaveSurfaceViewTransformed", &SaveSurfaceViewTransformed) - .add_function("SaveGridLevelToFile", &SaveGridLevelToFile) - .add_function("SetVTURegionOfInterestIdentifier", static_cast(&SetVTURegionOfInterestIdentifier) ); + .add_function("SaveGridLevelToFile", &SaveGridLevelToFile); } }// end of namespace diff --git a/ugbase/lib_grid/file_io/file_io_vtu.cpp b/ugbase/lib_grid/file_io/file_io_vtu.cpp index 367253fbd..41ab32cd1 100644 --- a/ugbase/lib_grid/file_io/file_io_vtu.cpp +++ b/ugbase/lib_grid/file_io/file_io_vtu.cpp @@ -31,8 +31,6 @@ */ #include "file_io_vtu.h" -#include -#include using namespace std; using namespace rapidxml; @@ -413,8 +411,7 @@ GridReaderVTU::~GridReaderVTU() { } -#if 0 -// original function + bool GridReaderVTU:: parse_file(const char* filename) { @@ -445,81 +442,6 @@ parse_file(const char* filename) // notify derived classes that a new document has been parsed. return new_document_parsed(); } -#else - -bool GridReaderVTU:: -parse_file(const char* filename) -{ - ifstream in(filename, ios::binary); - if(!in) - return false; - - m_filename = filename; - -// get the length of the file - streampos posStart = in.tellg(); - in.seekg(0, ios_base::end); - streampos posEnd = in.tellg(); - streamsize size = posEnd - posStart; - -// go back to the start of the file - in.seekg(posStart); - - char * fileContentOriginal = new char[size + 1]; - - in.read(fileContentOriginal,size); - fileContentOriginal[size] = 0; - in.close(); - - std::string fiCo2Str(fileContentOriginal); - - delete [] fileContentOriginal; - fileContentOriginal = NULL; - - std::string regInf("RegionInfo"); - - if ( fiCo2Str.find(regInf) == std::string::npos && fiCo2Str.find(m_regionOfInterest) != std::string::npos ) - { - // we need to insert the additional string - - std::string regInfLines; - - regInfLines.append( "\n\n"); - - regInfLines.append( "" ); - - std::string insAft( "" ); - - size_t cedava = fiCo2Str.find( insAft ); - - if( cedava == std::string::npos ) - return false; - - size_t insVal = cedava + insAft.size(); - - fiCo2Str.insert( insVal, regInfLines ); - - } - - char* fileContent = m_doc.allocate_string(0, fiCo2Str.size() ); - - strcpy(fileContent, fiCo2Str.c_str()); - - -// parse the xml-data - m_doc.parse<0>(fileContent); - -// notify derived classes that a new document has been parsed. - return new_document_parsed(); -} - -#endif - - bool GridReaderVTU:: new_document_parsed() @@ -539,7 +461,6 @@ new_document_parsed() m_entries.push_back(GridEntry(curNode)); GridEntry& gridEntry = m_entries.back(); - // collect associated subset handlers xml_node<>* curSHNode = curNode->first_node("RegionInfo"); while(curSHNode){ @@ -648,14 +569,6 @@ subset_handler(ISubsetHandler& shOut, vector subsetIndices; read_scalar_data(subsetIndices, regionDataNode, true); - if( subsetIndices.size() != cells.size() ) - { - vector subsetIndicesDbl; - read_scalar_data(subsetIndicesDbl, regionDataNode, true); - - trafoDblVec2Int( subsetIndicesDbl, subsetIndices ); - } - UG_COND_THROW(subsetIndices.size() != cells.size(), "Mismatch regarding number of cells and number of region-indices!"); @@ -859,17 +772,6 @@ create_cells(std::vector& cellsOut, return true; } -void GridReaderVTU:: -trafoDblVec2Int( std::vector const & dblVec, std::vector & intVec ) -{ - intVec = std::vector(); - - for( auto d : dblVec ) - { - intVec.push_back( static_cast( d ) ); - } -} - xml_node<>* GridReaderVTU:: find_child_node_by_argument_value(rapidxml::xml_node<>* parent, diff --git a/ugbase/lib_grid/file_io/file_io_vtu.h b/ugbase/lib_grid/file_io/file_io_vtu.h index 4692ddae7..3ea0c2dd6 100644 --- a/ugbase/lib_grid/file_io/file_io_vtu.h +++ b/ugbase/lib_grid/file_io/file_io_vtu.h @@ -220,12 +220,6 @@ class GridReaderVTU size_t refGridIndex, size_t subsetHandlerIndex); - static std::string const getRegionOfInterestIdentifyer() - { return m_regionOfInterest; } - - static void setRegionOfInterestIdentifier( std::string const & regOfInt ) - { m_regionOfInterest = regOfInt; } - protected: struct SubsetHandlerEntry { @@ -275,8 +269,6 @@ class GridReaderVTU rapidxml::xml_node<>* dataNode, bool clearData = true); - void trafoDblVec2Int( std::vector const & dblVec, std::vector & intVec ); - template void check_indices(std::vector& inds, size_t first, size_t num, size_t max); @@ -295,8 +287,6 @@ class GridReaderVTU /// holds grids which already have been created std::vector m_entries; - - static std::string m_regionOfInterest; // ProMesh standard = "regions", in Braunschweig case often "Material Id", but not always }; diff --git a/ugbase/lib_grid/tools/creator_grid_util.h b/ugbase/lib_grid/tools/creator_grid_util.h index 11df9e6ac..f3676644d 100644 --- a/ugbase/lib_grid/tools/creator_grid_util.h +++ b/ugbase/lib_grid/tools/creator_grid_util.h @@ -40,7 +40,9 @@ namespace ug{ //////////////////////////////////////////////////////////////////////// /** * To Create GridObject directly under UG4-C++ - * instead of ProMesh + * instead of ProMesh: + * + * Functions are copied from plugins/ProMesh/tools/grid_generation_tools.cpp */ template Vertex* CreateVertex(Grid& grid,const TPosition& pos,Grid::VertexAttachmentAccessor >& aaPos ) @@ -56,7 +58,7 @@ Vertex* CreateVertex(Grid& grid,const TPosition& pos,Grid::VertexAttachmentAcces -Edge* CreateEdge(Grid& grid, Vertex* vrts[], const size_t, numVrts){ +Edge* CreateEdge(Grid& grid, Vertex* vrts[], const size_t numVrts){ //uniquify vrts by hash_value: no //The vrts can't be simply uniquified by hash_values since it will change the orientation of vrts. // Hence,it should be generated by aaPos before using this function. @@ -144,7 +146,7 @@ Face* CreateFace(Grid& grid, Vertex* vrts[], const size_t numVrts){ //return CreateFace(grid, avrts, numVrts); }*/ -Volume* CreateVolume(Grid& grid, Vertex* vrts, const size_t numVrts){ +Volume* CreateVolume(Grid& grid, Vertex* vrts[], const size_t numVrts){ //if(numVrts < 4 || numVrts > 8){ UG_ASSERT(numVrts>3 || numVrts<9,"Bad number of vertices! Can't create a volume element from " << numVrts << " vertices."); @@ -209,7 +211,7 @@ void CreatePlane(Grid& grid, const TPosition& upRight, const TPosition& lowLeft, const TPosition& lowRight, - Grid::VertexAttachmentAccessor >& aaPos + Grid::VertexAttachmentAccessor >& aaPos, bool fill) { Vertex* vrts[4];