Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the runkratos executable #11898

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ jobs:
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \
-DTRILINOS_LIBRARY_PREFIX="trilinos_" \
-DKRATOS_USE_PCH=ON \
-DINSTALL_RUNKRATOS=OFF
-DKRATOS_USE_PCH=ON

# Build
cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j2
Expand Down Expand Up @@ -401,7 +400,6 @@ jobs:
-H"%KRATOS_SOURCE%" ^
-B"%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%" ^
-DBOOST_ROOT="%TEMP%\boost" ^
-DINSTALL_RUNKRATOS=OFF ^
-DCMAKE_CXX_FLAGS="/Od /we4661 /we4804 /WX /wd4996" ^
-DKRATOS_USE_PCH=ON ^
-DFORCE_LOCAL_ZLIB_COMPILATION=ON || goto :error
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/configure.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ cmake ^
-H"%KRATOS_SOURCE%" ^
-B"%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%" ^
-DBOOST_ROOT="%TEMP%\boost" ^
-DINSTALL_RUNKRATOS=OFF ^
-DCMAKE_CXX_FLAGS="/Od /we4661 /we4804 /WX /wd4996" ^
-DFORCE_LOCAL_ZLIB_COMPILATION=ON ^
-DCMAKE_UNITY_BUILD=ON || goto :error
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/intel_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ echo "Kratos build type is ${KRATOS_BUILD_TYPE}"
# Configure
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
${KRATOS_CMAKE_OPTIONS_FLAGS} \
-DINSTALL_RUNKRATOS=OFF \
-DUSE_MPI=ON \
-DPYTHON_EXECUTABLE="/usr/bin/python3.10" \
-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O3 -Wall -Werror-all -diag-disable 1478 -diag-disable 1786" \
Expand Down
20 changes: 0 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ if(NOT DEFINED KRATOS_BINARY_DIR)
set(KRATOS_BINARY_DIR ${CMAKE_BINARY_DIR})
endif(NOT DEFINED KRATOS_BINARY_DIR)

if(NOT DEFINED INSTALL_RUNKRATOS)
message("-- No INSTALL_RUNKRATOS is defined, setting to ON")
set(INSTALL_RUNKRATOS ON)
endif(NOT DEFINED INSTALL_RUNKRATOS)

option(REMOVE_INSTALL_DIRECTORIES "Remove the install directories to achieve a clean compilation" ON)


Expand Down Expand Up @@ -430,16 +425,6 @@ if(${USE_CUDA} MATCHES ON)
find_package(CUDA QUIET REQUIRED)
endif(${USE_CUDA} MATCHES ON)

# Follow the symbolic links for the python lib only if needed
if(${INSTALL_RUNKRATOS} MATCHES ON )
foreach( library ${PYTHON_LIBRARIES})
get_filename_component(python_lib ${library} REALPATH)
set(PYTHON_LIBRARIES_REALPATH ${PYTHON_LIBRARIES_REALPATH} ${python_lib})
endforeach(library)

set(PYTHON_LIBRARIES ${PYTHON_LIBRARIES_REALPATH} CACHE STRING "exact file of the PYTHON library" FORCE)
endif(${INSTALL_RUNKRATOS} MATCHES ON )

##*****************************
# Compiling the triangle library
if(${USE_TRIANGLE_NONFREE_TPL} MATCHES ON )
Expand Down Expand Up @@ -632,11 +617,6 @@ endif(${USE_TRIANGLE_NONFREE_TPL} MATCHES ON )
# Compiling the tinyexpr library
add_subdirectory(${KRATOS_SOURCE_DIR}/external_libraries/tinyexpr)

# runkratos - compiles "runkratos and packages the python lib needed"
if(${INSTALL_RUNKRATOS} MATCHES ON )
add_subdirectory(kratos/run_kratos)
endif(${INSTALL_RUNKRATOS} MATCHES ON )

# Clean the Module and libs install directories
if(${REMOVE_INSTALL_DIRECTORIES} MATCHES ON )
install(CODE "message(STATUS \"Deleting: ${CMAKE_INSTALL_PREFIX}/KratosMultiphysics\")")
Expand Down
3 changes: 0 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,6 @@ Root directory for boost. Overrided by `BOOST_ROOT` environmental variable if de
`-DPYTHON_EXECUTABLE=String`
Python executable to be used. It is recommended to set this option if more than one version of python is present in the system (For example while using ubuntu). Overrided by `PYTHON_EXECUTABLE` environmental variable if defined.

`-DINSTALL_RUNKRATOS=ON/OFF`
Enables(Default) or Disables the compilation of the embedded python interpreter (aka Runkratos).

`-DKRATOS_BUILD_TESTING=ON/OFF`
Enables(Default) or Disables the compilation of the C++ unitary tests for *Kratos* and Applications.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ rem Setting paths. WARNING: one should check them before running this file
set PATH=D:\KratosInstall;F:\KratosInstall\libs;%PATH%

rem Execute the program
D:\KratosInstall\runkratos MainKratos.py > %1.info 2> %1.err
echo "This script was using runkratos. Please contact the developer so he can update it to the new mechanism"
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ rem Setting paths. WARNING: one should check them before running this file
set PATH=D:\KratosInstall;F:\KratosInstall\libs;%PATH%

rem Execute the program
D:\KratosInstall\runkratos MainKratos.py > %1.info 2> %1.err
echo "This script was using runkratos. Please contact the developer so he can update it to the new mechanism"
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ rem Setting paths. WARNING: one should check them before running this file
set PATH=C:\\KratosInstall;C:\\KratosInstall\\libs;%PATH%

rem Execute the program
C:\\KratosInstall\\runkratos MainKratos.py > %1.info 2> %1.err
echo "This script was using runkratos. Please contact the developer so he can update it to the new mechanism"
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
\item right click on "MainKratos.py" and select "edit".
\item Edit the project$\_$paths variable such that it refers to the correct *.gid files. Note that the file paths should stay within the quotation marks.

\item In windows explorer, go to the KratosGeoMechanics directory. In the adress-bar, type in: "cmd" and press "enter", such that command prompt is opened while already referring to the correct directory. In the command prompt, type in: "runkratos MainKratos.py". Now the calculation should start running with as many stages as preferred.
\item In windows explorer, go to the KratosGeoMechanics directory. In the adress-bar, type in: "cmd" and press "enter", such that command prompt is opened while already referring to the correct directory. In the command prompt, type in: "python MainKratos.py". Now the calculation should start running with as many stages as preferred.

\end{enumerate}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
\item In the KratosGeoMechanics directory go to: \newline "applications/GeoMechanicsApplication/custom$\_$problemtype/ \newline GeoMechanicsApplication.gid"

\item right click and edit \textbf{"GeoMechanicsApplication.win.bat"}. Replace all the paths until \textit{"*\textbackslash\textbackslash Kratos"} with the location of the KratosGeoMechanics dir on your local drive. For example :
replace \textit{"D:\textbackslash\textbackslash src\textbackslash\textbackslash Kratos\textbackslash\textbackslash runkratos"} by \newline \textit{"C:\textbackslash\textbackslash Users\textbackslash\textbackslash noordam\textbackslash\textbackslash Downloads\textbackslash\textbackslash KratosGeoMechanics\textbackslash\textbackslash runkratos"}. Note that the double backslashes are required for path separations.
replace \textit{"D:\textbackslash\textbackslash src\textbackslash\textbackslash Kratos\textbackslash\textbackslash python"} by \newline \textit{"C:\textbackslash\textbackslash Users\textbackslash\textbackslash noordam\textbackslash\textbackslash Downloads\textbackslash\textbackslash KratosGeoMechanics\textbackslash\textbackslash python"}. Note that the double backslashes are required for path separations.

\item Copy the \textbf{GeoMechanicsApplication.Gid} problemtype paste it in the GiD problemtypes folder, e.g. : \textit{C:/Program Files/GiD/GiD 14.0.3/problemtypes/}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ \section{Calculate staged construction}
\item right click on "MainKratos.py" and select "edit".
\item Edit the project$\_$paths variable such that it refers to the correct *.gid files. Note that the file paths should stay within the quotation marks.

\item In windows explorer, go to the KratosGeoMechanics directory. In the adress-bar, type in: "cmd" and press "enter", such that command prompt is opened while already referring to the correct directory. In the command prompt, type in: "runkratos MainKratos.py". Now the calculation should start running with as many stages as preferred.
\item In windows explorer, go to the KratosGeoMechanics directory. In the adress-bar, type in: "cmd" and press "enter", such that command prompt is opened while already referring to the correct directory. In the command prompt, type in: "python MainKratos.py". Now the calculation should start running with as many stages as preferred.

\end{enumerate}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ IF %write_python_file%==Copy_From (
)

IF EXIST script.py (
%3\kratos\runkratos.exe script.py > %2\%1.info 2> %2\%1.err
echo "This script was using runkratos. Please contact the developer so he can update it to the new mechanism"
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ As Kratos runs using Python scripts the debugging process using Visual Studio ma

## Preparing the environment

First make sure the code is configured and compiled in `Debug` or `Fulldebug` modes. We recommend you to have a separate build directories for `Release` and `Debug`. Also, to avoid problems, we recommend you to set the `-DINSTALL_RUNKRATOS=OFF` in the configure file to problem problems while building runkratos as most python distributions lack the `python_*_d.lib` variant of the lib.
First make sure the code is configured and compiled in `Debug` or `Fulldebug` modes. We recommend you to have a separate build directories for `Release` and `Debug`.

![](https://user-images.githubusercontent.com/1935791/35916965-859b3fe8-0c0c-11e8-867a-46a0f8f62f69.png)

Expand All @@ -40,4 +40,4 @@ After that just right click in the __Kratos__ -> __Debug__ -> __Start new debug

Notice that you can put breakpoints and stop executions in all applications and components, not only in _Kratos_. Running from _Kratos_ project just serves as an entry point in Visual Studio.

If you have any problem please feel free to open an issue in our project's page: https://github.com/KratosMultiphysics/Kratos/issues
If you have any problem please feel free to open an issue in our project's page: https://github.com/KratosMultiphysics/Kratos/issues
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Add the following lines inside the file:
KratosMultiphysics/
applications/python_scripts/
libpython2.7.so.1.0
runkratos
libs/
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ As illustrated, a no slip condition is applied on the top and bottom walls of th
}]
```
More information on which processes exists for boundary conditions and how to use them is described in [this](How-to-use-Processes-In-the-application-of-BCs) wiki page.
Please run the example by using the method described in the previous tutorials. That is by using the `runkratos` executable. Once the simulation is finished we load the result (.bin) file into GiD to view the following result
Please run the example by using the method described in the previous tutorials. That is by using the `python` executable. Once the simulation is finished we load the result (.bin) file into GiD to view the following result
![Initial_solution](https://raw.githubusercontent.com/KratosMultiphysics/Documentation/master/Wiki_files/workshop_2019_tutorials/solution_manipulation/initial_solution.gif)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ Please, notice that *Kratos* is big and the compilation process can easily take

Once *Kratos* is compiled, you will have to tell the OS where to find the libraries. You need to add to PYTHONPATH (environment variables) the *Kratos* folder, and to PATH (environment variables) the libs folder (usually the kratos_folder/libs).

If you have enabled the embedded python option -DINSTALL_EMBEDDED_PYTHON=ON, you can also add to PATH (environment variables) the *Kratos* folder in order to have the "runkratos" available as a regular command.

## Test

* Objectives:
Expand All @@ -202,9 +200,6 @@ To to tests the compilation, you can execute a simple python script containing t
from KratosMultiphysics import *
```

We strongly recommend you to run kratos scripts with the "runkratos" binary that will be generated inside your Kratos installation folder. You can also run them by using python (if you have compiled with python version 2.x.x), or python3 (if you have compiled with python version 3.x.x)

* runkratos test.py
* python test.py
* python3 test.py

Expand Down
8 changes: 3 additions & 5 deletions docs/pages/Kratos/For_Developers/General/Windows-Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,19 +290,17 @@ The most easy way to execute a KratosMultiphysics script from the command line i

```bash
set PATH=C:\\Kratos;C:\\Kratos\\libs;%PATH%
"C:\\Kratos\\runkratos" test_kratos.py
"python" test_kratos.py
```

We strongly recommend you to run kratos scripts with the `runkratos` binary inside your *Kratos* installation folder, because it gives the correct values to the environment variables.

```bash
runkratos test.py
python test.py
```

Or more exactly, you can go to the folder where your case is (input files and main *python* script) and type:

```bash
path_to_kratos/runkratos test.py
python test.py
```

You can also run them directly using the python you have installed in your system (provided that the system knows where python is and the environment variables have the correct values assigned, `PYTHONPATH`, `LD_LIBRARY_PATH` and `PATH`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ KRATOS_ROOT=/path/to/kratos # Please change this variable
export PYTHONHOME=${KRATOS_ROOT}
export PYTHONPATH=${KRATOS_ROOT}
export LD_LIBRARY_PATH=${KRATOS_ROOT}/libs:${KRATOS_ROOT}/OpenMPI/lib:/home/roigcarlo/KratosInstall/libs
${KRATOS_ROOT}/runkratos $*
python $*
```

Do not forget to give the script execution rights:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ To to tests the compilation, you can execute a simple python script containing t
from KratosMultiphysics import *
```

We strongly recommend you to run kratos scripts with the "runkratos" binary that will be generated inside your Kratos installation folder. You can also run them by using python (if you have compiled with python version 2.x.x), or python3 (if you have compiled with python version 3.x.x)

* runkratos test.py
* python test.py
* python3 test.py

Expand Down Expand Up @@ -406,8 +403,6 @@ If you have enabled the embedded python option -DINSTALL_EMBEDDED_PYTHON=ON, you
echo "export PATH=$PATH:/path/to/my/kratos/installation" >> $HOME/.bashrc
```

In order to have the "runkratos" available as a regular command.

Now each time you open a terminal these commands will be executed and the paths set automatically.
If you don't want to reset your terminal the first time, just execute:

Expand All @@ -426,9 +421,6 @@ To to tests the compilation, you can execute a simple python script containing t
from KratosMultiphysics import *
```

We strongly recommend you to run kratos scripts with the "runkratos" binary that will be generated inside your Kratos installation folder. You can also run them by using python (if you have compiled with python version 2.x.x), or python3 (if you have compiled with python version 3.x.x)

* runkratos test.py
* python test.py
* python3 test.py

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ As illustrated, a no slip condition is applied on the top and bottom walls of th
}]
```
More information on which processes exists for boundary conditions and how to use them is described in [this](https://github.com/KratosMultiphysics/Kratos/wiki/How-to-use-Processes-In-the-application-of-BCs) wiki page.
Please run the example by using the method described in the previous tutorials. That is by using the `runkratos` executable. Once the simulation is finished we load the result (.bin) file into GiD to view the following result
Please run the example by using the method described in the previous tutorials. That is by using the `python` executable. Once the simulation is finished we load the result (.bin) file into GiD to view the following result
![Initial_solution](https://github.com/KratosMultiphysics/Documentation/blob/master/Wiki_files/workshop_2019_tutorials/solution_manipulation/initial_solution.gif)


Expand Down
4 changes: 2 additions & 2 deletions kratos/python_scripts/testing/run_python_mpi_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main():
It takes no parameters and returns no values. The variables that are set by this function, as well as the tests
that are executed, are determined by the command line arguments passed to the function. These arguments include:

-c, --command: The command to use to launch test cases. If not provided, the default 'runkratos' executable is used.
-c, --command: The command to use to launch test cases. If not provided, the default 'python' executable is used.
-l, --level: The minimum level of detail of the tests. Choices are 'mpi_all' (default), 'mpi_nightly', 'mpi_small', and 'mpi_validation'.
-v, --verbosity: The verbosity level. Choices are 0, 1 (default), and 2.
-a, --applications: A list of applications to run, separated by ':'. All compiled applications will be run by default.
Expand All @@ -38,7 +38,7 @@ def main():
# parse command line options
parser = argparse.ArgumentParser()

parser.add_argument('-c', '--command', default=testing_utils.GetPython3Command(), help="Use the provided command to launch test cases. If not provided, the default \'runkratos\' executable is used")
parser.add_argument('-c', '--command', default=testing_utils.GetPython3Command(), help="Use the provided command to launch test cases. If not provided, the default \'python\' executable is used")
parser.add_argument('-l', '--level', default='mpi_all', choices=['mpi_all', 'mpi_nightly', 'mpi_small', 'mpi_validation'], help="Minimum level of detail of the tests: \'all\'(Default) \'(nightly)\' \'(small)\'")
parser.add_argument('-v', '--verbosity', default=1, type=int, choices=[0, 1, 2], help="Verbosity level: 0, 1 (Default), 2")
parser.add_argument('-a', '--applications', default=applications, help="List of applications to run separated by \':\'. All compiled applications will be run by default")
Expand Down
4 changes: 2 additions & 2 deletions kratos/python_scripts/testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def RunTestSuit(self, application, applicationPath, path, level, verbose, comman
detail will be.

command: string
command to be used to call the tests. Ex: Python, Python3, Runkratos
command to be used to call the tests. Ex: Python, Python3

timer: integer
limit time considered to execute the tests
Expand Down Expand Up @@ -165,7 +165,7 @@ def main():
# parse command line options
parser = argparse.ArgumentParser()

parser.add_argument('-c', '--command', default=cmd, help="Use the provided command to launch test cases. If not provided, the default \'runkratos\' executable is used")
parser.add_argument('-c', '--command', default=cmd, help="Use the provided command to launch test cases. If not provided, the default \'python\' executable is used")
parser.add_argument('-l', '--level', default='all', choices=['all', 'nightly', 'small', 'validation'], help="Minimum level of detail of the tests: \'all\'(Default) \'(nightly)\' \'(small)\'")
parser.add_argument('-v', '--verbosity', default=1, type=int, choices=[0, 1, 2], help="Verbosity level: 0, 1 (Default), 2")
parser.add_argument('-a', '--applications', default=applications, help="List of applications to run separated by \':\'. All compiled applications will be run by default")
Expand Down
22 changes: 0 additions & 22 deletions kratos/run_kratos/CMakeLists.txt

This file was deleted.

Loading
Loading