Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove Java bindings. They are not updated since maybe 10 years
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 12 Jan 2023 11:13:37 +0000 (12:13 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 12 Jan 2023 23:32:57 +0000 (00:32 +0100)
We want to remove MSG and slowly transition to SimGrid 4.

232 files changed:
.circleci/config.yml
.classpath [deleted file]
.github/workflows/jarfile.yml [deleted file]
.gitignore
.gitlab-ci.yml
CMakeLists.txt
ChangeLog
MANIFEST.in
doc/doxygen/FAQ.doc
doc/doxygen/inside.doc
doc/doxygen/inside_cmake.doc
doc/doxygen/inside_release.doc
doc/doxygen/inside_tests.doc
docs/Build.sh
docs/default.nix
docs/requirements.txt
docs/source/Configuring_SimGrid.rst
docs/source/Deploying_your_application.rst
docs/source/Design_goals.rst
docs/source/Installing_SimGrid.rst
docs/source/Introduction.rst
docs/source/Start_your_own_project.rst
docs/source/Tutorial_Algorithms.rst
docs/source/Tutorial_Model-checking.rst
docs/source/_ext/javasphinx/.gitignore [deleted file]
docs/source/_ext/javasphinx/LICENSE [deleted file]
docs/source/_ext/javasphinx/MANIFEST.in [deleted file]
docs/source/_ext/javasphinx/README.md [deleted file]
docs/source/_ext/javasphinx/doc/conf.py [deleted file]
docs/source/_ext/javasphinx/doc/index.rst [deleted file]
docs/source/_ext/javasphinx/javasphinx/__init__.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/apidoc.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/compiler.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/domain.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/extdoc.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/formatter.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/htmlrst.py [deleted file]
docs/source/_ext/javasphinx/javasphinx/util.py [deleted file]
docs/source/_ext/javasphinx/setup.py [deleted file]
docs/source/_templates/breadcrumbs.html
docs/source/app_msg.rst
docs/source/application.rst
docs/source/conf.py
docs/source/index.rst
examples/deprecated/java/CMakeLists.txt [deleted file]
examples/deprecated/java/app/bittorrent/Common.java [deleted file]
examples/deprecated/java/app/bittorrent/Connection.java [deleted file]
examples/deprecated/java/app/bittorrent/Main.java [deleted file]
examples/deprecated/java/app/bittorrent/MessageTask.java [deleted file]
examples/deprecated/java/app/bittorrent/Peer.java [deleted file]
examples/deprecated/java/app/bittorrent/Tracker.java [deleted file]
examples/deprecated/java/app/bittorrent/TrackerTask.java [deleted file]
examples/deprecated/java/app/bittorrent/app-bittorrent.tesh [deleted file]
examples/deprecated/java/app/bittorrent/bittorrent.xml [deleted file]
examples/deprecated/java/app/bittorrent/generate.py [deleted file]
examples/deprecated/java/app/centralizedmutex/Coordinator.java [deleted file]
examples/deprecated/java/app/centralizedmutex/GrantTask.java [deleted file]
examples/deprecated/java/app/centralizedmutex/Main.java [deleted file]
examples/deprecated/java/app/centralizedmutex/Node.java [deleted file]
examples/deprecated/java/app/centralizedmutex/ReleaseTask.java [deleted file]
examples/deprecated/java/app/centralizedmutex/RequestTask.java [deleted file]
examples/deprecated/java/app/centralizedmutex/app-centralizedmutex.tesh [deleted file]
examples/deprecated/java/app/centralizedmutex/centralizedmutex.xml [deleted file]
examples/deprecated/java/app/masterworker/Main.java [deleted file]
examples/deprecated/java/app/masterworker/Master.java [deleted file]
examples/deprecated/java/app/masterworker/README [deleted file]
examples/deprecated/java/app/masterworker/Worker.java [deleted file]
examples/deprecated/java/app/masterworker/app-masterworker.tesh [deleted file]
examples/deprecated/java/app/masterworker/masterworker.xml [deleted file]
examples/deprecated/java/app/pingpong/Main.java [deleted file]
examples/deprecated/java/app/pingpong/PingPongTask.java [deleted file]
examples/deprecated/java/app/pingpong/Receiver.java [deleted file]
examples/deprecated/java/app/pingpong/Sender.java [deleted file]
examples/deprecated/java/app/pingpong/app-pingpong.tesh [deleted file]
examples/deprecated/java/app/tokenring/Main.java [deleted file]
examples/deprecated/java/app/tokenring/RelayRunner.java [deleted file]
examples/deprecated/java/app/tokenring/app-tokenring.tesh [deleted file]
examples/deprecated/java/async/dsend/Main.java [deleted file]
examples/deprecated/java/async/dsend/Receiver.java [deleted file]
examples/deprecated/java/async/dsend/Sender.java [deleted file]
examples/deprecated/java/async/dsend/async-dsend.tesh [deleted file]
examples/deprecated/java/async/waitall/Main.java [deleted file]
examples/deprecated/java/async/waitall/Receiver.java [deleted file]
examples/deprecated/java/async/waitall/Sender.java [deleted file]
examples/deprecated/java/async/waitall/async-waitall.tesh [deleted file]
examples/deprecated/java/async/yield/Main.java [deleted file]
examples/deprecated/java/async/yield/Yielder.java [deleted file]
examples/deprecated/java/async/yield/async-yield.tesh [deleted file]
examples/deprecated/java/cloud/masterworker/Main.java [deleted file]
examples/deprecated/java/cloud/masterworker/Master.java [deleted file]
examples/deprecated/java/cloud/masterworker/Worker.java [deleted file]
examples/deprecated/java/cloud/masterworker/cloud-masterworker.tesh [deleted file]
examples/deprecated/java/cloud/migration/Daemon.java [deleted file]
examples/deprecated/java/cloud/migration/Main.java [deleted file]
examples/deprecated/java/cloud/migration/README [deleted file]
examples/deprecated/java/cloud/migration/Test.java [deleted file]
examples/deprecated/java/cloud/migration/XVM.java [deleted file]
examples/deprecated/java/cloud/migration/cloud-migration.tesh [deleted file]
examples/deprecated/java/dht/chord/ChordTask.java [deleted file]
examples/deprecated/java/dht/chord/Common.java [deleted file]
examples/deprecated/java/dht/chord/FindSuccessorAnswerTask.java [deleted file]
examples/deprecated/java/dht/chord/FindSuccessorTask.java [deleted file]
examples/deprecated/java/dht/chord/GetPredecessorAnswerTask.java [deleted file]
examples/deprecated/java/dht/chord/GetPredecessorTask.java [deleted file]
examples/deprecated/java/dht/chord/Main.java [deleted file]
examples/deprecated/java/dht/chord/Node.java [deleted file]
examples/deprecated/java/dht/chord/NotifyTask.java [deleted file]
examples/deprecated/java/dht/chord/chord.xml [deleted file]
examples/deprecated/java/dht/chord/dht-chord.tesh [deleted file]
examples/deprecated/java/dht/kademlia/Answer.java [deleted file]
examples/deprecated/java/dht/kademlia/Bucket.java [deleted file]
examples/deprecated/java/dht/kademlia/Common.java [deleted file]
examples/deprecated/java/dht/kademlia/Contact.java [deleted file]
examples/deprecated/java/dht/kademlia/FindNodeAnswerTask.java [deleted file]
examples/deprecated/java/dht/kademlia/FindNodeTask.java [deleted file]
examples/deprecated/java/dht/kademlia/KademliaTask.java [deleted file]
examples/deprecated/java/dht/kademlia/Main.java [deleted file]
examples/deprecated/java/dht/kademlia/Node.java [deleted file]
examples/deprecated/java/dht/kademlia/RoutingTable.java [deleted file]
examples/deprecated/java/dht/kademlia/dht-kademlia.tesh [deleted file]
examples/deprecated/java/dht/kademlia/kademlia.xml [deleted file]
examples/deprecated/java/energy/consumption/EnergyConsumer.java [deleted file]
examples/deprecated/java/energy/consumption/Main.java [deleted file]
examples/deprecated/java/energy/consumption/energy-consumption.tesh [deleted file]
examples/deprecated/java/energy/pstate/Main.java [deleted file]
examples/deprecated/java/energy/pstate/PstateRunner.java [deleted file]
examples/deprecated/java/energy/pstate/energy-pstate.tesh [deleted file]
examples/deprecated/java/energy/vm/EnergyVMRunner.java [deleted file]
examples/deprecated/java/energy/vm/Main.java [deleted file]
examples/deprecated/java/energy/vm/energy-vm.tesh [deleted file]
examples/deprecated/java/hostload/LoadRunner.java [deleted file]
examples/deprecated/java/hostload/Main.java [deleted file]
examples/deprecated/java/hostload/hostload.tesh [deleted file]
examples/deprecated/java/process/kill/Killer.java [deleted file]
examples/deprecated/java/process/kill/Main.java [deleted file]
examples/deprecated/java/process/kill/Victim.java [deleted file]
examples/deprecated/java/process/kill/process-kill.tesh [deleted file]
examples/deprecated/java/process/migration/Emigrant.java [deleted file]
examples/deprecated/java/process/migration/Main.java [deleted file]
examples/deprecated/java/process/migration/Policeman.java [deleted file]
examples/deprecated/java/process/migration/process-migration.tesh [deleted file]
examples/deprecated/java/process/startkilltime/Main.java [deleted file]
examples/deprecated/java/process/startkilltime/Sleeper.java [deleted file]
examples/deprecated/java/process/startkilltime/process-startkilltime.tesh [deleted file]
examples/deprecated/java/process/startkilltime/startkilltime.xml [deleted file]
examples/deprecated/java/process/suspend/DreamMaster.java [deleted file]
examples/deprecated/java/process/suspend/LazyGuy.java [deleted file]
examples/deprecated/java/process/suspend/Main.java [deleted file]
examples/deprecated/java/process/suspend/process-suspend.tesh [deleted file]
examples/deprecated/java/task/priority/Main.java [deleted file]
examples/deprecated/java/task/priority/Test.java [deleted file]
examples/deprecated/java/task/priority/priority.xml [deleted file]
examples/deprecated/java/task/priority/task-priority.tesh [deleted file]
examples/deprecated/java/trace/pingpong/Main.java [deleted file]
examples/deprecated/java/trace/pingpong/PingPongTask.java [deleted file]
examples/deprecated/java/trace/pingpong/Receiver.java [deleted file]
examples/deprecated/java/trace/pingpong/Sender.java [deleted file]
examples/deprecated/java/trace/pingpong/trace-pingpong.tesh [deleted file]
include/simgrid/msg.h
setup.py
sonar-project.properties
src/bindings/java/JavaContext.cpp [deleted file]
src/bindings/java/JavaContext.hpp [deleted file]
src/bindings/java/MANIFEST.in [deleted file]
src/bindings/java/jmsg.cpp [deleted file]
src/bindings/java/jmsg.hpp [deleted file]
src/bindings/java/jmsg_as.cpp [deleted file]
src/bindings/java/jmsg_as.hpp [deleted file]
src/bindings/java/jmsg_comm.cpp [deleted file]
src/bindings/java/jmsg_comm.h [deleted file]
src/bindings/java/jmsg_host.cpp [deleted file]
src/bindings/java/jmsg_host.h [deleted file]
src/bindings/java/jmsg_process.cpp [deleted file]
src/bindings/java/jmsg_process.h [deleted file]
src/bindings/java/jmsg_synchro.cpp [deleted file]
src/bindings/java/jmsg_synchro.h [deleted file]
src/bindings/java/jmsg_task.cpp [deleted file]
src/bindings/java/jmsg_task.h [deleted file]
src/bindings/java/jmsg_vm.cpp [deleted file]
src/bindings/java/jmsg_vm.h [deleted file]
src/bindings/java/jtrace.cpp [deleted file]
src/bindings/java/jtrace.h [deleted file]
src/bindings/java/jxbt_utilities.cpp [deleted file]
src/bindings/java/jxbt_utilities.hpp [deleted file]
src/bindings/java/org/simgrid/NativeLib.java [deleted file]
src/bindings/java/org/simgrid/msg/As.java [deleted file]
src/bindings/java/org/simgrid/msg/Comm.java [deleted file]
src/bindings/java/org/simgrid/msg/Host.java [deleted file]
src/bindings/java/org/simgrid/msg/HostFailureException.java [deleted file]
src/bindings/java/org/simgrid/msg/HostNotFoundException.java [deleted file]
src/bindings/java/org/simgrid/msg/JniException.java [deleted file]
src/bindings/java/org/simgrid/msg/Msg.java [deleted file]
src/bindings/java/org/simgrid/msg/MsgException.java [deleted file]
src/bindings/java/org/simgrid/msg/Mutex.java [deleted file]
src/bindings/java/org/simgrid/msg/Process.java [deleted file]
src/bindings/java/org/simgrid/msg/ProcessKilledError.java [deleted file]
src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java [deleted file]
src/bindings/java/org/simgrid/msg/Semaphore.java [deleted file]
src/bindings/java/org/simgrid/msg/Task.java [deleted file]
src/bindings/java/org/simgrid/msg/TaskCancelledException.java [deleted file]
src/bindings/java/org/simgrid/msg/TimeoutException.java [deleted file]
src/bindings/java/org/simgrid/msg/TransferFailureException.java [deleted file]
src/bindings/java/org/simgrid/msg/VM.java [deleted file]
src/bindings/java/org/simgrid/trace/Trace.java [deleted file]
src/kernel/EngineImpl.cpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextThread.hpp
src/simgrid/Exception.cpp
src/xbt/exception.cpp
teshsuite/java/CMakeLists.txt [deleted file]
teshsuite/java/semaphoregc/SemaphoreGC.java [deleted file]
teshsuite/java/semaphoregc/semaphoregc.tesh [deleted file]
teshsuite/java/sleephostoff/SleepHostOff.java [deleted file]
teshsuite/java/sleephostoff/sleephostoff.tesh [deleted file]
teshsuite/s4u/listen_async/listen_async.cpp
tools/cmake/DefinePackages.cmake
tools/cmake/Distrib.cmake
tools/cmake/Documentation.cmake
tools/cmake/Flags.cmake
tools/cmake/Java.cmake [deleted file]
tools/cmake/MakeLib.cmake
tools/cmake/Option.cmake
tools/cmake/Tests.cmake
tools/docker/Dockerfile.tuto-mc
tools/internal/check_dist_archive.exclude
tools/internal/spell_dict.txt
tools/jenkins/Coverage.sh
tools/jenkins/Flags.sh
tools/jenkins/Sanitizers.sh
tools/jenkins/build.sh
tools/simgrid.supp

index 1828d5f..7eafeec 100644 (file)
@@ -19,5 +19,5 @@ jobs:
           name: Configure, build and test da stuff
           command: |
             mkdir _build && cd _build
-            cmake -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_msg=ON -Denable_model-checking=OFF -Denable_compile_optimizations=OFF -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON ..
+            cmake -Denable_documentation=OFF -Denable_coverage=ON -Denable_msg=ON -Denable_model-checking=OFF -Denable_compile_optimizations=OFF -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON ..
             make -j4 tests && ctest -j4 --output-on-failure
diff --git a/.classpath b/.classpath
deleted file mode 100644 (file)
index 32ea6c5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path="src/bindings/java">
-               <attributes>
-                       <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="simgrid/lib"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="*/CMakeFiles/|CMakeFiles/" kind="src" path="examples/deprecated/java"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/.github/workflows/jarfile.yml b/.github/workflows/jarfile.yml
deleted file mode 100644 (file)
index 1bd5f87..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-name: Jar build
-
-on:
-  workflow_dispatch:
-  schedule:
-  # * is a special character in YAML so you have to quote this string
-      - cron:  '0 18 * * 0'
-jobs:
-  build:
-    runs-on: ${{ matrix.config.os }}-latest
-    strategy:
-        matrix:
-          config:
-          - { name: "Ubuntu gcc", os: ubuntu, cc: "gcc", cxx: "g++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
-          - { name: "MacOS clang", os: macos, cc: "clang", cxx: "clang++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
-    steps:
-    - uses: actions/checkout@v2
-     # install dependencies
-    - name: Init options
-      run: |
-          echo "CC=${{ matrix.config.cc }}"   >> $GITHUB_ENV
-          echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
-    - name: Install boost and eigen on ubuntu
-      if: matrix.config.os == 'ubuntu'
-      run: sudo apt-get update && sudo apt-get install -yq libboost-dev libeigen3-dev
-    - name: Install boost and eigen on macos
-      if: matrix.config.os == 'macos'
-      run: brew install boost eigen
-    - name: Build and test jar with Cmake
-      run: |
-          mkdir build
-          cd build
-          cmake -Denable_documentation=OFF -Denable_java=ON -Denable_msg=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF ${{ matrix.config.cmake_extra_options }} -G "${{ matrix.config.generator }}" ..
-          make -j2 simgrid-java_jar java-all
-          ctest -R java --output-on-failure
-    - name: Upload jar
-      uses: actions/upload-artifact@v2
-      with:
-          name: jar-${{ matrix.config.os }}
-          path: build/simgrid.jar
-    - name: Create the failure Message
-      if: ${{ failure() }}
-      run: |
-        echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building JAR file on ${{ matrix.config.name }}! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
-    - uses: mattermost/action-mattermost-notify@master
-      if: ${{ failure() }}
-      env:
-        MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
-        MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
-  create_jar:
-    needs: build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - name: Download all jars from ubuntu
-        uses: actions/download-artifact@v2
-      - name: Build final jar
-        run: |
-           patch=$(grep -r set\(SIMGRID_VERSION_PATCH ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
-           major=$(grep -r set\(SIMGRID_VERSION_MAJOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
-           minor=$(grep -r set\(SIMGRID_VERSION_MINOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
-           if [ $patch -ne 0 ]; then
-             version="$major.$minor.$patch"
-           else
-             version="$major.$minor"
-           fi
-           mkdir content
-           cd content
-           for j in  ubuntu macos ; do unzip -n ../jar-$j/simgrid.jar ; done
-           strip NATIVE/*/*/*.so
-           x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
-           zip -r ../simgrid-${version}.jar *
-      - name: Upload jar
-        uses: actions/upload-artifact@v2
-        with:
-          name: jar-final
-          path: simgrid-*.jar
-      - name: cleanup artifacts
-        uses: geekyeggo/delete-artifact@v1
-        with:
-          name: |
-            jar-ubuntu
-            jar-macos
-      - name: Create the failure Message
-        if: ${{ failure() }}
-        run: |
-          echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when assembling JAR file ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
-      - name: Create the success Message
-        if: ${{ success() }}
-        run: |
-          echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"JAR file built successfully ! You can get it on: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
-      - uses: mattermost/action-mattermost-notify@master
-        env:
-          MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
-          MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
index a7c3963..7587e54 100644 (file)
@@ -38,7 +38,6 @@ src/dag/dax_dtd.l
 src/surf/xml/simgrid_dtd.l
 ### Libraries links
 [Ss]im[Gg]rid-*.tar.gz
-simgrid.jar
 ### Generated files
 _*.c
 include/simgrid/config.h
@@ -63,7 +62,6 @@ manpages/
 build_*/
 build/
 ### Documentation
-docs/source/java
 docs/source/_ext/__pycache__/
 doc/allclasses-frame.html
 doc/allclasses-noframe.html
@@ -94,12 +92,10 @@ doc/html
 doc/index.php
 doc/simgrid.tag
 doc/doxygen/logcategories.doc
-doc/javadoc
 doc/example_lists/
 ### Specific of project
 .settings/
 .csettings/
-examples/deprecated/java/.classpath
 .anjuta
 .anjuta_sym_db.db
 simgrid.anjuta
@@ -287,8 +283,6 @@ examples/smpi/trace/smpi_trace
 teshsuite/kernel/context-defaults/context-defaults
 teshsuite/kernel/simcall-generic/simcall-generic
 teshsuite/kernel/stack-overflow/stack-overflow
-teshsuite/java/semaphoregc/java-semaphoregc_compiled
-teshsuite/java/sleephostoff/java-sleephostoff_compiled
 teshsuite/mc/dwarf/dwarf
 teshsuite/mc/dwarf-expression/dwarf-expression
 teshsuite/mc/mutex-handling/mutex-handling
@@ -863,14 +857,7 @@ teshsuite/xbt/parmap_bench/parmap_bench
 teshsuite/xbt/parmap_test/parmap_test
 teshsuite/xbt/signals/signals
 unit-tests
-#########################################
-## files touched to track the dependencies of java examples
-examples/deprecated/java/*/*/*_compiled
-examples/deprecated/java/*/*_compiled
 /CMakeCache.txt
-simgrid.jar_finalized
-simgrid_full.jar
-src/bindings/java/MANIFEST.MF
 NATIVE/
 VERSION
 include/smpi/mpif.h
index 583e9d5..d8efd80 100644 (file)
@@ -32,24 +32,10 @@ release:
   script:
   - apt-get --allow-releaseinfo-change update
   - apt install -y binutils wget unzip zip
-  # Build the linux version of the jarfile without the boost dependency
-  - cmake -Denable_documentation=OFF -Denable_java=ON -Denable_msg=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF -DLTO_EXTRA_FLAG="auto" .
-  - make VERBOSE=1 -j$(nproc) dist simgrid simgrid-java_jar
-# This cannot work anymore because Java is now built by the modelchecker jenkins configuration, that is not on macosx
-# Please use the github action instead
-#  - make VERBOSE=1 -j$(nproc) dist simgrid simgrid-java_jar
-#  # Get the foreign architectures
-#  - export SGVER=`grep SimGrid ChangeLog|head -n1|sed -e 's/SimGrid (//' -e 's/).*//'`
-#  - wget https://ci.inria.fr/simgrid/job/SimGrid/build_mode=Debug,node=macos/lastSuccessfulBuild/artifact/build/simgrid-${SGVER}/build/simgrid.jar -O simgrid-mac.jar
-#  # Open all jar files, and strip them
-#  - mkdir content ; cd content
-#  - for j in  ../simgrid.jar ../simgrid-mac.jar ; do unzip -n $j ; done
-#  - strip NATIVE/*/*/*.so
-#  - x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
-#  - zip -r ../simgrid-${SGVER}.jar *
+  - cmake -Denable_documentation=OFF -Denable_msg=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF -DLTO_EXTRA_FLAG="auto" .
+  - make VERBOSE=1 -j$(nproc) dist
   artifacts:
     paths:
-#    - simgrid-*.jar
     - simgrid-*.tar.gz
 
 pip:
@@ -72,17 +58,13 @@ pages:
   stage: deploy
   script:
   - pip3 install --requirement docs/requirements.txt
-  - cd docs/source/_ext/javasphinx; python3 setup.py build; python3 setup.py install
-  - cd ../../..
   - LC_ALL=C.UTF-8 ./Build.sh
   - mv build/html ../public
   # - The CSS contains a reference to a font or something, not something we gonna fix on our side
-  # - The javasphinx output does not exist in the git, so the "edit on FramaGit" link is broken.
-  #   I'd like to report this as a bug, but javasphinx seems abandonned upstream.
-#not installed   - linkchecker --ignore-url='.*\.css$' --ignore-url=public/java/org ../public
+#not installed   - linkchecker --ignore-url='.*\.css$' ../public
   # From time to time, we should check external links with the
   # following, but it has a lot of false positive
-  # - linkchecker --ignore-url='.*\.css$' --ignore-url=public/java/org --check-extern ../public
+  # - linkchecker --ignore-url='.*\.css$' --check-extern ../public
   artifacts:
     paths:
     - public
index 583e482..d9e257a 100644 (file)
@@ -19,7 +19,6 @@ message(STATUS "Configuring SimGrid v${release_version}")
 set(SIMGRID_VERSION_STRING "SimGrid version ${release_version}")
 
 set(libsimgrid_version "${release_version}")
-set(libsimgrid-java_version "${release_version}")
 
 # Basic checks on cmake
 cmake_minimum_required(VERSION 3.5)
@@ -264,7 +263,7 @@ set(_Boost_STACKTRACE_HEADERS           "boost/stacktrace.hpp")
 set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
 set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
 
-  if(minimal-bindings) # When we want a minimal jarfile, don't even search for boost optional components
+  if(minimal-bindings) # When we want a minimal python library, don't even search for boost optional components
     message(STATUS "Don't even look for boost optional components, as we build minimal binding libraries.")
     find_package(Boost 1.48)
   else()
@@ -386,10 +385,6 @@ if(enable_model-checking)
   include_directories(${LIBDW_INCLUDE_DIR} ${LIBELF_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
   set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBDW_LIBRARIES}")
   set(SIMGRID_HAVE_MC 1)
-  if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java)
-    message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling the Java bindings.")
-    set(enable_java FALSE)
-  endif()
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-4")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-4")
 else()
@@ -399,10 +394,6 @@ endif()
 mark_as_advanced(PATH_LIBDW_H)
 mark_as_advanced(PATH_LIBDW_LIB)
 
-if(enable_java AND NOT enable_msg)
-  message(FATAL_ERROR "Cannot activate the Java bindings without the MSG module. Either add -Denable_msg=ON or -Denable_java=OFF")
-endif()
-
 if (enable_model-checking AND enable_ns3)
   message(WARNING "Activating both model-checking and ns-3 bindings is considered experimental.")
 endif()
@@ -762,10 +753,6 @@ include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
 ### Make Libs
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
 
-if(enable_java)
-  include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Java.cmake)
-endif()
-
 # Python binding (with pybind11)
 ################
 if((NOT DEFINED enable_python) OR enable_python)
@@ -898,11 +885,6 @@ message("                version .............: ${CMAKE_C_COMPILER_VERSION}")
 message("                is gnu ..............: ${CMAKE_COMPILER_IS_GNUCC}")
 message("        Compiler: C++ ...............: ${CMAKE_CXX_COMPILER} (id: ${CMAKE_CXX_COMPILER_ID})")
 message("                version .............: ${CMAKE_CXX_COMPILER_VERSION}")
-if(${Java_FOUND})
-  message("        Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}")
-  message("                version .............: ${Java_VERSION_STRING}")
-  message("                runtime .............: ${Java_JAVA_EXECUTABLE}")
-endif()
 if(CMAKE_Fortran_COMPILER)
   message("        Compiler: Fortran ...........: ${SMPI_Fortran_COMPILER} (id: ${CMAKE_Fortran_COMPILER_ID})")
   message("                version .............: ${CMAKE_Fortran_COMPILER_VERSION}")
@@ -929,12 +911,6 @@ else()
   message("        Compile ns-3 ................: OFF  (hint: ${NS3_HINT})")
 endif()
 
-if (${Java_FOUND})
-  message("        Compile Java ................: ON")
-  message("          Native lib in jar .........: ${enable_lib_in_jar}")
-else()
-  message("        Compile Java ................: OFF")
-endif()
 if(pybind11_FOUND)
   message("        Compile Python bindings .....: ${enable_python}")
   message("          module ....................: ${PYTHON_MODULE_PREFIX}simgrid${PYTHON_MODULE_EXTENSION}")
index 62641f5..f438862 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@ SimGrid (3.32.1) not released yet (target december 22)
 General:
  - On Windows, you now need to install WSL2 as the native builds are now disabled.
    It was not really working anyway.
+ - Remove the Java bindings: they were completely outdated, limited to the MSG interface.
 
 S4U:
  - Activity::set_remaining() is not public anymore. Use for example
index 54f3015..42031f9 100644 (file)
@@ -390,119 +390,6 @@ include examples/cpp/trace-process-migration/s4u-trace-process-migration.cpp
 include examples/cpp/trace-process-migration/s4u-trace-process-migration.tesh
 include examples/cpp/trace-route-user-variables/s4u-trace-route-user-variables.cpp
 include examples/cpp/trace-route-user-variables/s4u-trace-route-user-variables.tesh
-include examples/deprecated/java/app/bittorrent/Common.java
-include examples/deprecated/java/app/bittorrent/Connection.java
-include examples/deprecated/java/app/bittorrent/Main.java
-include examples/deprecated/java/app/bittorrent/MessageTask.java
-include examples/deprecated/java/app/bittorrent/Peer.java
-include examples/deprecated/java/app/bittorrent/Tracker.java
-include examples/deprecated/java/app/bittorrent/TrackerTask.java
-include examples/deprecated/java/app/bittorrent/app-bittorrent.tesh
-include examples/deprecated/java/app/bittorrent/bittorrent.xml
-include examples/deprecated/java/app/bittorrent/generate.py
-include examples/deprecated/java/app/centralizedmutex/Coordinator.java
-include examples/deprecated/java/app/centralizedmutex/GrantTask.java
-include examples/deprecated/java/app/centralizedmutex/Main.java
-include examples/deprecated/java/app/centralizedmutex/Node.java
-include examples/deprecated/java/app/centralizedmutex/ReleaseTask.java
-include examples/deprecated/java/app/centralizedmutex/RequestTask.java
-include examples/deprecated/java/app/centralizedmutex/app-centralizedmutex.tesh
-include examples/deprecated/java/app/centralizedmutex/centralizedmutex.xml
-include examples/deprecated/java/app/masterworker/Main.java
-include examples/deprecated/java/app/masterworker/Master.java
-include examples/deprecated/java/app/masterworker/README
-include examples/deprecated/java/app/masterworker/Worker.java
-include examples/deprecated/java/app/masterworker/app-masterworker.tesh
-include examples/deprecated/java/app/masterworker/masterworker.xml
-include examples/deprecated/java/app/pingpong/Main.java
-include examples/deprecated/java/app/pingpong/PingPongTask.java
-include examples/deprecated/java/app/pingpong/Receiver.java
-include examples/deprecated/java/app/pingpong/Sender.java
-include examples/deprecated/java/app/pingpong/app-pingpong.tesh
-include examples/deprecated/java/app/tokenring/Main.java
-include examples/deprecated/java/app/tokenring/RelayRunner.java
-include examples/deprecated/java/app/tokenring/app-tokenring.tesh
-include examples/deprecated/java/async/dsend/Main.java
-include examples/deprecated/java/async/dsend/Receiver.java
-include examples/deprecated/java/async/dsend/Sender.java
-include examples/deprecated/java/async/dsend/async-dsend.tesh
-include examples/deprecated/java/async/waitall/Main.java
-include examples/deprecated/java/async/waitall/Receiver.java
-include examples/deprecated/java/async/waitall/Sender.java
-include examples/deprecated/java/async/waitall/async-waitall.tesh
-include examples/deprecated/java/async/yield/Main.java
-include examples/deprecated/java/async/yield/Yielder.java
-include examples/deprecated/java/async/yield/async-yield.tesh
-include examples/deprecated/java/cloud/masterworker/Main.java
-include examples/deprecated/java/cloud/masterworker/Master.java
-include examples/deprecated/java/cloud/masterworker/Worker.java
-include examples/deprecated/java/cloud/masterworker/cloud-masterworker.tesh
-include examples/deprecated/java/cloud/migration/Daemon.java
-include examples/deprecated/java/cloud/migration/Main.java
-include examples/deprecated/java/cloud/migration/README
-include examples/deprecated/java/cloud/migration/Test.java
-include examples/deprecated/java/cloud/migration/XVM.java
-include examples/deprecated/java/cloud/migration/cloud-migration.tesh
-include examples/deprecated/java/dht/chord/ChordTask.java
-include examples/deprecated/java/dht/chord/Common.java
-include examples/deprecated/java/dht/chord/FindSuccessorAnswerTask.java
-include examples/deprecated/java/dht/chord/FindSuccessorTask.java
-include examples/deprecated/java/dht/chord/GetPredecessorAnswerTask.java
-include examples/deprecated/java/dht/chord/GetPredecessorTask.java
-include examples/deprecated/java/dht/chord/Main.java
-include examples/deprecated/java/dht/chord/Node.java
-include examples/deprecated/java/dht/chord/NotifyTask.java
-include examples/deprecated/java/dht/chord/chord.xml
-include examples/deprecated/java/dht/chord/dht-chord.tesh
-include examples/deprecated/java/dht/kademlia/Answer.java
-include examples/deprecated/java/dht/kademlia/Bucket.java
-include examples/deprecated/java/dht/kademlia/Common.java
-include examples/deprecated/java/dht/kademlia/Contact.java
-include examples/deprecated/java/dht/kademlia/FindNodeAnswerTask.java
-include examples/deprecated/java/dht/kademlia/FindNodeTask.java
-include examples/deprecated/java/dht/kademlia/KademliaTask.java
-include examples/deprecated/java/dht/kademlia/Main.java
-include examples/deprecated/java/dht/kademlia/Node.java
-include examples/deprecated/java/dht/kademlia/RoutingTable.java
-include examples/deprecated/java/dht/kademlia/dht-kademlia.tesh
-include examples/deprecated/java/dht/kademlia/kademlia.xml
-include examples/deprecated/java/energy/consumption/EnergyConsumer.java
-include examples/deprecated/java/energy/consumption/Main.java
-include examples/deprecated/java/energy/consumption/energy-consumption.tesh
-include examples/deprecated/java/energy/pstate/Main.java
-include examples/deprecated/java/energy/pstate/PstateRunner.java
-include examples/deprecated/java/energy/pstate/energy-pstate.tesh
-include examples/deprecated/java/energy/vm/EnergyVMRunner.java
-include examples/deprecated/java/energy/vm/Main.java
-include examples/deprecated/java/energy/vm/energy-vm.tesh
-include examples/deprecated/java/hostload/LoadRunner.java
-include examples/deprecated/java/hostload/Main.java
-include examples/deprecated/java/hostload/hostload.tesh
-include examples/deprecated/java/process/kill/Killer.java
-include examples/deprecated/java/process/kill/Main.java
-include examples/deprecated/java/process/kill/Victim.java
-include examples/deprecated/java/process/kill/process-kill.tesh
-include examples/deprecated/java/process/migration/Emigrant.java
-include examples/deprecated/java/process/migration/Main.java
-include examples/deprecated/java/process/migration/Policeman.java
-include examples/deprecated/java/process/migration/process-migration.tesh
-include examples/deprecated/java/process/startkilltime/Main.java
-include examples/deprecated/java/process/startkilltime/Sleeper.java
-include examples/deprecated/java/process/startkilltime/process-startkilltime.tesh
-include examples/deprecated/java/process/startkilltime/startkilltime.xml
-include examples/deprecated/java/process/suspend/DreamMaster.java
-include examples/deprecated/java/process/suspend/LazyGuy.java
-include examples/deprecated/java/process/suspend/Main.java
-include examples/deprecated/java/process/suspend/process-suspend.tesh
-include examples/deprecated/java/task/priority/Main.java
-include examples/deprecated/java/task/priority/Test.java
-include examples/deprecated/java/task/priority/priority.xml
-include examples/deprecated/java/task/priority/task-priority.tesh
-include examples/deprecated/java/trace/pingpong/Main.java
-include examples/deprecated/java/trace/pingpong/PingPongTask.java
-include examples/deprecated/java/trace/pingpong/Receiver.java
-include examples/deprecated/java/trace/pingpong/Sender.java
-include examples/deprecated/java/trace/pingpong/trace-pingpong.tesh
 include examples/python/actor-create/actor-create.py
 include examples/python/actor-create/actor-create.tesh
 include examples/python/actor-daemon/actor-daemon.py
@@ -722,10 +609,6 @@ include examples/sthread/pthread-mutex-simpledeadlock.c
 include examples/sthread/sthread-mutex-simple.c
 include examples/sthread/sthread-mutex-simple.tesh
 include src/include/catch_simgrid.hpp
-include teshsuite/java/semaphoregc/SemaphoreGC.java
-include teshsuite/java/semaphoregc/semaphoregc.tesh
-include teshsuite/java/sleephostoff/SleepHostOff.java
-include teshsuite/java/sleephostoff/sleephostoff.tesh
 include teshsuite/kernel/context-defaults/context-defaults.cpp
 include teshsuite/kernel/context-defaults/factory_boost.tesh
 include teshsuite/kernel/context-defaults/factory_raw.tesh
@@ -1792,20 +1675,6 @@ include docs/source/Tutorial_Algorithms.rst
 include docs/source/Tutorial_MPI_Applications.rst
 include docs/source/Tutorial_Model-checking.rst
 include docs/source/XML_reference.rst
-include docs/source/_ext/javasphinx/LICENSE
-include docs/source/_ext/javasphinx/MANIFEST.in
-include docs/source/_ext/javasphinx/README.md
-include docs/source/_ext/javasphinx/doc/conf.py
-include docs/source/_ext/javasphinx/doc/index.rst
-include docs/source/_ext/javasphinx/javasphinx/__init__.py
-include docs/source/_ext/javasphinx/javasphinx/apidoc.py
-include docs/source/_ext/javasphinx/javasphinx/compiler.py
-include docs/source/_ext/javasphinx/javasphinx/domain.py
-include docs/source/_ext/javasphinx/javasphinx/extdoc.py
-include docs/source/_ext/javasphinx/javasphinx/formatter.py
-include docs/source/_ext/javasphinx/javasphinx/htmlrst.py
-include docs/source/_ext/javasphinx/javasphinx/util.py
-include docs/source/_ext/javasphinx/setup.py
 include docs/source/_ext/showfile.css
 include docs/source/_ext/showfile.js
 include docs/source/_ext/showfile.py
@@ -1899,7 +1768,6 @@ include docs/source/tuto_smpi/roundtrip.c
 include examples/README.rst
 include examples/c/CMakeLists.txt
 include examples/cpp/CMakeLists.txt
-include examples/deprecated/java/CMakeLists.txt
 include examples/platforms/CMakeLists.txt
 include examples/platforms/bypassRoute.xml
 include examples/platforms/bypassZoneRoute.xml
@@ -2106,49 +1974,6 @@ include include/xbt/utility.hpp
 include include/xbt/virtu.h
 include include/xbt/xbt_os_time.h
 include setup.py
-include src/bindings/java/JavaContext.cpp
-include src/bindings/java/JavaContext.hpp
-include src/bindings/java/MANIFEST.in
-include src/bindings/java/jmsg.cpp
-include src/bindings/java/jmsg.hpp
-include src/bindings/java/jmsg_as.cpp
-include src/bindings/java/jmsg_as.hpp
-include src/bindings/java/jmsg_comm.cpp
-include src/bindings/java/jmsg_comm.h
-include src/bindings/java/jmsg_host.cpp
-include src/bindings/java/jmsg_host.h
-include src/bindings/java/jmsg_process.cpp
-include src/bindings/java/jmsg_process.h
-include src/bindings/java/jmsg_synchro.cpp
-include src/bindings/java/jmsg_synchro.h
-include src/bindings/java/jmsg_task.cpp
-include src/bindings/java/jmsg_task.h
-include src/bindings/java/jmsg_vm.cpp
-include src/bindings/java/jmsg_vm.h
-include src/bindings/java/jtrace.cpp
-include src/bindings/java/jtrace.h
-include src/bindings/java/jxbt_utilities.cpp
-include src/bindings/java/jxbt_utilities.hpp
-include src/bindings/java/org/simgrid/NativeLib.java
-include src/bindings/java/org/simgrid/msg/As.java
-include src/bindings/java/org/simgrid/msg/Comm.java
-include src/bindings/java/org/simgrid/msg/Host.java
-include src/bindings/java/org/simgrid/msg/HostFailureException.java
-include src/bindings/java/org/simgrid/msg/HostNotFoundException.java
-include src/bindings/java/org/simgrid/msg/JniException.java
-include src/bindings/java/org/simgrid/msg/Msg.java
-include src/bindings/java/org/simgrid/msg/MsgException.java
-include src/bindings/java/org/simgrid/msg/Mutex.java
-include src/bindings/java/org/simgrid/msg/Process.java
-include src/bindings/java/org/simgrid/msg/ProcessKilledError.java
-include src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java
-include src/bindings/java/org/simgrid/msg/Semaphore.java
-include src/bindings/java/org/simgrid/msg/Task.java
-include src/bindings/java/org/simgrid/msg/TaskCancelledException.java
-include src/bindings/java/org/simgrid/msg/TimeoutException.java
-include src/bindings/java/org/simgrid/msg/TransferFailureException.java
-include src/bindings/java/org/simgrid/msg/VM.java
-include src/bindings/java/org/simgrid/trace/Trace.java
 include src/bindings/python/simgrid_python.cpp
 include src/dag/dax.dtd
 include src/dag/dax_dtd.c
@@ -2694,7 +2519,6 @@ include src/xbt/xbt_replay.cpp
 include src/xbt/xbt_str.cpp
 include src/xbt/xbt_str_test.cpp
 include src/xbt/xbt_virtu.cpp
-include teshsuite/java/CMakeLists.txt
 include teshsuite/kernel/CMakeLists.txt
 include teshsuite/mc/CMakeLists.txt
 include teshsuite/models/CMakeLists.txt
@@ -2745,7 +2569,6 @@ include tools/cmake/DefinePackages.cmake
 include tools/cmake/Distrib.cmake
 include tools/cmake/Documentation.cmake
 include tools/cmake/Flags.cmake
-include tools/cmake/Java.cmake
 include tools/cmake/MaintainerMode.cmake
 include tools/cmake/MakeLib.cmake
 include tools/cmake/Modules/FindGraphviz.cmake
index db3f7cb..1f95d4f 100644 (file)
@@ -78,7 +78,7 @@ this in the real realm.
 If you really need to synchronize your processes (because it's what
 you are studying or to create an atomic section that spans over
 several simcalls), you obviously cannot use regular synchronization
-mechanisms (pthread_mutexes in C or the synchronized keyword in Java).
+mechanisms (pthread_mutexes in C).
 This is because the SimGrid kernel locks all processes and unlock them
 one after the other when they are supposed to run, until they give the
 control back in their simcall. If one of them gets locked by the OS
@@ -88,7 +88,7 @@ deadlock.
 Instead, you should use the synchronization mechanism provided by the
 simulation kernel. This could with a SimGrid mutex, a SimGrid
 condition variables or a SimGrid semaphore, as described in @ref
-msg_synchro (in Java, only semaphores are available). But actually,
+msg_synchro. But actually,
 many synchronization patterns can be encoded with communication on
 mailboxes. Typically, if you need one process to notify another one,
 you could use a condition variable or a semaphore, but sending a
index 5428876..ae804bc 100644 (file)
@@ -107,7 +107,7 @@ create a set of out of tree builds (as explained in @ref
 install_cmake_outsrc) in addition to your main build tree.
 To not mess with git, you want to put your build tree under the build/
 directory, which is ignored by git. For example, I have the following
-directories: build/clang build/java build/full
+directories: build/clang build/full
 (but YMMV).
 
 Then, the problem is that when you traverse these directories, you
index 25dbb36..cbf5d03 100644 (file)
@@ -28,10 +28,7 @@ The examples/ directory is organized as  follows:
  - examples/cpp/ for examples using the S4U API
  - examples/smpi/ or examples using the SMPI API
  - examples/platforms/ only contains platforms descriptions in the XML format (see @ref platform for details)
- - examples/deprecated/java/ for examples using the Java bindings to the MSG API. This directory contains packages (app, async,
-   cloud, ...) which in turn contain individual examples. If your new example fits in an existing package, add it here,
-   or create a new package otherwise.
-
 In each of these directories, there is a CMakeLists.txt file that has
 to be edited to include the new examples.
 
index 068089c..65f20c0 100644 (file)
@@ -31,7 +31,6 @@ Please apply the following checklist before releasing.
     https://framagit.org/simgrid/simgrid-template-s4u/pipelines
     https://framagit.org/simgrid/external-projects-ci/pipelines
   - The python module builds (see below).
-  - The java jarfile builds from the github action
 
 @subsection inside_release_c_releasing Actually releasing SimGrid
 
@@ -49,14 +48,13 @@ Please apply the following checklist before releasing.
 
 - Download the simgrid-doc-3.X.Y (artefact of pipeline 'pages' on framagit)
   Download the tgz file (artefact of the pipeline 'stable' on framagit)
-  Build the jar file using the github action
 - Tag the git repository v3.XX.X and push it to framagit and ghub
 - Document the tag on framagit and ghub
-  - Upload the files simgrid-3.XX.tar.gz, simgrid-3_XX.jar and simgrid-doc-3_XX.zip
+  - Upload the files simgrid-3.XX.tar.gz and simgrid-doc-3_XX.zip
   - Add a link to the version of the ChangeLog that comes with this tag.
     https://framagit.org/simgrid/simgrid/-/blob/v3.29/ChangeLog
 - Update the website
-  - emacs org/org-templates/level-0.org to change the release version, the tgz link and the jar link.
+  - emacs org/org-templates/level-0.org to change the release version and the tgz link.
   - jed .gitlab-ci.yml
     - Change the link to the simgrid-doc-3_XX.zip file
     - Only keep 2 old versions so that people don't find older ones in google
@@ -117,11 +115,11 @@ Release numbering semantic:
     - We have 4 named releases per year (for each equinox and solstice)
     - The ChangeLog and NEWS are complete and informative
     - All tests pass on all ci systems (or the workarounds are documented)
-    - We provide and store a source .tar.gz and a full jarfile on framagit
+    - We provide and store a source .tar.gz on framagit
     - Deprecated symbols remain usable for at least 3 named releases (~1 year)
     - These releases are announced to the users
   - 3.X.Y where Y is even: dot release of 3.X, prerelease of 3.(X+1)
-    - We provide and store a source .tar.gz and a full jarfile on framagit
+    - We provide and store a source .tar.gz on framagit
     - These releases are NOT announced publicly, nor really documented.
       The idea is to have something close to a rolling release.
     - External projects can depend on dot releases to loosen their
index c70b0b6..fe9bfa9 100644 (file)
@@ -191,7 +191,7 @@ dnf install libboost-devel openjdk-8-jdk openjdk-8-jre libxslt-devel libxml2-dev
 pkg_add cmake gcc7 boost boost-headers automake openjdk8 libxslt libxml2 libunwind git htop python36
 
 #opensuse
-zypper install cmake automake clang boost-devel java-1_8_0-openjdk-devel libxslt-devel libxml2-devel xsltproc git python3 libdw-devel libevent-devel libunwind-devel htop binutils ggc7-fortran
+zypper install cmake automake clang boost-devel libxslt-devel libxml2-devel xsltproc git python3 libdw-devel libevent-devel libunwind-devel htop binutils ggc7-fortran
 
 #freebsd
 pkg install boost-libs cmake openjdk8 automake libxslt libxml2 libunwind git htop python3  automake gcc6 flang elfutils libevent
index a6c7aa1..3a1c8b7 100755 (executable)
@@ -32,36 +32,6 @@ else
   set +x
 fi
 
-if [ "x$1" != 'xjava' ] && [ -e source/java ] ; then
-  echo "javasphinx not rerun: 'java' was not provided as an argument"
-else
-  set -x
-  rm -rf source/java
-
-  # Use that script without installing javasphinx: javasphinx-apidoc --force -o source/java/ ../src/bindings/java/org/simgrid/msg
-  PYTHONPATH=${PYTHONPATH}:source/_ext/javasphinx python3 - --force -o source/java/ ../src/bindings/java/org/simgrid/msg <<EOF
-import re
-import sys
-from javasphinx.apidoc import main
-if __name__ == '__main__':
-    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
-    sys.exit(main())
-EOF
-
-  rm -f source/java/packages.rst # api_generated/source_java_packages.rst
-  rm -f source/java/org/simgrid/msg/package-index.rst # api_generated/source_java_org_simgrid_msg_package-index.rst
-  for f in source/java/org/simgrid/msg/* ; do
-    # Add the package name to the page titles
-    (printf "class org.simgrid.msg."; cat $f )>tmp
-    mv tmp $f
-    sed -i 's/==/========================/' $f # That's the right length knowing that I add 'class org.simgrid.msg.'
-  done
-#  sed -i 's/^.. java:type:: public class /.. java:type:: public class org.simgrid.msg/' source/java/org/simgrid/msg/*
-  echo "javasphinx relaunched"
-fi
-
-PYTHONPATH=../lib:source/_ext/javasphinx sphinx-build -M html source build ${SPHINXOPTS} 2>&1
-
 set +x
 
 perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
@@ -85,7 +55,7 @@ done
 
 set +e # Don't fail
 if [ -e /usr/bin/linkchecker ] ; then
-    linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=build/html/_modules  --ignore-url=public/java/org build/html \
+    linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=build/html/_modules build/html \
      | grep -v '^#' \
      | grep -v 'urlname;parentname;baseref;result;warningstring'
   echo "done."
index 7ba4219..3e2622d 100644 (file)
@@ -20,7 +20,6 @@ let
         pythonPackages.sphinx
         pythonPackages.sphinx_rtd_theme
         pythonPackages.breathe
-        javasphinx
         sphinx-tabs
       ];
       phases = [ "unpackPhase" "buildPhase" "installPhase" ];
@@ -35,37 +34,6 @@ let
       '';
     };
 
-    # sphinx extensions (and their dependencies) shenanigans
-    javalang = buildPythonPackage rec {
-      pname = "javalang";
-      version = "0.13.0";
-      src = pythonPackages.fetchPypi {
-        inherit pname version;
-        sha256 = "0k22ldm4xn0sb26qclp5zz0fc9dy589zvvby5ba1d0d5h2jab08n";
-      };
-      buildInputs = with pythonPackages; [ six ];
-      doCheck = false;
-    };
-
-    javasphinx = buildPythonPackage rec {
-      pname = "javasphinx";
-      version = "0.9.15+simgrid";
-      src = pkgs.fetchFromGitHub {
-        owner = "simgrid";
-        repo = pname;
-        rev = "659209069603a5f221596dd039e724cb89b31b82";
-        sha256 = "1nbz822zd2ikzzmpyqsrrpqvlpng72qvl86wcqfn89szbp85c20a";
-      };
-      propagatedBuildInputs = with pythonPackages; [
-        beautifulsoup4
-        docutils
-        javalang
-        future
-        lxml
-        sphinx
-      ];
-    };
-
     sphinx-tabs = pythonPackages.buildPythonPackage rec {
       pname = "sphinx-tabs";
       version = "3.1.0";
index 2d4f477..a98401b 100644 (file)
@@ -4,6 +4,5 @@ sphinx_rtd_theme>=0.5.2
 # sphinx_tabs v1.2.1 is required for Sphinx 2
 sphinx_tabs>=1.2.1
 sphinx_copybutton
-javalang
 beautifulsoup4
 lxml
index 51dc9f8..07b10c0 100644 (file)
@@ -899,8 +899,6 @@ the slowest to the most efficient:
 
  - **thread:** very slow factory using full featured, standard threads.
    They are slow but very standard. Some debuggers or profilers only work with this factory.
- - **java:** Java applications are virtualized onto java threads (that
-   are regular system threads registered to the JVM)
  - **ucontext:** fast factory using System V contexts (Linux and FreeBSD only)
  - **boost:** This uses the `context
    implementation <http://www.boost.org/doc/libs/1_59_0/libs/context/doc/html/index.html>`_
index e3cece2..5e02efe 100644 (file)
@@ -80,10 +80,6 @@ This tag starts a new actor executing the given function on a given host.
    :cpp:func:`MSG_process_create_with_arguments` or
    :cpp:func:`MSG_process_create_with_environment`.
 
-   There is nothing to do in Java, as SimGrid uses introspection abilities to
-   retrieve the classes from their names. You must then use the full class name
-   (including the package name) in your XML file.
-
 :``start_time``: Useful to delay the start of your actor.
 
         -1 starts the actor immediately.
index 956a23d..70e120c 100644 (file)
@@ -57,8 +57,8 @@ actors can proceed and which ones must wait).
 In practice, a SimGrid simulation is a suite of so-called **scheduling
 rounds**, during which all actors that are not currently blocked on a
 simcall get executed. For that, maestro passes the control flow to the
-code of each actor, that are written in either C++, C, Fortran, Python,
-or Java. The control flow then returns to the maestro when the actor
+code of each actor, that are written in either C++, C, Fortran or Python.
+The control flow then returns to the maestro when the actor
 blocks on its next blocking simcall. Note that the time it takes to
 execute the actor code has to be reported to the simulator using
 execution activities. SMPI programs are automatically benchmarked
@@ -85,8 +85,8 @@ Context switching between the actors and maestro is highly optimized
 for the sake of simulation performance. SimGrid provides several
 implementations of this mechanism, called **context factories**. These
 implementations fall into two categories: Preemptive contexts are
-based on full-fledged system threads such as pthread on Linux or Java
-threads in the JVM. They are usually better supported by external
+based on standard system threads from the libstdc library.
+They are usually better supported by external
 debuggers and profiling tools, but less efficient. The most efficient
 factories use non-preemptive mechanisms, such as SysV's ucontexts,
 boost's context, or our own hand-tuned implementation, that is written
index 7c949e0..b04db31 100644 (file)
@@ -21,7 +21,6 @@ following lines, or several lines if you need several languages.
 .. code-block:: console
 
    $ apt install libsimgrid-dev  # if you want to develop in C or C++
-   $ apt install simgrid-java    # if you want to develop in Java
    $ apt install python3-simgrid # if you want to develop in Python
 
 If you use the Nix_ package manager, the latest SimGrid release is packaged as ``simgrid`` in Nixpkgs_.
@@ -44,36 +43,6 @@ email.
 .. _simgrid AUR package: https://aur.archlinux.org/packages/simgrid/
 .. _AUR official documentation: https://wiki.archlinux.org/title/Arch_User_Repository
 
-.. _install_java_precompiled:
-
-Stable Java Package
-^^^^^^^^^^^^^^^^^^^
-
-The jar file can be retrieved from the `Release page
-<https://framagit.org/simgrid/simgrid/-/releases>`_. This file is
-self-contained, including the native components for Linux, macOS and
-Windows. Copy it to your project's classpath and you're set.
-
-Nightly built Java Package
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Head to the corresponding `GitHub Action <https://github.com/simgrid/simgrid/actions/workflows/jarfile.yml>`_
-and pick the last green build. At the bottom of the build page, click on the ``jar-final`` artefact.
-Open this zip file to find the jar you need. This jar can be used under Linux, Mac OSX or Windows, as you wish.
-
-Binary Java Troubleshooting
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Here are some error messages that you may get when trying to use the
-binary Java package.
-
-Your architecture is not supported by this jarfile
-   If your system is not supported, you should compile your
-   own jarfile :ref:`by compiling SimGrid <install_src>` from the source.
-Library not found: boost-context
-   You should obviously install the ``boost-context`` library on your
-   machine, for example with ``apt``.
-
 .. _deprecation_policy:
 
 Version numbering and deprecation
@@ -128,10 +97,6 @@ Eigen3 (optional)
   - On CentOS / Fedora: ``dnf install eigen3-devel``
   - On macOS with homebrew: ``brew install eigen``
   - Use EIGEN3_HINT to specify where it's installed if cmake doesn't find it automatically.
-Java (optional):
-  - Debian / Ubuntu: ``apt install default-jdk libgcj18-dev`` (or
-    any version of libgcj)
-  - macOS: Grab a `full JDK <http://www.oracle.com/technetwork/java/javase/downloads>`_
 
 For platform-specific details, please see below.
 
@@ -252,13 +217,6 @@ enable_documentation (on/OFF)
   as easy as it used to be, and you should probably use the online
   version for now.
 
-enable_java (on/OFF)
-  Generates the java bindings of SimGrid. You must also enable MSG for
-  this to work.
-
-enable_lib_in_jar (ON/off)
-  Embeds the native java bindings into the produced jar file.
-
 enable_lto (ON/off)
   Enables the *Link Time Optimization* in the C++ compiler.
   This feature really speeds up the code produced, but it is fragile
@@ -293,7 +251,7 @@ enable_smpi_MPICH3_testsuite (on/OFF)
 
 minimal-bindings (on/OFF)
   Take as few optional dependencies as possible, to get minimal
-  library bindings in Java and Python.
+  library bindings in Python.
 
 NS3_HINT (empty by default)
   Alternative path into which ns-3 should be searched for.
@@ -359,7 +317,6 @@ if some do not work for you.
 - **make tests**: Build the tests and examples.
 - **make simgrid**: Build only the SimGrid library. Not any example nor the helper tools.
 - **make s4u-comm-pingpong**: Build only this example (works for any example)
-- **make java-all**: Build all Java examples and their dependencies
 - **make python-bindings**: Build the Python bindings
 - **make clean**: Clean the results of a previous compilation
 - **make install**: Install the project (doc/ bin/ lib/ include/)
@@ -457,45 +414,6 @@ simgrid without downloading the source with pip:
 
   $ pip install simgrid
 
-Java-specific instructions
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Once you have the `full JDK <http://www.oracle.com/technetwork/java/javase/downloads>`_ installed,
-things should be as simple as:
-
-.. code-block:: console
-
-   $ cmake -Denable_java=ON -Dminimal-bindings=ON .
-   $ make  simgrid-java_jar # Only build the jarfile
-
-After the compilation, the file ```simgrid.jar``` is produced in the
-root directory.
-
-**Troubleshooting Java Builds**
-
-Sometimes, the build system fails to find the JNI headers. First locate them as follows:
-
-.. code-block:: console
-
-  $ locate jni.h
-  /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h
-  /usr/lib/jvm/java-9-openjdk-amd64/include/jni.h
-  /usr/lib/jvm/java-10-openjdk-amd64/include/jni.h
-
-
-Then, set the JAVA_INCLUDE_PATH environment variable to the right
-path, and relaunch cmake. If you have several versions of JNI installed
-(as above), pick the one corresponding to the report of
-``javac -version``
-
-.. code-block:: console
-
-  $ export JAVA_INCLUDE_PATH=/usr/lib/jvm/java-8-openjdk-amd64/include/
-  $ cmake -Denable_java=ON .
-  $ make
-
-Note that the filename ```jni.h``` was removed from the path.
-
 Linux Multi-Arch specific instructions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
index 572c667..98be836 100644 (file)
@@ -84,7 +84,7 @@ To ease such questioning, you really should logically separate these
 parts in your experimental setup. It is seen as a very bad practice to
 merge the application, the platform, and the deployment altogether.
 SimGrid is versatile and your mileage may vary, but you should start
-with your Application specified as a C++ or Java program, using one of
+with your Application specified as a C++ or Python program, using one of
 the provided XML platform files, and with your deployment in a separate
 XML file.
 
index 4fa7172..3d131a7 100644 (file)
@@ -130,27 +130,6 @@ in the CDT GCC Built-in compiler settings.
 .. image:: /img/eclipseScreenShot.png
    :align: center
 
-
-Building the Java examples in Eclipse
--------------------------------------
-
-If you want to build our Java examples in Eclipse, get the whole
-source code and open the archive on your disk. In Eclipse, select
-the menu "File / Import", and then in the wizard "General / Existing
-Project into Workspace". On the next page, select the directory
-"examples/deprecated/java" that you can find in the SimGrid source tree as a root
-directory and finish the creation.
-
-The file ``simgrid.jar`` must be in the root directory of the SimGrid
-tree. That's where it is built by default, but if you don't want to
-compile it yourself, just grab that file from the SimGrid website and
-copy it in here.
-
-Please note that once you better understand SimGrid, you should not
-modify the examples directly but instead create your own project in
-eclipse. This will make it easier to upgrade to another version of
-SimGrid.
-
 .. _install_yours_troubleshooting:
 
 Troubleshooting your Project Setup
index 7d9ca41..d539895 100644 (file)
@@ -1002,12 +1002,6 @@ After this Tutorial
 This tutorial is now terminated. You could keep reading the online documentation and
 tutorials, or you could head up to the :ref:`example section <s4u_examples>` to read some code.
 
-.. todo::
-
-   Things to improve in the future:
-
-   - Propose equivalent exercises and skeleton in Java once we fix the Java binding.
-
 .. |br| raw:: html
 
    <br />
index b74ef33..59d995b 100644 (file)
@@ -42,7 +42,7 @@ Getting Mc SimGrid
 ------------------
 
 It is included in the SimGrid source code, but it is not compiled in by default as it induces a small performance overhead to the
-simulations. It is also not activated in the Debian package, nor in the Java or Python binary distributions. If you just plan to
+simulations. It is also not activated in the Debian package, nor in the Python binary distributions. If you just plan to
 experiment with Mc SimGrid, the easiest is to get the corresponding docker image. On the long term, you probably want to install it on
 your machine: it works out of the box on Linux, Windows (with WSL2) and FreeBSD. Simply request it from cmake (``cmake
 -Denable_model-checking .``) and then compile SimGrid :ref:`as usual <install_src>`. Unfortunately, Mc SimGrid does not work natively
diff --git a/docs/source/_ext/javasphinx/.gitignore b/docs/source/_ext/javasphinx/.gitignore
deleted file mode 100644 (file)
index 03ecc2b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-*.pyc
-dist/
-*.egg-info/
-.vscode
-.DS_Store
\ No newline at end of file
diff --git a/docs/source/_ext/javasphinx/LICENSE b/docs/source/_ext/javasphinx/LICENSE
deleted file mode 100644 (file)
index d645695..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/docs/source/_ext/javasphinx/MANIFEST.in b/docs/source/_ext/javasphinx/MANIFEST.in
deleted file mode 100644 (file)
index 9561fb1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include README.rst
diff --git a/docs/source/_ext/javasphinx/README.md b/docs/source/_ext/javasphinx/README.md
deleted file mode 100644 (file)
index a523ad2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# javasphinx
-
-[![Documentation Status](https://readthedocs.org/projects/bronto-javasphinx/badge/?version=latest)](http://bronto-javasphinx.readthedocs.io/en/latest/?badge=latest)
-
-**This project is no longer maintained and should be used for historical purposes only.**
-
-javasphinx is an extension to the Sphinx documentation system which adds support for documenting Java projects. It includes a Java domain for writing documentation manually and a javasphinx-apidoc utility which will automatically generate API documentation from existing Javadoc markup.
-
-javasphinx is available in the Python Package Index (PyPi) under the name _javasphinx_ and can be installed using tools such as `pip` or `easy_install`.
-
-Documentation for javasphinx is available at http://bronto-javasphinx.readthedocs.io
diff --git a/docs/source/_ext/javasphinx/doc/conf.py b/docs/source/_ext/javasphinx/doc/conf.py
deleted file mode 100644 (file)
index de52125..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-project = 'javasphinx'
-version = '0.9.15'
-release = version
-
-extensions = ['javasphinx']
-
-master_doc = 'index'
-copyright = u'2012-2017, Bronto Software Inc. and contributors'
-primary_domain = 'rst'
diff --git a/docs/source/_ext/javasphinx/doc/index.rst b/docs/source/_ext/javasphinx/doc/index.rst
deleted file mode 100644 (file)
index 8780a23..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-
-#######################
-javasphinx User's Guide
-#######################
-
-Welcome to the javasphinx user's guide.
-
-Introduction
-============
-
-javasphinx is a Sphinx_ extension that provides a Sphinx domain_ for documenting
-Java projects and a ``javasphinx-apidoc`` command line tool for automatically
-generating API documentation from existing Java source code and Javadoc
-documentation.
-
-.. _Sphinx: http://sphinx-doc.org
-.. _domain: http://sphinx-doc.org/domains.html
-
-Installing
-==========
-
-javasphinx is available in the Python Package Index (PyPi) and can be installed
-using tools such as ``pip`` or ``easy_install``,
-
-.. code-block:: sh
-
-   $ pip install javasphinx
-
-or,
-
-.. code-block:: sh
-
-   $ easy_install -U javasphinx
-
-Configuration
-=============
-
-To enable javasphinx for your existing Sphinx configuration add ``'javasphinx'``
-to the list of extensions in your conf.py file. javasphinx can be configured to
-cross link to external sources of documentation using the ``javadoc_url_map``
-option,
-
-.. code-block:: python
-
-   javadoc_url_map = {
-       'com.netflix.curator' : ('http://netflix.github.com/curator/doc', 'javadoc'),
-       'org.springframework' : ('http://static.springsource.org/spring/docs/3.1.x/javadoc-api/', 'javadoc'),
-       'org.springframework.data.redis' : ('http://static.springsource.org/spring-data/data-redis/docs/current/api/', 'javadoc')
-   }
-
-Each key in the map should be a Java package. Each value is a tuple of the form
-``(base_url, doc_type)`` where ``base_url`` is the base URL of the documentation
-source, and ``doc_type`` is one of,
-
-``javadoc``
-  For documentation generated by the Javadoc tool *before* version 8.
-
-``javadoc8``
-  For documentation generated by the Javadoc tool after version 8. This is
-  required due to changes in how method anchors are generated (see JDK-8144118_).
-
-``sphinx``
-  For external documentation generated by javasphinx.
-
-When comparing referenced types to the list of available packages the longest
-match will be used. Entries for ``java``, ``javax``, ``org.xml``, and
-``org.w3c`` packages pointing to http://docs.oracle.com/javase/8/docs/api are
-included automatically and do not need to be defined explicitly.
-
-.. _JDK-8144118: https://bugs.openjdk.java.net/browse/JDK-8144118
-
-Java domain
-===========
-
-Directives
-----------
-
-The Java domain uses the name **java** and provides the following directives,
-
-.. rst:directive:: .. java:type:: type-signature
-
-   Describe a Java type. The signature can represent either a class, interface,
-   enum or annotation declaration.
-
-   Use the ``param`` field to document type parameters.
-
-   Example,
-
-   .. code-block:: rst
-
-      .. java:type:: public interface List<E> extends Collection<E>, Iterable<E>
-
-         An ordered collection (also known as a *sequence*)
-
-         :param E: type of item stored by the list
-
-   produces,
-
-      .. java:type:: public interface List<E> extends Collection<E>, Iterable<E>
-
-         An ordered collection (also known as a *sequence*)
-
-         :param E: type of item stored by the list
-
-.. rst:directive:: .. java:field:: field-signature
-
-   Describe a Java field.
-
-.. rst:directive:: .. java:method:: method-signature
-
-   Describe a Java method.
-
-   Use the ``param`` field to document parameters.
-
-   Use the ``throws`` field to document exceptions thrown by the method.
-
-   Use the ``return`` field to document the return type
-
-.. rst:directive:: .. java:constructor:: constructor-signature
-
-   Describe a Java constructor.
-
-   Use the ``param`` field to document parameters.
-
-   Use the ``throws`` field to document exceptions thrown by the constructor.
-
-.. rst:directive:: .. java:package:: package
-
-   Provide package-level documentation and also sets the active package for the
-   type, method, field, constructors, and references that follow.
-
-   Use the ``:noindex:`` option if the directive is only being used to specify
-   the active package. Only one directive for a given package should exclude
-   ``:noindex:``.
-
-.. rst:directive:: .. java:import:: package type
-
-   Declare the given type as being provided by the given package. This
-   information helps javasphinx create cross references for types in type,
-   method, and field declarations. It also allows explicit cross references
-   (using the ``java:ref`` role) to exclude the package qualification.
-
-The method, construct, field, and type directives all accept the following
-standard options,
-
-.. describe:: package
-
-   Specify the package the declaration is within. Can be used instead of, or to
-   override, a ``java:package`` directive.
-
-.. describe:: outertype
-
-   Specify the class/interface the documented object is contained within. This
-   option should be provided for any constructor, method, or field directive
-   that isn't nested within a corresponding type directive.
-
-Roles
------
-
-The following roles are provided,
-
-.. rst:role:: java:ref
-
-   This role can be used to create a cross reference to any object type within
-   the Java domain. Aliases for this role include ``java:meth``, ``java:type``,
-   ``java:field``, ``java:package``, and ``java:construct``.
-
-   An explicit title can be provided by using the standard ``title <reference>``
-   syntax.
-
-.. rst:role:: java:extdoc
-
-   This role can be used to explicitly link to an externally documented
-   type. The reference must be fully qualified and supports an explicit title
-   using the ``title <reference>`` syntax.
-
-   The ``java:ref`` role will also create external references as a fall-back if
-   it can't find a matching local declaration so using this role is not strictly
-   necessary.
-
-javasphinx-apidoc
-=================
-
-The ``javasphinx-apidoc`` tool is the counterpoint to the ``sphinx-apidoc`` tool
-within the Java domain. It can be used to generate reST source from existing
-Java source code which has been marked up with Javadoc-style comments. The
-generated reST is then processed alongside hand-written documentation by Sphinx.
-
-At minimum a source and destination directory must be provided. The input
-directory will be scanned for .java files and documentation will be generated
-for all non-private types and members. A separate output file will be generated
-for each type (including inner classes). Each file is put within a directory
-corresponding to its package (with periods replaced by directory separators) and
-with the basename of the file deriving from the type name. Inner types are
-placed in files with a basename using a hyphen to separate inner and outer
-types, e.g. ``OuterType-InnerType.rst``.
-
-By default ``javasphinx-apidoc`` will not override existing files. Two options
-can change this behavior,
-
-.. option:: -f, --force
-
-   All existing output files will be rewritten. If a cache directory is
-   specified it will be rebuilt.
-
-.. option:: -u, --update
-
-   Updated source files will have their corresponding output files
-   updated. Unchanged files will be left alone. Most projects will want to use
-   this option.
-
-For larger projects it is recommended to use a cache directory. This can speed
-up subsequent runs by an order of magnitude or more. Specify a directory to
-store cached output using the :option:`-c` option,
-
-.. option:: -c, --cache-dir
-
-   Specify a directory to cache intermediate documentation representations. This
-   directory will be created if it does not already exist.
diff --git a/docs/source/_ext/javasphinx/javasphinx/__init__.py b/docs/source/_ext/javasphinx/javasphinx/__init__.py
deleted file mode 100644 (file)
index c6b9cb9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from .domain import JavaDomain
-from .extdoc import javadoc_role
-
-def setup(app):
-    app.add_domain(JavaDomain)
-
-    app.add_config_value('javadoc_url_map', dict(), '')
-    app.add_role('java:extdoc', javadoc_role)
diff --git a/docs/source/_ext/javasphinx/javasphinx/apidoc.py b/docs/source/_ext/javasphinx/javasphinx/apidoc.py
deleted file mode 100755 (executable)
index c4eca15..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from __future__ import print_function, unicode_literals
-
-try:
-   import cPickle as pickle
-except ImportError:
-   import pickle
-
-import hashlib
-import logging
-import sys
-import os
-import os.path
-
-from optparse import OptionParser
-
-import javalang
-
-import javasphinx.compiler as compiler
-import javasphinx.util as util
-
-def encode_output(s):
-   if isinstance(s, str):
-      return s
-   return s.encode('utf-8')
-
-def find_source_files(input_path, excludes):
-    """ Get a list of filenames for all Java source files within the given
-    directory.
-
-    """
-
-    java_files = []
-
-    input_path = os.path.normpath(os.path.abspath(input_path))
-
-    for dirpath, dirnames, filenames in os.walk(input_path):
-        if is_excluded(dirpath, excludes):
-            del dirnames[:]
-            continue
-
-        for filename in filenames:
-            if filename.endswith(".java"):
-                java_files.append(os.path.join(dirpath, filename))
-
-    return java_files
-
-def write_toc(packages, opts):
-    doc = util.Document()
-    doc.add_heading(opts.toc_title, '=')
-
-    toc = util.Directive('toctree')
-    toc.add_option('maxdepth', '2')
-    doc.add_object(toc)
-
-    for package in sorted(packages.keys()):
-        toc.add_content("%s/package-index\n" % package.replace('.', '/'))
-
-    filename = 'packages.' + opts.suffix
-    fullpath = os.path.join(opts.destdir, filename)
-
-    if os.path.exists(fullpath) and not (opts.force or opts.update):
-        sys.stderr.write(fullpath + ' already exists. Use -f to overwrite.\n')
-        sys.exit(1)
-
-    f = open(fullpath, 'w')
-    f.write(encode_output(doc.build()))
-    f.close()
-
-def write_documents(packages, documents, sources, opts):
-    package_contents = dict()
-
-    # Write individual documents
-    for fullname, (package, name, document) in documents.items():
-        if is_package_info_doc(name):
-            continue
-
-        package_path = package.replace('.', os.sep)
-        filebasename = name.replace('.', '-')
-        filename = filebasename + '.' + opts.suffix
-        dirpath = os.path.join(opts.destdir, package_path)
-        fullpath = os.path.join(dirpath, filename)
-
-        if not os.path.exists(dirpath):
-            os.makedirs(dirpath)
-        elif os.path.exists(fullpath) and not (opts.force or opts.update):
-            sys.stderr.write(fullpath + ' already exists. Use -f to overwrite.\n')
-            sys.exit(1)
-
-        # Add to package indexes
-        package_contents.setdefault(package, list()).append(filebasename)
-
-        if opts.update and os.path.exists(fullpath):
-            # If the destination file is newer than the source file than skip
-            # writing it out
-            source_mod_time = os.stat(sources[fullname]).st_mtime
-            dest_mod_time = os.stat(fullpath).st_mtime
-
-            if source_mod_time < dest_mod_time:
-                continue
-
-        f = open(fullpath, 'w')
-        f.write(encode_output(document))
-        f.close()
-
-    # Write package-index for each package
-    for package, classes in package_contents.items():
-        doc = util.Document()
-        doc.add_heading(package, '=')
-
-        #Adds the package documentation (if any)
-        if packages[package] != '':
-            documentation = packages[package]
-            doc.add_line("\n%s" % documentation)
-
-        doc.add_object(util.Directive('java:package', package))
-
-        toc = util.Directive('toctree')
-        toc.add_option('maxdepth', '1')
-
-        classes.sort()
-        for filebasename in classes:
-            toc.add_content(filebasename + '\n')
-        doc.add_object(toc)
-
-        package_path = package.replace('.', os.sep)
-        filename = 'package-index.' + opts.suffix
-        dirpath = os.path.join(opts.destdir, package_path)
-        fullpath = os.path.join(dirpath, filename)
-
-        if not os.path.exists(dirpath):
-            os.makedirs(dirpath)
-        elif os.path.exists(fullpath) and not (opts.force or opts.update):
-            sys.stderr.write(fullpath + ' already exists. Use -f to overwrite.\n')
-            sys.exit(1)
-
-        f = open(fullpath, 'w')
-        f.write(encode_output(doc.build()))
-        f.close()
-
-def get_newer(a, b):
-    if not os.path.exists(a):
-        return b
-
-    if not os.path.exists(b):
-        return a
-
-    a_mtime = int(os.stat(a).st_mtime)
-    b_mtime = int(os.stat(b).st_mtime)
-
-    if a_mtime < b_mtime:
-        return b
-
-    return a
-
-def format_syntax_error(e):
-    rest = ""
-    if e.at.position:
-        value = e.at.value
-        pos = e.at.position
-        rest = ' at %s line %d, character %d' % (value, pos[0], pos[1])
-    return e.description + rest
-
-def generate_from_source_file(doc_compiler, source_file, cache_dir):
-    if cache_dir:
-        fingerprint = hashlib.md5(source_file.encode()).hexdigest()
-        cache_file = os.path.join(cache_dir, 'parsed-' + fingerprint + '.p')
-
-        if get_newer(source_file, cache_file) == cache_file:
-            return pickle.load(open(cache_file, 'rb'))
-    else:
-        cache_file = None
-
-    f = open(source_file)
-    source = f.read()
-    f.close()
-
-    try:
-        ast = javalang.parse.parse(source)
-    except javalang.parser.JavaSyntaxError as e:
-        util.error('Syntax error in %s: %s', source_file, format_syntax_error(e))
-    except Exception:
-        util.unexpected('Unexpected exception while parsing %s', source_file)
-
-    documents = {}
-    try:
-        if source_file.endswith("package-info.java"):
-            if ast.package is not None:
-                documentation = doc_compiler.compile_docblock(ast.package)
-                documents[ast.package.name] = (ast.package.name, 'package-info', documentation)
-        else:
-            documents = doc_compiler.compile(ast)
-    except Exception:
-        util.unexpected('Unexpected exception while compiling %s', source_file)
-
-    if cache_file:
-        dump_file = open(cache_file, 'wb')
-        pickle.dump(documents, dump_file)
-        dump_file.close()
-
-    return documents
-
-def generate_documents(source_files, cache_dir, verbose, member_headers, parser):
-    documents = {}
-    sources = {}
-    doc_compiler = compiler.JavadocRestCompiler(None, member_headers, parser)
-
-    for source_file in source_files:
-        if verbose:
-            print('Processing', source_file)
-
-        this_file_documents = generate_from_source_file(doc_compiler, source_file, cache_dir)
-        for fullname in this_file_documents:
-            sources[fullname] = source_file
-
-        documents.update(this_file_documents)
-
-    #Existing packages dict, where each key is a package name
-    #and each value is the package documentation (if any)
-    packages = {}
-
-    #Gets the name of the package where the document was declared
-    #and adds it to the packages dict with no documentation.
-    #Package documentation, if any, will be collected from package-info.java files.
-    for package, name, _ in documents.values():
-        packages[package] = ""
-
-    #Gets packages documentation from package-info.java documents (if any).
-    for package, name, content in documents.values():
-        if is_package_info_doc(name):
-            packages[package] = content
-
-    return packages, documents, sources
-
-def normalize_excludes(rootpath, excludes):
-    f_excludes = []
-    for exclude in excludes:
-        if not os.path.isabs(exclude) and not exclude.startswith(rootpath):
-            exclude = os.path.join(rootpath, exclude)
-        f_excludes.append(os.path.normpath(exclude) + os.path.sep)
-    return f_excludes
-
-def is_excluded(root, excludes):
-    sep = os.path.sep
-    if not root.endswith(sep):
-        root += sep
-    for exclude in excludes:
-        if root.startswith(exclude):
-            return True
-    return False
-
-def is_package_info_doc(document_name):
-    ''' Checks if the name of a document represents a package-info.java file. '''
-    return document_name == 'package-info'
-
-
-def main(argv=sys.argv):
-    logging.basicConfig(level=logging.WARN)
-
-    parser = OptionParser(
-        usage="""\
-usage: %prog [options] -o <output_path> <input_path> [exclude_paths, ...]
-
-Look recursively in <input_path> for Java sources files and create reST files
-for all non-private classes, organized by package under <output_path>. A package
-index (package-index.<ext>) will be created for each package, and a top level
-table of contents will be generated named packages.<ext>.
-
-Paths matching any of the given exclude_paths (interpreted as regular
-expressions) will be skipped.
-
-Note: By default this script will not overwrite already created files.""")
-
-    parser.add_option('-o', '--output-dir', action='store', dest='destdir',
-                      help='Directory to place all output', default='')
-    parser.add_option('-f', '--force', action='store_true', dest='force',
-                      help='Overwrite all files')
-    parser.add_option('-c', '--cache-dir', action='store', dest='cache_dir',
-                      help='Directory to stored cachable output')
-    parser.add_option('-u', '--update', action='store_true', dest='update',
-                      help='Overwrite new and changed files', default=False)
-    parser.add_option('-T', '--no-toc', action='store_true', dest='notoc',
-                      help='Don\'t create a table of contents file')
-    parser.add_option('-t', '--title', dest='toc_title', default='Javadoc',
-                      help='Title to use on table of contents')
-    parser.add_option('--no-member-headers', action='store_false', default=True, dest='member_headers',
-                      help='Don\'t generate headers for class members')
-    parser.add_option('-s', '--suffix', action='store', dest='suffix',
-                      help='file suffix (default: rst)', default='rst')
-    parser.add_option('-I', '--include', action='append', dest='includes',
-                      help='Additional input paths to scan', default=[])
-    parser.add_option('-p', '--parser', dest='parser_lib', default='lxml',
-                      help='Beautiful Soup---html parser library option.')
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
-                      help='verbose output')
-
-    (opts, args) = parser.parse_args(argv[1:])
-
-    if not args:
-        parser.error('A source path is required.')
-
-    rootpath, excludes = args[0], args[1:]
-
-    input_paths = opts.includes
-    input_paths.append(rootpath)
-
-    if not opts.destdir:
-        parser.error('An output directory is required.')
-
-    if opts.suffix.startswith('.'):
-        opts.suffix = opts.suffix[1:]
-
-    for input_path in input_paths:
-        if not os.path.isdir(input_path):
-            sys.stderr.write('%s is not a directory.\n' % (input_path,))
-            sys.exit(1)
-
-    if not os.path.isdir(opts.destdir):
-        os.makedirs(opts.destdir)
-
-    if opts.cache_dir and not os.path.isdir(opts.cache_dir):
-        os.makedirs(opts.cache_dir)
-
-    excludes = normalize_excludes(rootpath, excludes)
-    source_files = []
-
-    for input_path in input_paths:
-        source_files.extend(find_source_files(input_path, excludes))
-
-    packages, documents, sources = generate_documents(source_files, opts.cache_dir, opts.verbose,
-                                                      opts.member_headers, opts.parser_lib)
-
-    write_documents(packages, documents, sources, opts)
-
-    if not opts.notoc:
-        write_toc(packages, opts)
diff --git a/docs/source/_ext/javasphinx/javasphinx/compiler.py b/docs/source/_ext/javasphinx/javasphinx/compiler.py
deleted file mode 100644 (file)
index e4fe623..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import javalang
-
-import javasphinx.formatter as formatter
-import javasphinx.util as util
-import javasphinx.htmlrst as htmlrst
-
-class JavadocRestCompiler(object):
-    """ Javadoc to ReST compiler. Builds ReST documentation from a Java syntax
-    tree. """
-
-    def __init__(self, filter=None, member_headers=True, parser='lxml'):
-        if filter:
-            self.filter = filter
-        else:
-            self.filter = self.__default_filter
-
-        self.converter = htmlrst.Converter(parser)
-
-        self.member_headers = member_headers
-
-    def __default_filter(self, node):
-        """Excludes private members and those tagged "@hide" / "@exclude" in their
-        docblocks.
-
-        """
-
-        if not isinstance(node, javalang.tree.Declaration):
-            return False
-
-        if 'private' in node.modifiers:
-            return False
-
-        if isinstance(node, javalang.tree.Documented) and node.documentation:
-            doc = javalang.javadoc.parse(node.documentation)
-            if 'hide' in doc.tags or 'exclude' in doc.tags:
-                return False
-
-        return True
-
-    def __html_to_rst(self, s):
-        return self.converter.convert(s)
-
-    def __output_doc(self, documented):
-        if not isinstance(documented, javalang.tree.Documented):
-            raise ValueError('node not documented')
-
-        output = util.Document()
-
-        if not documented.documentation:
-            return output
-
-        doc = javalang.javadoc.parse(documented.documentation)
-
-        if doc.description:
-            output.add(self.__html_to_rst(doc.description))
-            output.clear()
-
-        if doc.authors:
-            output.add_line(':author: %s' % (self.__html_to_rst(', '.join(doc.authors)),))
-
-        for name, value in doc.params:
-            output.add_line(':param %s: %s' % (name, self.__html_to_rst(value)))
-
-        for exception in doc.throws:
-            description = doc.throws[exception]
-            output.add_line(':throws %s: %s' % (exception, self.__html_to_rst(description)))
-
-        if doc.return_doc:
-            output.add_line(':return: %s' % (self.__html_to_rst(doc.return_doc),))
-
-        if doc.tags.get('see'):
-            output.clear()
-
-            see_also = ', '.join(self.__output_see(see) for see in doc.tags['see'])
-            output.add_line('**See also:** %s' % (see_also,))
-
-        return output
-
-    def __output_see(self, see):
-        """ Convert the argument to a @see tag to rest """
-
-        if see.startswith('<a href'):
-            # HTML link -- <a href="...">...</a>
-            return self.__html_to_rst(see)
-        if '"' in see:
-            # Plain text
-            return see
-
-        # Type reference (default)
-        return ':java:ref:`%s`' % (see.replace('#', '.').replace(' ', ''),)
-
-    def compile_type(self, declaration):
-        signature = util.StringBuilder()
-        formatter.output_declaration(declaration, signature)
-
-        doc = self.__output_doc(declaration)
-
-        directive = util.Directive('java:type', signature.build())
-        directive.add_content(doc)
-
-        return directive
-
-    def compile_enum_constant(self, enum, constant):
-        signature = util.StringBuilder()
-
-        for annotation in constant.annotations:
-            formatter.output_annotation(annotation, signature)
-
-        # All enum constants are public, static, and final
-        signature.append('public static final ')
-        signature.append(enum)
-        signature.append(' ')
-        signature.append(constant.name)
-
-        doc = self.__output_doc(constant)
-
-        directive = util.Directive('java:field', signature.build())
-        directive.add_content(doc)
-
-        return directive
-
-    def compile_field(self, field):
-        signature = util.StringBuilder()
-
-        for annotation in field.annotations:
-            formatter.output_annotation(annotation, signature)
-
-        formatter.output_modifiers(field.modifiers, signature)
-        signature.append(' ')
-
-        formatter.output_type(field.type, signature)
-        signature.append(' ')
-        signature.append(field.declarators[0].name)
-
-        doc = self.__output_doc(field)
-
-        directive = util.Directive('java:field', signature.build())
-        directive.add_content(doc)
-
-        return directive
-
-    def compile_constructor(self, constructor):
-        signature = util.StringBuilder()
-
-        for annotation in constructor.annotations:
-            formatter.output_annotation(annotation, signature)
-
-        formatter.output_modifiers(constructor.modifiers, signature)
-        signature.append(' ')
-
-        if constructor.type_parameters:
-            formatter.output_type_params(constructor.type_parameters, signature)
-            signature.append(' ')
-
-        signature.append(constructor.name)
-
-        signature.append('(')
-        formatter.output_list(formatter.output_formal_param, constructor.parameters, signature, ', ')
-        signature.append(')')
-
-        if constructor.throws:
-            signature.append(' throws ')
-            formatter.output_list(formatter.output_exception, constructor.throws, signature, ', ')
-
-        doc = self.__output_doc(constructor)
-
-        directive = util.Directive('java:constructor', signature.build())
-        directive.add_content(doc)
-
-        return directive
-
-    def compile_method(self, method):
-        signature = util.StringBuilder()
-
-        for annotation in method.annotations:
-            formatter.output_annotation(annotation, signature)
-
-        formatter.output_modifiers(method.modifiers, signature)
-        signature.append(' ')
-
-        if method.type_parameters:
-            formatter.output_type_params(method.type_parameters, signature)
-            signature.append(' ')
-
-        formatter.output_type(method.return_type, signature)
-        signature.append(' ')
-
-        signature.append(method.name)
-
-        signature.append('(')
-        formatter.output_list(formatter.output_formal_param, method.parameters, signature, ', ')
-        signature.append(')')
-
-        if method.throws:
-            signature.append(' throws ')
-            formatter.output_list(formatter.output_exception, method.throws, signature, ', ')
-
-        doc = self.__output_doc(method)
-
-        directive = util.Directive('java:method', signature.build())
-        directive.add_content(doc)
-
-        return directive
-
-    def compile_type_document(self, imports_block, package, name, declaration):
-        """ Compile a complete document, documenting a type and its members """
-
-        outer_type = name.rpartition('.')[0]
-
-        document = util.Document()
-        document.add(imports_block)
-        document.add_heading(name, '=')
-
-        method_summary = util.StringBuilder()
-        document.add_object(method_summary)
-
-        package_dir = util.Directive('java:package', package)
-        package_dir.add_option('noindex')
-        document.add_object(package_dir)
-
-        # Add type-level documentation
-        type_dir = self.compile_type(declaration)
-        if outer_type:
-            type_dir.add_option('outertype', outer_type)
-        document.add_object(type_dir)
-
-        if isinstance(declaration, javalang.tree.EnumDeclaration):
-            enum_constants = list(declaration.body.constants)
-            enum_constants.sort(key=lambda c: c.name)
-
-            document.add_heading('Enum Constants')
-            for enum_constant in enum_constants:
-                if self.member_headers:
-                    document.add_heading(enum_constant.name, '^')
-                c = self.compile_enum_constant(name, enum_constant)
-                c.add_option('outertype', name)
-                document.add_object(c)
-
-        fields = list(filter(self.filter, declaration.fields))
-        if fields:
-            document.add_heading('Fields', '-')
-            fields.sort(key=lambda f: f.declarators[0].name)
-            for field in fields:
-                if self.member_headers:
-                    document.add_heading(field.declarators[0].name, '^')
-                f = self.compile_field(field)
-                f.add_option('outertype', name)
-                document.add_object(f)
-
-        constructors = list(filter(self.filter, declaration.constructors))
-        if constructors:
-            document.add_heading('Constructors', '-')
-            constructors.sort(key=lambda c: c.name)
-            for constructor in constructors:
-                if self.member_headers:
-                    document.add_heading(constructor.name, '^')
-                c = self.compile_constructor(constructor)
-                c.add_option('outertype', name)
-                document.add_object(c)
-
-        methods = list(filter(self.filter, declaration.methods))
-        if methods:
-            document.add_heading('Methods', '-')
-            methods.sort(key=lambda m: m.name)
-            for method in methods:
-                if self.member_headers:
-                    document.add_heading(method.name, '^')
-                m = self.compile_method(method)
-                m.add_option('outertype', name)
-                document.add_object(m)
-
-        return document
-
-    def compile(self, ast):
-        """ Compile autodocs for the given Java syntax tree. Documents will be
-        returned documenting each separate type. """
-
-        documents = {}
-
-        imports = util.StringBuilder()
-        for imp in ast.imports:
-            if imp.static or imp.wildcard:
-                continue
-
-            package_parts = []
-            cls_parts = []
-
-            for part in imp.path.split('.'):
-                if cls_parts or part[0].isupper():
-                    cls_parts.append(part)
-                else:
-                    package_parts.append(part)
-
-
-            # If the import's final part wasn't capitalized,
-            # append it to the class parts anyway so sphinx doesn't complain.
-            if cls_parts == []:
-                cls_parts.append(package_parts.pop())
-
-            package = '.'.join(package_parts)
-            cls = '.'.join(cls_parts)
-
-            imports.append(util.Directive('java:import', package + ' ' + cls).build())
-        import_block = imports.build()
-
-        if not ast.package:
-            raise ValueError('File must have package declaration')
-
-        package = ast.package.name
-        type_declarations = []
-        for path, node in ast.filter(javalang.tree.TypeDeclaration):
-            if not self.filter(node):
-                continue
-
-            classes = [n.name for n in path if isinstance(n, javalang.tree.TypeDeclaration)]
-            classes.append(node.name)
-
-            name = '.'.join(classes)
-            type_declarations.append((package, name, node))
-
-        for package, name, declaration in type_declarations:
-            full_name = package + '.' + name
-            document = self.compile_type_document(import_block, package, name, declaration)
-            documents[full_name] = (package, name, document.build())
-        return documents
-
-    def compile_docblock(self, documented):
-        ''' Compiles a single, standalone docblock. '''
-        return self.__output_doc(documented).build()
diff --git a/docs/source/_ext/javasphinx/javasphinx/domain.py b/docs/source/_ext/javasphinx/javasphinx/domain.py
deleted file mode 100644 (file)
index 3784d8a..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import re
-import string
-
-from docutils import nodes
-from docutils.parsers.rst import Directive, directives
-
-from sphinx import addnodes, version_info
-from sphinx.roles import XRefRole
-from sphinx.locale import _
-from sphinx.domains import Domain, ObjType
-from sphinx.directives import ObjectDescription
-from sphinx.util.nodes import make_refnode
-from sphinx.util.docfields import Field, TypedField, GroupedField
-
-import javalang
-
-import javasphinx.extdoc as extdoc
-import javasphinx.formatter as formatter
-import javasphinx.util as util
-
-# Classes in java.lang. These are available without an import.
-java_dot_lang = set([
-    'AbstractMethodError', 'Appendable', 'ArithmeticException',
-    'ArrayIndexOutOfBoundsException', 'ArrayStoreException', 'AssertionError',
-    'AutoCloseable', 'Boolean', 'BootstrapMethodError', 'Byte', 'Character',
-    'CharSequence', 'Class', 'ClassCastException', 'ClassCircularityError',
-    'ClassFormatError', 'ClassLoader', 'ClassNotFoundException', 'ClassValue',
-    'Cloneable', 'CloneNotSupportedException', 'Comparable', 'Compiler',
-    'Deprecated', 'Double', 'Enum', 'EnumConstantNotPresentException', 'Error',
-    'Exception', 'ExceptionInInitializerError', 'Float', 'IllegalAccessError',
-    'IllegalAccessException', 'IllegalArgumentException',
-    'IllegalMonitorStateException', 'IllegalStateException',
-    'IllegalThreadStateException', 'IncompatibleClassChangeError',
-    'IndexOutOfBoundsException', 'InheritableThreadLocal', 'InstantiationError',
-    'InstantiationException', 'Integer', 'InternalError', 'InterruptedException',
-    'Iterable', 'LinkageError', 'Long', 'Math', 'NegativeArraySizeException',
-    'NoClassDefFoundError', 'NoSuchFieldError', 'NoSuchFieldException',
-    'NoSuchMethodError', 'NoSuchMethodException', 'NullPointerException', 'Number',
-    'NumberFormatException', 'Object', 'OutOfMemoryError', 'Override', 'Package',
-    'Process', 'ProcessBuilder', 'Readable', 'ReflectiveOperationException',
-    'Runnable', 'Runtime', 'RuntimeException', 'RuntimePermission', 'SafeVarargs',
-    'SecurityException', 'SecurityManager', 'Short', 'StackOverflowError',
-    'StackTraceElement', 'StrictMath', 'String', 'StringBuffer', 'StringBuilder',
-    'StringIndexOutOfBoundsException', 'SuppressWarnings', 'System', 'Thread',
-    'ThreadDeath', 'ThreadGroup', 'ThreadLocal', 'Throwable',
-    'TypeNotPresentException', 'UnknownError', 'UnsatisfiedLinkError',
-    'UnsupportedClassVersionError', 'UnsupportedOperationException', 'VerifyError',
-    'VirtualMachineError', 'Void'])
-
-class JavaObject(ObjectDescription):
-    option_spec = {
-        'noindex': directives.flag,
-        'package': directives.unchanged,
-        'outertype': directives.unchanged
-    }
-
-    def _build_ref_node(self, target):
-        ref = addnodes.pending_xref('', refdomain='java', reftype='type', reftarget=target, modname=None, classname=None)
-        ref['java:outertype'] = self.get_type()
-
-        package = self.env.temp_data.get('java:imports', dict()).get(target, None)
-
-        if not package and target in java_dot_lang:
-            package = 'java.lang'
-
-        if package:
-            ref['java:imported'] = True
-            ref['java:package'] = package
-        else:
-            ref['java:imported'] = False
-            ref['java:package'] = self.get_package()
-
-        return ref
-
-    def _build_type_node(self, typ):
-        if isinstance(typ, javalang.tree.ReferenceType):
-            if typ.dimensions:
-                dim = '[]' * len(typ.dimensions)
-            else:
-                dim = ''
-
-            target = typ.name
-            parts = []
-
-            while typ:
-                ref_node = self._build_ref_node(target)
-                ref_node += nodes.Text(typ.name, typ.name)
-                parts.append(ref_node)
-
-                if typ.arguments:
-                    parts.append(nodes.Text('<', '<'))
-
-                    first = True
-                    for type_arg in typ.arguments:
-                        if first:
-                            first = False
-                        else:
-                            parts.append(nodes.Text(', ', ', '))
-
-                        if type_arg.pattern_type == '?':
-                            parts.append(nodes.Text('?', '?'))
-                        else:
-                            if type_arg.pattern_type:
-                                s = '? %s ' % (type_arg.pattern_type,)
-                                parts.append(nodes.Text(s, s))
-                            parts.extend(self._build_type_node(type_arg.type))
-
-                    parts.append(nodes.Text('>', '>'))
-
-                typ = typ.sub_type
-
-                if typ:
-                    target = target + '.' + typ.name
-                    parts.append(nodes.Text('.', '.'))
-                elif dim:
-                    parts.append(nodes.Text(dim, dim))
-
-            return parts
-
-        type_repr = formatter.output_type(typ).build()
-        return [nodes.Text(type_repr, type_repr)]
-
-    def _build_type_node_list(self, types):
-        parts = self._build_type_node(types[0])
-        for typ in types[1:]:
-            parts.append(nodes.Text(', ', ', '))
-            parts.extend(self._build_type_node(typ))
-        return parts
-
-    def handle_signature(self, sig, signode):
-        handle_name = 'handle_%s_signature' % (self.objtype,)
-        handle = getattr(self, handle_name, None)
-
-        if handle:
-            return handle(sig, signode)
-        raise NotImplementedError
-
-    def get_index_text(self, package, typ, name):
-        raise NotImplementedError
-
-    def get_package(self):
-        return self.options.get('package', self.env.temp_data.get('java:package'))
-
-    def get_type(self):
-        return self.options.get('outertype', '.'.join(self.env.temp_data.get('java:outertype', [])))
-
-    def add_target_and_index(self, name, sig, signode):
-        package = self.get_package()
-        typ = self.get_type()
-
-        fullname = '.'.join(filter(None, (package, typ, name)))
-        basename = fullname.partition('(')[0]
-
-        # note target
-        if fullname not in self.state.document.ids:
-            signode['names'].append(fullname)
-            signode['ids'].append(fullname)
-            signode['first'] = (not self.names)
-            self.state.document.note_explicit_target(signode)
-
-            objects = self.env.domaindata['java']['objects']
-            if fullname in objects:
-                self.state_machine.reporter.warning(
-                    'duplicate object description of %s, ' % fullname +
-                    'other instance in ' + self.env.doc2path(objects[fullname][0]) +
-                    ', use :noindex: for one of them',
-                    line=self.lineno)
-
-            objects[fullname] = (self.env.docname, self.objtype, basename)
-
-        indextext = self.get_index_text(package, typ, name)
-        if indextext:
-            self.indexnode['entries'].append(_create_indexnode(indextext, fullname))
-
-    def before_content(self):
-        self.set_type = False
-
-        if self.objtype == 'type' and self.names:
-            self.set_type = True
-            self.env.temp_data.setdefault('java:outertype', list()).append(self.names[0])
-
-    def after_content(self):
-        if self.set_type:
-            self.env.temp_data['java:outertype'].pop()
-
-class JavaMethod(JavaObject):
-    doc_field_types = [
-        TypedField('parameter', label=_('Parameters'),
-                   names=('param', 'parameter', 'arg', 'argument'),
-                   typerolename='type', typenames=('type',)),
-        Field('returnvalue', label=_('Returns'), has_arg=False,
-              names=('returns', 'return')),
-        GroupedField('throws', names=('throws',), label=_('Throws'), rolename='type')
-    ]
-
-    def handle_method_signature(self, sig, signode):
-        try:
-            member = javalang.parse.parse_member_signature(sig)
-        except javalang.parser.JavaSyntaxError:
-            raise self.error("syntax error in method signature")
-
-        if not isinstance(member, javalang.tree.MethodDeclaration):
-            raise self.error("expected method declaration")
-
-        mods = formatter.output_modifiers(member.modifiers).build()
-        signode += nodes.Text(mods + ' ', mods + ' ')
-
-        if member.type_parameters:
-            type_params = formatter.output_type_params(member.type_parameters).build()
-            signode += nodes.Text(type_params, type_params)
-            signode += nodes.Text(' ', ' ')
-
-        rnode = addnodes.desc_type('', '')
-        rnode += self._build_type_node(member.return_type)
-
-        signode += rnode
-        signode += nodes.Text(' ', ' ')
-        signode += addnodes.desc_name(member.name, member.name)
-
-        paramlist = addnodes.desc_parameterlist()
-        for parameter in member.parameters:
-            param = addnodes.desc_parameter('', '', noemph=True)
-            param += self._build_type_node(parameter.type)
-
-            if parameter.varargs:
-                param += nodes.Text('...', '')
-
-            param += nodes.emphasis(' ' + parameter.name, ' ' + parameter.name)
-            paramlist += param
-        signode += paramlist
-
-        param_reprs = [formatter.output_type(param.type, with_generics=False).build() for param in member.parameters]
-        return member.name + '(' + ', '.join(param_reprs) + ')'
-
-    def get_index_text(self, package, typ, name):
-        return _('%s (Java method)' % (name,))
-
-class JavaConstructor(JavaObject):
-    doc_field_types = [
-        TypedField('parameter', label=_('Parameters'),
-                   names=('param', 'parameter', 'arg', 'argument'),
-                   typerolename='type', typenames=('type',)),
-        GroupedField('throws', names=('throws',), label=_('Throws'))
-    ]
-
-    def handle_constructor_signature(self, sig, signode):
-        try:
-            member = javalang.parse.parse_constructor_signature(sig)
-        except javalang.parser.JavaSyntaxError:
-            raise self.error("syntax error in constructor signature")
-
-        if not isinstance(member, javalang.tree.ConstructorDeclaration):
-            raise self.error("expected constructor declaration")
-
-        mods = formatter.output_modifiers(member.modifiers).build()
-        signode += nodes.Text(mods + ' ', mods + ' ')
-
-        signode += addnodes.desc_name(member.name, member.name)
-
-        paramlist = addnodes.desc_parameterlist()
-        for parameter in member.parameters:
-            param = addnodes.desc_parameter('', '', noemph=True)
-            param += self._build_type_node(parameter.type)
-
-            if parameter.varargs:
-                param += nodes.Text('...', '')
-
-            param += nodes.emphasis(' ' + parameter.name, ' ' + parameter.name)
-            paramlist += param
-        signode += paramlist
-
-        param_reprs = [formatter.output_type(param.type, with_generics=False).build() for param in member.parameters]
-        return '%s(%s)' % (member.name, ', '.join(param_reprs))
-
-    def get_index_text(self, package, typ, name):
-        return _('%s (Java constructor)' % (name,))
-
-class JavaType(JavaObject):
-    doc_field_types = [
-        GroupedField('parameter', names=('param',), label=_('Parameters'))
-    ]
-
-    declaration_type = None
-
-    def handle_type_signature(self, sig, signode):
-        try:
-            member = javalang.parse.parse_type_signature(sig)
-        except javalang.parser.JavaSyntaxError:
-            raise self.error("syntax error in field signature")
-
-        if isinstance(member, javalang.tree.ClassDeclaration):
-            self.declaration_type = 'class'
-        elif isinstance(member, javalang.tree.InterfaceDeclaration):
-            self.declaration_type = 'interface'
-        elif isinstance(member, javalang.tree.EnumDeclaration):
-            self.declaration_type = 'enum'
-        elif isinstance(member, javalang.tree.AnnotationDeclaration):
-            self.declaration_type = 'annotation'
-        else:
-            raise self.error("expected type declaration")
-
-        mods = formatter.output_modifiers(member.modifiers).build()
-        signode += nodes.Text(mods + ' ', mods + ' ')
-
-        if self.declaration_type == 'class':
-            signode += nodes.Text('class ', 'class ')
-        elif self.declaration_type == 'interface':
-            signode += nodes.Text('interface ', 'interface ')
-        elif self.declaration_type == 'enum':
-            signode += nodes.Text('enum ', 'enum ')
-        elif self.declaration_type == 'annotation':
-            signode += nodes.Text('@interface ', '@interface ')
-
-        signode += addnodes.desc_name(member.name, member.name)
-
-        if self.declaration_type in ('class', 'interface') and member.type_parameters:
-            type_params = formatter.output_type_params(member.type_parameters).build()
-            signode += nodes.Text(type_params, type_params)
-
-        if self.declaration_type == 'class':
-            if member.extends:
-                extends = ' extends '
-                signode += nodes.Text(extends, extends)
-                signode += self._build_type_node(member.extends)
-            if member.implements:
-                implements = ' implements '
-                signode += nodes.Text(implements, implements)
-                signode += self._build_type_node_list(member.implements)
-        elif self.declaration_type == 'interface':
-            if member.extends:
-                extends = ' extends '
-                signode += nodes.Text(extends, extends)
-                signode += self._build_type_node_list(member.extends)
-        elif self.declaration_type == 'enum':
-            if member.implements:
-                implements = ' implements '
-                signode += nodes.Text(implements, implements)
-                signode += self._build_type_node_list(member.implements)
-
-        return member.name
-
-    def get_index_text(self, package, typ, name):
-        return _('%s (Java %s)' % (name, self.declaration_type))
-
-class JavaField(JavaObject):
-    def handle_field_signature(self, sig, signode):
-        try:
-            member = javalang.parse.parse_member_signature(sig)
-        except javalang.parser.JavaSyntaxError:
-            raise self.error("syntax error in field signature")
-
-        if not isinstance(member, javalang.tree.FieldDeclaration):
-            raise self.error("expected field declaration")
-
-        mods = formatter.output_modifiers(member.modifiers).build()
-        signode += nodes.Text(mods + ' ', mods + ' ')
-
-        tnode = addnodes.desc_type('', '')
-        tnode += self._build_type_node(member.type)
-
-        signode += tnode
-        signode += nodes.Text(' ', ' ')
-
-        if len(member.declarators) > 1:
-            self.error('only one field may be documented at a time')
-
-        declarator = member.declarators[0]
-        signode += addnodes.desc_name(declarator.name, declarator.name)
-
-        dim = '[]' * len(declarator.dimensions)
-        signode += nodes.Text(dim)
-
-        if declarator.initializer and isinstance(declarator.initializer, javalang.tree.Literal):
-            signode += nodes.Text(' = ' + declarator.initializer.value)
-
-        return declarator.name
-
-    def get_index_text(self, package, typ, name):
-        return _('%s (Java field)' % (name,))
-
-class JavaPackage(Directive):
-    """
-    Directive to mark description of a new package.
-    """
-
-    has_content = False
-    required_arguments = 1
-    optional_arguments = 0
-    final_argument_whitespace = False
-    option_spec = {
-        'noindex': directives.flag,
-    }
-
-    def run(self):
-        env = self.state.document.settings.env
-        package = self.arguments[0].strip()
-        noindex = 'noindex' in self.options
-        env.temp_data['java:package'] = package
-        env.domaindata['java']['objects'][package] = (env.docname, 'package', package)
-        ret = []
-
-        if not noindex:
-            targetnode = nodes.target('', '', ids=['package-' + package], ismod=True)
-            self.state.document.note_explicit_target(targetnode)
-
-            # the platform and synopsis aren't printed; in fact, they are only
-            # used in the modindex currently
-            ret.append(targetnode)
-
-            indextext = _('%s (package)') % (package,)
-            inode = addnodes.index(entries=[_create_indexnode(indextext, 'package-' + package)])
-            ret.append(inode)
-
-        return ret
-
-class JavaImport(Directive):
-    """
-    This directive is just to tell Sphinx the source of a referenced type.
-    """
-
-    has_content = False
-    required_arguments = 2
-    optional_arguments = 0
-    final_argument_whitespace = False
-    option_spec = {}
-
-    def run(self):
-        env = self.state.document.settings.env
-        package, typename = self.arguments
-
-        env.temp_data.setdefault('java:imports', dict())[typename] = package
-        return []
-
-class JavaXRefRole(XRefRole):
-    def process_link(self, env, refnode, has_explicit_title, title, target):
-        refnode['java:outertype'] = '.'.join(env.temp_data.get('java:outertype', list()))
-
-        target = target.lstrip('~')
-
-        # Strip a method component from the target
-        basetype = target
-        if '(' in basetype:
-            basetype = basetype.partition('(')[0]
-            if '.' in basetype:
-                basetype = basetype.rpartition('.')[0]
-
-        package = env.temp_data.get('java:imports', dict()).get(basetype, None)
-
-        if package:
-            refnode['java:imported'] = True
-            refnode['java:package'] = package
-        else:
-            refnode['java:imported'] = False
-            refnode['java:package'] = env.temp_data.get('java:package')
-
-        if not has_explicit_title:
-            # if the first character is a tilde, don't display the module/class
-            # parts of the contents
-            if title[0:1] == '~':
-                title = title.partition('(')[0]
-                title = title[1:]
-                dot = title.rfind('.')
-                if dot != -1:
-                    title = title[dot+1:]
-
-        return title, target
-
-class JavaDomain(Domain):
-    """Java language domain."""
-    name = 'java'
-    label = 'Java'
-
-    object_types = {
-        'package':     ObjType(_('package'), 'package', 'ref'),
-        'type':        ObjType(_('type'), 'type', 'ref'),
-        'field':       ObjType(_('field'), 'field', 'ref'),
-        'constructor': ObjType(_('constructor'), 'construct', 'ref'),
-        'method':      ObjType(_('method'), 'meth', 'ref')
-    }
-
-    directives = {
-        'package':        JavaPackage,
-        'type':           JavaType,
-        'field':          JavaField,
-        'constructor':    JavaConstructor,
-        'method':         JavaMethod,
-        'import':         JavaImport
-    }
-
-    roles = {
-        'package':   JavaXRefRole(),
-        'type':      JavaXRefRole(),
-        'field':     JavaXRefRole(),
-        'construct': JavaXRefRole(),
-        'meth':      JavaXRefRole(),
-        'ref':       JavaXRefRole(),
-    }
-
-    initial_data = {
-        'objects': {},  # fullname -> docname, objtype, basename
-    }
-
-    def clear_doc(self, docname):
-        objects = dict(self.data['objects'])
-
-        for fullname, (fn, _, _) in objects.items():
-            if fn == docname:
-                del self.data['objects'][fullname]
-
-    def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
-        objects = self.data['objects']
-        package = node.get('java:package')
-        imported = node.get('java:imported')
-        type_context = node.get('java:outertype')
-
-        # Partial function to make building the response easier
-        make_ref = lambda fullname: make_refnode(builder, fromdocname, objects[fullname][0], fullname, contnode, fullname)
-
-        # Check for fully qualified references
-        if target in objects:
-            return make_ref(target)
-
-        # Try with package name prefixed
-        if package:
-            fullname = package + '.' + target
-            if fullname in objects:
-                return make_ref(fullname)
-
-        # Try with package and type prefixed
-        if package and type_context:
-            fullname = package + '.' + type_context + '.' + target
-            if fullname in objects:
-                return make_ref(fullname)
-
-        # Try to find a matching suffix
-        suffix = '.' + target
-        basename_match = None
-        basename_suffix = suffix.partition('(')[0]
-
-        for fullname, (_, _, basename) in objects.items():
-            if fullname.endswith(suffix):
-                return make_ref(fullname)
-            if basename.endswith(basename_suffix):
-                basename_match = fullname
-
-        if basename_match:
-            return make_ref(basename_match)
-
-        # Try creating an external documentation reference
-        ref = extdoc.get_javadoc_ref(self.env, target, target)
-
-        if not ref and target in java_dot_lang:
-            fulltarget = 'java.lang.' + target
-            ref = extdoc.get_javadoc_ref(self.env, fulltarget, fulltarget)
-
-        # If the target was imported try with the package prefixed
-        if not ref and imported:
-            fulltarget = package + '.' + target
-            ref = extdoc.get_javadoc_ref(self.env, fulltarget, fulltarget)
-
-        if ref:
-            ref.append(contnode)
-            return ref
-        return None
-
-    def get_objects(self):
-        for refname, (docname, typ, _) in self.data['objects'].items():
-            yield (refname, refname, typ, docname, refname, 1)
-
-
-def _create_indexnode(indextext, fullname):
-    # See https://github.com/sphinx-doc/sphinx/issues/2673
-    if version_info < (1, 4):
-        return ('single', indextext, fullname, '')
-    return ('single', indextext, fullname, '', None)
diff --git a/docs/source/_ext/javasphinx/javasphinx/extdoc.py b/docs/source/_ext/javasphinx/javasphinx/extdoc.py
deleted file mode 100644 (file)
index 1586bc2..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import re
-
-from docutils import nodes, utils
-from sphinx.util.nodes import split_explicit_title
-
-def get_javadoc_ref(app, rawtext, text):
-    javadoc_url_map = app.config.javadoc_url_map
-
-    # Add default Java SE sources
-    if not javadoc_url_map.get("java"):
-        javadoc_url_map["java"] = ("http://docs.oracle.com/javase/8/docs/api", 'javadoc8')
-    if not javadoc_url_map.get("javax"):
-        javadoc_url_map["javax"] = ("http://docs.oracle.com/javase/8/docs/api", 'javadoc8')
-    if not javadoc_url_map.get("org.xml"):
-        javadoc_url_map["org.xml"] = ("http://docs.oracle.com/javase/8/docs/api", 'javadoc8')
-    if not javadoc_url_map.get("org.w3c"):
-        javadoc_url_map["org.w3c"] = ("http://docs.oracle.com/javase/8/docs/api", 'javadoc8')
-
-    source = None
-    package = ''
-    method = None
-
-    if '(' in text:
-        # If the javadoc contains a line like this:
-        # {@link #sort(List)}
-        # there is no package so the text.rindex will fail
-        try:
-            split_point = text.rindex('.', 0, text.index('('))
-            method = text[split_point + 1:]
-            text = text[:split_point]
-        except ValueError:
-            pass
-
-    for pkg, (baseurl, ext_type) in javadoc_url_map.items():
-        if text.startswith(pkg + '.') and len(pkg) > len(package):
-            source = baseurl, ext_type
-            package = pkg
-
-    if not source:
-        return None
-
-    baseurl, ext_type = source
-
-    package_parts = []
-    cls_parts = []
-
-    for part in text.split('.'):
-        if cls_parts or part[0].isupper():
-            cls_parts.append(part)
-        else:
-            package_parts.append(part)
-
-    package = '.'.join(package_parts)
-    cls = '.'.join(cls_parts)
-
-    if not baseurl.endswith('/'):
-        baseurl = baseurl + '/'
-
-    if ext_type == 'javadoc':
-        if not cls:
-            cls = 'package-summary'
-        source = baseurl + package.replace('.', '/') + '/' + cls + '.html'
-        if method:
-            source = source + '#' + method
-    elif ext_type == 'javadoc8':
-        if not cls:
-            cls = 'package-summary'
-        source = baseurl + package.replace('.', '/') + '/' + cls + '.html'
-        if method:
-            source = source + '#' + re.sub(r'[()]', '-', method)
-    elif ext_type == 'sphinx':
-        if not cls:
-            cls = 'package-index'
-        source = baseurl + package.replace('.', '/') + '/' + cls.replace('.', '-') + '.html'
-        if method:
-            source = source + '#' + package + '.' + cls + '.' + method
-    else:
-        raise ValueError('invalid target specifier ' + ext_type)
-
-    title = '.'.join(filter(None, (package, cls, method)))
-    node = nodes.reference(rawtext, '')
-    node['refuri'] = source
-    node['reftitle'] = title
-
-    return node
-
-def javadoc_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
-    """ Role for linking to external Javadoc """
-
-    has_explicit_title, title, target = split_explicit_title(text)
-    title = utils.unescape(title)
-    target = utils.unescape(target)
-
-    if not has_explicit_title:
-        target = target.lstrip('~')
-
-        if title[0] == '~':
-            title = title[1:].rpartition('.')[2]
-
-    app = inliner.document.settings.env.app
-    ref = get_javadoc_ref(app, rawtext, target)
-
-    if not ref:
-         raise ValueError("no Javadoc source found for %s in javadoc_url_map" % (target,))
-
-    ref.append(nodes.Text(title, title))
-
-    return [ref], []
diff --git a/docs/source/_ext/javasphinx/javasphinx/formatter.py b/docs/source/_ext/javasphinx/javasphinx/formatter.py
deleted file mode 100644 (file)
index ce6f6f5..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-"""
-Convert Java syntax tree nodes to string representations.
-
-"""
-
-import javalang
-
-from .util import StringBuilder
-
-# The order for displaying modifiers
-__modifiers_order = ('public', 'protected', 'private', 'static', 'abstract', 'final',
-                     'native', 'synchronized', 'transient', 'volatile', 'strictfp')
-
-def formatter(f):
-    def _f(node, output=None, **kwargs):
-        if output is None:
-            output = StringBuilder()
-
-        f(node, output, **kwargs)
-        return output
-    return _f
-
-def output_list(f, items, output=None, sep=', '):
-    if items:
-        f(items[0], output)
-        for item in items[1:]:
-            output.append(sep)
-            f(item, output)
-
-@formatter
-def output_annotation(annotation, output):
-    output.append('@')
-    output.append(annotation.name)
-    output.append(' ')
-
-@formatter
-def output_type(typ, output, with_generics=True):
-    if not typ:
-        output.append('void')
-        return
-
-    if typ.dimensions:
-        dim = '[]' * len(typ.dimensions)
-    else:
-        dim = ''
-
-    if isinstance(typ, javalang.tree.BasicType):
-        output.append(typ.name)
-    else:
-        while typ:
-            output.append(typ.name)
-
-            if with_generics:
-                output_type_args(typ.arguments, output)
-
-            typ = typ.sub_type
-
-            if typ:
-                output.append('.')
-    output.append(dim)
-
-@formatter
-def output_exception(exception, output):
-    output.append(exception)
-
-@formatter
-def output_type_arg(type_arg, output):
-    if type_arg.pattern_type == '?':
-        output.append('?')
-    else:
-        if type_arg.pattern_type:
-            output.append('? ')
-            output.append(type_arg.pattern_type)
-            output.append(' ')
-
-        output_type(type_arg.type, output)
-
-@formatter
-def output_type_args(type_args, output):
-    if type_args:
-        output.append('<')
-        output_list(output_type_arg, type_args, output, ', ')
-        output.append('>')
-
-@formatter
-def output_type_param(type_param, output):
-    output.append(type_param.name)
-
-    if type_param.extends:
-        output.append(' extends ')
-        output_list(output_type, type_param.extends, output, ' & ')
-
-@formatter
-def output_type_params(type_params, output):
-    if type_params:
-        output.append('<')
-        output_list(output_type_param, type_params, output, ', ')
-        output.append('>')
-
-@formatter
-def output_declaration(declaration, output):
-    for annotation in declaration.annotations:
-        output_annotation(annotation, output)
-
-    output_modifiers(declaration.modifiers, output)
-    output.append(' ')
-
-    if isinstance(declaration, javalang.tree.ClassDeclaration):
-        output.append('class ')
-    elif isinstance(declaration, javalang.tree.EnumDeclaration):
-        output.append('enum ')
-    elif isinstance(declaration, javalang.tree.InterfaceDeclaration):
-        output.append('interface ')
-    elif isinstance(declaration, javalang.tree.AnnotationDeclaration):
-        output.append('@interface ')
-
-    output.append(declaration.name)
-
-    if isinstance(declaration, (javalang.tree.ClassDeclaration, javalang.tree.InterfaceDeclaration)):
-        output_type_params(declaration.type_parameters, output)
-
-    if isinstance(declaration, javalang.tree.ClassDeclaration) and declaration.extends:
-        output.append(' extends ')
-        output_type(declaration.extends, output)
-
-    if isinstance(declaration, javalang.tree.InterfaceDeclaration) and declaration.extends:
-        output.append(' extends ')
-        output_list(output_type, declaration.extends, output, ', ')
-
-    if isinstance(declaration, (javalang.tree.ClassDeclaration, javalang.tree.EnumDeclaration)) and declaration.implements:
-        output.append(' implements ')
-        output_list(output_type, declaration.implements, output, ', ')
-
-@formatter
-def output_formal_param(param, output):
-    output_type(param.type, output)
-
-    if param.varargs:
-        output.append('...')
-
-    output.append(' ')
-    output.append(param.name)
-
-@formatter
-def output_modifiers(modifiers, output):
-    ordered_modifiers = [mod for mod in __modifiers_order if mod in modifiers]
-    output_list(lambda mod, output: output.append(mod), ordered_modifiers, output, ' ')
diff --git a/docs/source/_ext/javasphinx/javasphinx/htmlrst.py b/docs/source/_ext/javasphinx/javasphinx/htmlrst.py
deleted file mode 100644 (file)
index 687a034..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-#
-# Copyright 2013-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from __future__ import unicode_literals
-from builtins import str
-
-import collections
-import re
-
-from xml.sax.saxutils import escape as html_escape
-from bs4 import BeautifulSoup
-
-Cell = collections.namedtuple('Cell', ['type', 'rowspan', 'colspan', 'contents'])
-
-class Converter(object):
-    def __init__(self, parser):
-        self._unknown_tags = set()
-        self._clear = '\n\n..\n\n'
-
-        # Regular expressions
-        self._preprocess_anchors = re.compile(r'<a\s+name\s*=\s*["\']?(.+?)["\']?\s*>')
-        self._post_process_empty_lines = re.compile(r'^\s+$', re.MULTILINE)
-        self._post_process_compress_lines = re.compile(r'\n{3,}')
-        self._whitespace_with_newline = re.compile(r'[\s\n]+')
-        self._whitespace = re.compile(r'\s+')
-        self._html_tag = re.compile(r'<.*?>')
-
-        self._preprocess_entity = re.compile(r'&(nbsp|lt|gt|amp)([^;]|[\n])')
-        self._parser = parser
-
-    # --------------------------------------------------------------------------
-    # ---- reST Utility Methods ----
-
-    def _unicode(self, s):
-        if isinstance(s, unicode):
-            return s
-        return unicode(s, 'utf8')
-
-    def _separate(self, s):
-        return u'\n\n' + s + u'\n\n'
-
-    def _escape_inline(self, s):
-        return '\\ ' + s + '\\ '
-
-    def _inline(self, tag, s):
-        # Seems fishy if our inline markup spans lines. We will instead just return
-        # the string as is
-        if '\n' in s:
-            return s
-
-        s = s.strip()
-
-        if not s:
-            return s
-
-        return self._escape_inline(tag + s.strip() + tag)
-
-    def _role(self, role, s, label=None):
-        if label:
-            return self._escape_inline(':%s:`%s <%s>`' % (role, label, s))
-        return self._escape_inline(':%s:`%s`' % (role, s))
-
-    def _directive(self, directive, body=None):
-        header = '\n\n.. %s::\n\n' % (directive,)
-
-        if body:
-            return header + self._left_justify(body, 3) + '\n\n'
-        return header + '\n'
-
-    def _hyperlink(self, target, label):
-        return self._escape_inline('`%s <%s>`_' % (label, target))
-
-    def _listing(self, marker, items):
-        items = [self._left_justify(item, len(marker) + 1) for item in items]
-        items = [marker + item[len(marker):] for item in items]
-        return self._separate('..') + self._separate('\n'.join(items))
-
-    def _left_justify(self, s, indent=0):
-        lines = [l.rstrip() for l in s.split('\n')]
-        indents = [len(l) - len(l.lstrip()) for l in lines if l]
-
-        if not indents:
-            return s
-
-        shift = indent - min(indents)
-
-        if shift < 0:
-            return '\n'.join(l[-shift:] for l in lines)
-
-        prefix = ' ' * shift
-        return '\n'.join(prefix + l for l in lines)
-
-    def _compress_whitespace(self, s, replace=' ', newlines=True):
-        if newlines:
-            return self._whitespace_with_newline.sub(replace, s)
-        return self._whitespace.sub(replace, s)
-
-    # --------------------------------------------------------------------------
-    # ---- DOM Tree Processing ----
-
-    def _process_table_cells(self, table):
-        """ Compile all the table cells.
-
-        Returns a list of rows. The rows may have different lengths because of
-        column spans.
-
-        """
-
-        rows = []
-
-        for i, tr in enumerate(table.find_all('tr')):
-            row = []
-
-            for c in tr.contents:
-                cell_type = getattr(c, 'name', None)
-
-                if cell_type not in ('td', 'th'):
-                    continue
-
-                rowspan = int(c.attrs.get('rowspan', 1))
-                colspan = int(c.attrs.get('colspan', 1))
-                contents = self._process_children(c).strip()
-
-                if cell_type == 'th' and i > 0:
-                    contents = self._inline('**', contents)
-
-                row.append(Cell(cell_type, rowspan, colspan, contents))
-
-            rows.append(row)
-
-        return rows
-
-    def _process_table(self, node):
-        rows = self._process_table_cells(node)
-
-        if not rows:
-            return ''
-
-        table_num_columns = max(sum(c.colspan for c in row) for row in rows)
-
-        normalized = []
-
-        for row in rows:
-            row_num_columns = sum(c.colspan for c in row)
-
-            if row_num_columns < table_num_columns:
-                cell_type = row[-1].type if row else 'td'
-                row.append(Cell(cell_type, 1, table_num_columns - row_num_columns, ''))
-
-        col_widths = [0] * table_num_columns
-        row_heights = [0] * len(rows)
-
-        for i, row in enumerate(rows):
-            j = 0
-            for cell in row:
-                current_w = sum(col_widths[j:j + cell.colspan])
-                required_w = max(len(l) for l in cell.contents.split('\n'))
-
-                if required_w > current_w:
-                    additional = required_w - current_w
-                    col_widths[j] += additional - (cell.colspan - 1) * (additional // cell.colspan)
-                    for jj in range(j + 1, j + cell.colspan):
-                        col_widths[jj] += (additional // cell.colspan)
-
-                current_h = row_heights[i]
-                required_h = len(cell.contents.split('\n'))
-
-                if required_h > current_h:
-                    row_heights[i] = required_h
-
-                j += cell.colspan
-
-        row_sep = '+' + '+'.join('-' * (l + 2) for l in col_widths) + '+'
-        header_sep = '+' + '+'.join('=' * (l + 2) for l in col_widths) + '+'
-        lines = [row_sep]
-
-        for i, row in enumerate(rows):
-            for y in range(0, row_heights[i]):
-                line = []
-                j = 0
-                for c in row:
-                    w = sum(n + 3 for n in col_widths[j:j+c.colspan]) - 2
-                    h = row_heights[i]
-
-                    line.append('| ')
-                    cell_lines = c.contents.split('\n')
-                    content = cell_lines[y] if y < len(cell_lines) else ''
-                    line.append(content.ljust(w))
-
-                    j += c.colspan
-
-                line.append('|')
-                lines.append(''.join(line))
-
-            if i == 0 and all(c.type == 'th' for c in row):
-                lines.append(header_sep)
-            else:
-                lines.append(row_sep)
-
-        return self._separate('\n'.join(lines))
-
-    def _process_children(self, node):
-        parts = []
-        is_newline = False
-
-        for c in node.contents:
-            part = self._process(c)
-
-            if is_newline:
-                part = part.lstrip()
-
-            if part:
-                parts.append(part)
-                is_newline = part.endswith('\n')
-
-        return ''.join(parts)
-
-    def _process_text(self, node):
-        return ''.join(node.strings)
-
-    def _process(self, node):
-        if isinstance(node, str):
-            return self._compress_whitespace(node)
-
-        simple_tags = {
-            'b'      : lambda s: self._inline('**', s),
-            'strong' : lambda s: self._inline('**', s),
-            'i'      : lambda s: self._inline('*', s),
-            'em'     : lambda s: self._inline('*', s),
-            'tt'     : lambda s: self._inline('``', s),
-            'code'   : lambda s: self._inline('``', s),
-            'h1'     : lambda s: self._inline('**', s),
-            'h2'     : lambda s: self._inline('**', s),
-            'h3'     : lambda s: self._inline('**', s),
-            'h4'     : lambda s: self._inline('**', s),
-            'h5'     : lambda s: self._inline('**', s),
-            'h6'     : lambda s: self._inline('**', s),
-            'sub'    : lambda s: self._role('sub', s),
-            'sup'    : lambda s: self._role('sup', s),
-            'hr'     : lambda s: self._separate('') # Transitions not allowed
-            }
-
-        if node.name in simple_tags:
-            return simple_tags[node.name](self._process_text(node))
-
-        if node.name == 'p':
-            return self._separate(self._process_children(node).strip())
-
-        if node.name == 'pre':
-            return self._directive('parsed-literal', self._process_text(node))
-
-        if node.name == 'a':
-            if 'name' in node.attrs:
-                return self._separate('.. _' + node['name'] + ':')
-            if 'href' in node.attrs:
-                target = node['href']
-                label = self._compress_whitespace(self._process_text(node).strip('\n'))
-
-                if target.startswith('#'):
-                    return self._role('ref', target[1:], label)
-                if target.startswith('@'):
-                    return self._role('java:ref', target[1:], label)
-                return self._hyperlink(target, label)
-
-        if node.name == 'ul':
-            items = [self._process(n) for n in node.find_all('li', recursive=False)]
-            return self._listing('*', items)
-
-        if node.name == 'ol':
-            items = [self._process(n) for n in node.find_all('li', recursive=False)]
-            return self._listing('#.', items)
-
-        if node.name == 'li':
-            s = self._process_children(node)
-            s = s.strip()
-
-            # If it's multiline clear the end to correcly support nested lists
-            if '\n' in s:
-                s = s + '\n\n'
-
-            return s
-
-        if node.name == 'table':
-            return self._process_table(node)
-
-        self._unknown_tags.add(node.name)
-
-        return self._process_children(node)
-
-    # --------------------------------------------------------------------------
-    # ---- HTML Preprocessing ----
-
-    def _preprocess_inline_javadoc_replace(self, tag, f, s):
-        parts = []
-
-        start = '{@' + tag
-        start_length = len(start)
-
-        i = s.find(start)
-        j = 0
-
-        while i != -1:
-            parts.append(s[j:i])
-
-            # Find a closing bracket such that the brackets are balanced between
-            # them. This is necessary since code examples containing { and } are
-            # commonly wrapped in {@code ...} tags
-
-            try:
-                j = s.find('}', i + start_length) + 1
-                while s.count('{', i, j) != s.count('}', i, j):
-                    j = s.index('}', j) + 1
-            except ValueError:
-                raise ValueError('Unbalanced {} brackets in ' + tag + ' tag')
-
-            parts.append(f(s[i + start_length:j - 1].strip()))
-            i = s.find(start, j)
-
-        parts.append(s[j:])
-
-        return ''.join(parts)
-
-    def _preprocess_replace_javadoc_link(self, s):
-        s = self._compress_whitespace(s)
-
-        target = None
-        label = ''
-
-        if ' ' not in s:
-            target = s
-        else:
-            i = s.find(' ')
-
-            while s.count('(', 0, i) != s.count(')', 0, i):
-                i = s.find(' ', i + 1)
-
-                if i == -1:
-                    i = len(s)
-                    break
-
-            target = s[:i]
-            label = s[i:]
-
-        if target[0] == '#':
-            target = target[1:]
-
-        target = target.replace('#', '.').replace(' ', '').strip()
-
-        # Strip HTML tags from the target
-        target = self._html_tag.sub('', target)
-
-        label = label.strip()
-
-        return '<a href="@%s">%s</a>' % (target, label)
-
-    def _preprocess_close_anchor_tags(self, s):
-        # Add closing tags to all anchors so they are better handled by the parser
-        return self._preprocess_anchors.sub(r'<a name="\1"></a>', s)
-
-    def _preprocess_fix_entities(self, s):
-        return self._preprocess_entity.sub(r'&\1;\2', s)
-
-    def _preprocess(self, s_html):
-        to_tag = lambda t: lambda m: '<%s>%s</%s>' % (t, html_escape(m), t)
-        s_html = self._preprocess_inline_javadoc_replace('code', to_tag('code'), s_html)
-        s_html = self._preprocess_inline_javadoc_replace('literal', to_tag('span'), s_html)
-        s_html = self._preprocess_inline_javadoc_replace('docRoot', lambda m: '', s_html)
-        s_html = self._preprocess_inline_javadoc_replace('linkplain', self._preprocess_replace_javadoc_link, s_html)
-        s_html = self._preprocess_inline_javadoc_replace('link', self._preprocess_replace_javadoc_link, s_html)
-
-        # Make sure all anchor tags are closed
-        s_html = self._preprocess_close_anchor_tags(s_html)
-
-        # Fix up some entitities without closing ;
-        s_html = self._preprocess_fix_entities(s_html)
-
-        return s_html
-
-    # --------------------------------------------------------------------------
-    # ---- Conversion entry point ----
-
-    def convert(self, s_html):
-        if not isinstance(s_html, str):
-            s_html = str(s_html, 'utf8')
-
-        s_html = self._preprocess(s_html)
-
-        if not s_html.strip():
-            return ''
-
-        soup = BeautifulSoup(s_html, self._parser)
-        top = soup.html.body
-
-        result = self._process_children(top)
-
-        # Post processing
-        result = self._post_process_empty_lines.sub('', result)
-        result = self._post_process_compress_lines.sub('\n\n', result)
-        result = result.strip()
-
-        return result
diff --git a/docs/source/_ext/javasphinx/javasphinx/util.py b/docs/source/_ext/javasphinx/javasphinx/util.py
deleted file mode 100644 (file)
index 8e5f2a8..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from __future__ import unicode_literals
-from builtins import str
-
-import logging
-import re
-import sys
-
-class StringBuilder(list):
-    def build(self):
-        return str(self)
-
-    def __str__(self):
-        return ''.join(self)
-
-class Directive(object):
-
-    def __init__(self, typ, argument=''):
-        self.type = typ
-        self.argument = argument
-
-        self.options = []
-        self.content = []
-
-    def add_option(self, name, value=''):
-        self.options.append((name, value))
-
-    def add_content(self, o):
-        assert o is not None
-        self.content.append(o)
-
-    def build(self):
-        doc = Document()
-        doc.add_line('.. %s:: %s' % (self.type, self.argument))
-
-        for name, value in self.options:
-            doc.add_line('   :%s: %s\n' % (name, value))
-
-        content = Document()
-
-        for obj in self.content:
-            content.add_object(obj)
-
-        doc.clear()
-        for line in content.build().splitlines():
-            doc.add_line('   ' + line)
-        doc.clear()
-
-        return doc.build()
-
-class Document(object):
-    remove_trailing_whitespace_re = re.compile('[ \t]+$', re.MULTILINE)
-    collapse_empty_lines_re = re.compile('\n' + '{3,}', re.DOTALL)
-
-    def __init__(self):
-        self.content = []
-
-    def add_object(self, o):
-        assert o is not None
-
-        self.content.append(o)
-
-    def add(self, s):
-        self.add_object(s)
-
-    def add_line(self, s):
-        self.add(s)
-        self.add('\n')
-
-    def add_heading(self, s, t='-'):
-        self.add_line(s)
-        self.add_line(t * len(s))
-
-    def clear(self):
-        self.add('\n\n')
-
-    def build(self):
-        output = StringBuilder()
-
-        for obj in self.content:
-            if isinstance(obj, Directive):
-                output.append('\n\n')
-                output.append(obj.build())
-                output.append('\n\n')
-            elif isinstance(obj, Document):
-                output.append(obj.build())
-            else:
-                output.append(str(obj))
-
-        output.append('\n\n')
-
-        output = str(output)
-        output = self.remove_trailing_whitespace_re.sub('', output)
-        output = self.collapse_empty_lines_re.sub('\n\n', output)
-
-        return output
-
-def error(s, *args, **kwargs):
-    logging.error(s, *args, **kwargs)
-    sys.exit(1)
-
-def unexpected(s, *args, **kwargs):
-    logging.exception(s, *args, **kwargs)
-    sys.exit(1)
diff --git a/docs/source/_ext/javasphinx/setup.py b/docs/source/_ext/javasphinx/setup.py
deleted file mode 100644 (file)
index 3e4f362..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Copyright 2012-2015 Bronto Software, Inc. and contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from setuptools import setup
-
-setup(
-    name = "javasphinx",
-    packages = ["javasphinx"],
-    version = "0.9.15",
-    author = "Chris Thunes",
-    author_email = "cthunes@brewtab.com",
-    url = "http://github.com/bronto/javasphinx",
-    description = "Sphinx extension for documenting Java projects",
-    license = "Apache 2.0",
-    classifiers = [
-        "Programming Language :: Python",
-        "Development Status :: 4 - Beta",
-        "Operating System :: OS Independent",
-        "License :: OSI Approved :: Apache Software License",
-        "Intended Audience :: Developers",
-        "Topic :: Software Development :: Libraries"
-        ],
-    install_requires=[
-        "javalang>=0.10.1",
-        "lxml",
-        "beautifulsoup4",
-        "future",
-        "docutils",
-        "sphinx"
-    ],
-    entry_points={
-        'console_scripts': [
-            'javasphinx-apidoc = javasphinx.apidoc:main'
-            ]
-        },
-    long_description = """\
-==========
-javasphinx
-==========
-
-javasphinx is an extension to the Sphinx documentation system which adds support
-for documenting Java projects. It includes a Java domain for writing
-documentation manually and a javasphinx-apidoc utility which will automatically
-generate API documentation from existing Javadoc markup.
-"""
-)
index 0ce11e7..a92391c 100644 (file)
@@ -5,9 +5,6 @@
 {% block breadcrumbs_aside %}
   <li class="wy-breadcrumbs-aside">
     {% if hasdoc(pagename) and pagename != "search" and pagename != "genindex" %}
-    {# TODO: How to rule out all java pages?
-     #    (not re.match(pagename, "java/org/simgrid"))
-     # fails because re is not imported #}
 
       <a href="{{ meta['framagit_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on FramaGit') }}</a>
     {% endif %}
index d3dc33e..22eeff6 100644 (file)
@@ -251,127 +251,3 @@ Network Zone (:cpp:type:`msg_netzone_t`) and associated functions.
 .. doxygenfunction:: MSG_zone_get_root
 .. doxygenfunction:: MSG_zone_get_sons
 .. doxygenfunction:: MSG_zone_set_property_value
-
-.. _Java_doc:
-
-Java bindings
-*************
-
-This section describes jMSG, the Java API to Simgrid. This API mimics
-:ref:`MSG <MSG_doc>`, which is a simple yet somehow realistic interface.
-The full reference documentation is provided at the end of this page.
-
-Most of the documentation of the :ref:`MSG API <MSG_doc>` in C applies
-directly to the Java bindings (any divergence is seen as a bug that we
-should fix). MSG structures are mapped to Java objects as expected,
-and the MSG functions are methods in these objects.
-
-Installing the Java bindings
-============================
-
-The easiest is to use a :ref:`precompiled jarfile <install_java_precompiled>`,
-but some people may prefer to :ref:`compile it from the sources <install_src>`.
-
-
-Using the Java bindings
-=======================
-
-In most cases, you can use the SimGrid bindings as if it was a Java
-library:
-
-.. code-block:: console
-
-   $ javac -classpath .:path/to/simgrid.jar your/java/Code.java
-   $ java -classpath .:path/to/simgrid.jar your.java.Code the/parameter/to/your/code
-
-For example:
-
-.. code-block:: console
-
-   $ cd examples/deprecated/java
-   $ java -classpath ../../simgrid.jar:. .:../../simgrid.jar app.pingpong.Main ../platforms/platform.xml
-
-Any SimGrid simulation (java or not) is usually constituted of several
-kind of actors or processes (classes extending @c Msg.Process) that
-are deployed over the hosts of the virtual platform. So, your code
-should declare these actors, plus a Main class in charge of deploying
-your actors on the platform. Please refer to the examples for details.
-
-Troubleshooting
-===============
-
-Actually, these bindings are not only implemented in Java. They do use
-the C implementation of SimGrid. This should be transparent as this
-library is directly included in the ``simgrid.jar`` file but things can
-still go wrong is several ways.
-
-Error: library simgrid not found
---------------------------------
-
-This means that the JVM fails to load the native library. If you use a
-precompiled jarfile, please report this bug.
-
-If you built it yourself, you can try to use an installed version of
-the library instead of the one included in the jar. For that, add the
-path to the native library into the ``LD_LIBRARY_PATH`` variable (or in
-the ``DYLD_LIBRARY_PATH`` on macOS).
-
-pthread_create failed
----------------------
-
-You reached the amount of threads that can be run on your system. Try
-increasing the thread limits of your operating system.
-
-Other errors
-------------
-
-When using jMSG, your program can crash for 3 main reasons:
-
-- Your Java part is not good: you'll have a good old java exception thrown,
-  and hence you should be able to correct it by yourself.
-- Our java part is not good: you'll also have a java exception thrown, but
-  we have real doubts this can happen, since the java part is only a JNI
-  binding. The other option is that it crashed because you used incorrectly
-  the MSG API, so this means also you should have an MSGException. It means
-  you should read carefully MSG samples and/or documentation.
-- Something has crashed in the C part. Okay, here comes the tricky
-  thing. It happens mainly for 2 reasons:
-
-  - When something goes wrong in your simulation, sometimes the C part stops
-    because you used SimGrid incorrectly, and JNI bindings are not fond of that.
-    It means that you'll have something that looks ugly, but you should be able
-    to identify what's going wrong in your code by carefully reading the whole
-    error message
-  - It may happen that the problem comes directly from SimGrid: in this case,
-    the error should be uglier. In that case, you may submit a bug directly to
-    SimGrid.
-
-API Reference
-=============
-
-Package org.simgrid.msg
------------------------
-
-.. java:package:: org.simgrid.msg
-
-.. toctree::
-   :maxdepth: 1
-
-   Class org.simgrid.msg.As <java/org/simgrid/msg/As>
-   Class org.simgrid.msg.Comm <java/org/simgrid/msg/Comm>
-   Class org.simgrid.msg.Host <java/org/simgrid/msg/Host>
-   Class org.simgrid.msg.HostFailureException <java/org/simgrid/msg/HostFailureException>
-   Class org.simgrid.msg.HostNotFoundException <java/org/simgrid/msg/HostNotFoundException>
-   Class org.simgrid.msg.JniException <java/org/simgrid/msg/JniException>
-   Class org.simgrid.msg.Msg <java/org/simgrid/msg/Msg>
-   Class org.simgrid.msg.MsgException <java/org/simgrid/msg/MsgException>
-   Class org.simgrid.msg.Mutex <java/org/simgrid/msg/Mutex>
-   Class org.simgrid.msg.Process <java/org/simgrid/msg/Process>
-   Class org.simgrid.msg.ProcessKilledError <java/org/simgrid/msg/ProcessKilledError>
-   Class org.simgrid.msg.ProcessNotFoundException <java/org/simgrid/msg/ProcessNotFoundException>
-   Class org.simgrid.msg.Semaphore <java/org/simgrid/msg/Semaphore>
-   Class org.simgrid.msg.Task <java/org/simgrid/msg/Task>
-   Class org.simgrid.msg.TaskCancelledException <java/org/simgrid/msg/TaskCancelledException>
-   Class org.simgrid.msg.TimeoutException <java/org/simgrid/msg/TimeoutException>
-   Class org.simgrid.msg.TransferFailureException <java/org/simgrid/msg/TransferFailureException>
-   Class org.simgrid.msg.VM <java/org/simgrid/msg/VM>
index 2cd7745..39ee5c6 100644 (file)
@@ -32,8 +32,7 @@ to mix several interfaces in the same simulation.
    that you want to replay, for example to study how a P2P DHT overlay
    reacts to a given workload.
  - Simulating algorithms with the legacy interface: :ref:`MSG for distributed
-   algorithms <MSG_doc>` (in :ref:`C <MSG_doc>` or :ref:`Java
-   <Java_doc>`). SimGrid was founded in 1998, and many interfaces were proposed
+   algorithms <MSG_doc>` (in :ref:`C <MSG_doc>`). SimGrid was founded in 1998, and many interfaces were proposed
    along the way. MSG (introduced around 2002) is still present in SimGrid. It
    does not evolve anymore, but given its popularity, it will not be removed
    until at least 2020. That being said, our goal is to make S4U so useful that
index 1966f09..a16b71f 100644 (file)
@@ -26,9 +26,7 @@ read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
 if read_the_docs_build:
     subprocess.call('pwd', shell=True) # should be in docs/source
     subprocess.call('doxygen', shell=True)
-    subprocess.call('javasphinx-apidoc --force -o java/ ../../src/bindings/java/org/simgrid/msg', shell=True)
-    subprocess.call('rm java/packages.rst', shell=True)
-
 # -- Project information -----------------------------------------------------
 
 project = u'SimGrid'
@@ -55,7 +53,6 @@ extensions = [
     'sphinx.ext.autosummary',
     'sphinx_tabs.tabs',
     'sphinx_copybutton',
-    'javasphinx',
     'showfile',
 ]
 
index 050033f..689ef77 100644 (file)
@@ -28,7 +28,7 @@ assess these systems.
 Technically speaking, SimGrid is a library. It is neither a graphical
 interface nor a command-line simulator running user scripts. The
 interaction with SimGrid is done by writing programs with the exposed
-functions to build your own simulator. This can be done in C/C++, Python or Java,
+functions to build your own simulator. This can be done in C/C++ or Python,
 on Linux, Mac OSX or Windows (using the WSL).
 
 SimGrid is a Free Software distributed under the LGPL-2.1-only license. You are
diff --git a/examples/deprecated/java/CMakeLists.txt b/examples/deprecated/java/CMakeLists.txt
deleted file mode 100644 (file)
index 82c20ed..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-set(app-bittorrent_files        Main  Common  Connection MessageTask Peer  Tracker TrackerTask)
-set(app-centralizedmutex_files  Main  Coordinator  GrantTask Node ReleaseTask  RequestTask)
-set(app-masterworker_files      Main  Master Worker)
-set(app-pingpong_files          Main  PingPongTask Receiver Sender)
-set(app-tokenring_files         Main  RelayRunner)
-set(async-waitall_files         Main  Receiver Sender)
-set(async-yield_files           Main  Yielder)
-set(async-dsend_files           Main  Receiver Sender)
-set(cloud-masterworker_files    Main  Master Worker)
-set(cloud-migration_files       Main  Daemon Test XVM)
-set(dht-chord_files             Main  ChordTask  Common FindSuccessorAnswerTask  FindSuccessorTask
-                                      GetPredecessorAnswerTask GetPredecessorTask Node  NotifyTask)
-set(dht-kademlia_files          Main  Answer  Bucket  Common Contact FindNodeAnswerTask  FindNodeTask
-                                      KademliaTask  Node  RoutingTable)
-set(trace-pingpong_files        Main  PingPongTask Receiver Sender)
-set(energy-consumption_files    Main  EnergyConsumer)
-set(energy-pstate_files         Main  PstateRunner)
-set(energy-vm_files             Main  EnergyVMRunner)
-set(process-kill_files          Main  Killer  Victim)
-set(process-migration_files     Main  Emigrant  Policeman)
-set(process-startkilltime_files Main  Sleeper)
-set(process-suspend_files       Main  DreamMaster  LazyGuy)
-set(task-priority_files         Main  Test)
-set(hostload_files              Main  LoadRunner)
-
-if(enable_java)
-  add_custom_target(java-all COMMENT "Building all Java examples...")
-  add_dependencies(tests java-all)
-  add_dependencies(java-all simgrid-java) # useful when the libs are not included in the jar
-endif()
-
-foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend
-         cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload
-         process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong)
-  string (REPLACE "-" "/" example_dir ${example})
-  set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir})
-  foreach (filename ${${example}_files} )
-    set( ${example}_sources "${${example}_sources}" "${srcdir}/${filename}.java")
-  endforeach()
-
-  if(enable_java)
-    add_jar(java-${example} SOURCES ${${example}_sources}
-            INCLUDE_JARS simgrid-java_jar
-            OUTPUT_NAME ${example}
-            OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${example_dir})
-    add_dependencies(java-all java-${example})
-
-    string (REPLACE "-" "/" example_dir ${example})
-    ADD_TESH(java-${example}  --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/java --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath=""${TESH_CLASSPATH}${TESH_CLASSPATH_SEPARATOR}${example}.jar"" --cd ${CMAKE_BINARY_DIR}/examples/deprecated/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/deprecated/java/${example_dir}/${example}.tesh)
-  endif()
-  set(examples_src  ${examples_src}  ${${example}_sources})
-  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
-endforeach()
-
-set(examples_src  ${examples_src}                                                                          PARENT_SCOPE)
-set(tesh_files    ${tesh_files}                                                                            PARENT_SCOPE)
-set(bin_files     ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/generate.py                  PARENT_SCOPE)
-set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/README
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration/README                      PARENT_SCOPE)
-set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bittorrent.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/app/centralizedmutex/centralizedmutex.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/masterworker.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml                  PARENT_SCOPE)
diff --git a/examples/deprecated/java/app/bittorrent/Common.java b/examples/deprecated/java/app/bittorrent/Common.java
deleted file mode 100644 (file)
index a0bf205..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-
-/* Common constants for use in the simulation */
-class Common {
-  public static final String TRACKER_MAILBOX = "tracker_mailbox";
-  public static final int FILE_SIZE = 5120;
-  public static final int FILE_PIECE_SIZE = 512;
-  public static final int FILE_PIECES = 10;
-  public static final int PIECES_BLOCKS = 5;
-  public static final int BLOCKS_REQUESTED = 2;
-  public static final int PIECE_COMM_SIZE = 1;
-  public static final int MESSAGE_SIZE = 1; /* Information message size */
-  public static final int MAXIMUM_PEERS = 50;  /* Max number of peers sent by the tracker to clients */
-  public static final int TRACKER_QUERY_INTERVAL = 1000;  /* Interval of time where the peer should send a request to the tracker */
-  public static final double TRACKER_COMM_SIZE = 1;  /* Communication size for a task to the tracker */
-  public static final int GET_PEERS_TIMEOUT = 10000;  /* Timeout for the get peers data */
-  public static final int TIMEOUT_MESSAGE = 10;
-  public static final int TRACKER_RECEIVE_TIMEOUT = 10;
-  public static final int MAX_UNCHOKED_PEERS = 4;  /* Number of peers that can be unchocked at a given time */
-  public static final int UPDATE_CHOKED_INTERVAL = 30;  /* Interval between each update of the choked peers */
-  public static final int MAX_PIECES = 1;  /* Number of pieces the peer asks for simultaneously */
-  private Common() {
-    throw new IllegalAccessError("Utility class");
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/Connection.java b/examples/deprecated/java/app/bittorrent/Connection.java
deleted file mode 100644 (file)
index 17cb1ea..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-import java.util.Arrays;
-
-public class Connection {
-  protected int id;
-  protected char[] bitfield;
-  protected String mailbox;
-  // Indicates if we are interested in something this peer has
-  protected boolean amInterested = false;
-  // Indicates if the peer is interested in one of our pieces
-  protected boolean interested = false;
-  // Indicates if the peer is choked for the current peer
-  protected boolean chokedUpload = true;
-  // Indicates if the peer has choked the current peer
-  protected boolean chokedDownload = true;
-  // Number of messages we have received from the peer
-  protected int messagesCount = 0;
-  protected double peerSpeed = 0;
-  protected double lastUnchoke = 0;
-
-  public Connection(int id) {
-    this.id = id;
-    this.mailbox = Integer.toString(id);
-  }
-
-  // Add a new value to the peer speed average
-  public void addSpeedValue(double speed) {
-    peerSpeed = peerSpeed * 0.55 + speed * 0.45;
-  }
-
-  @Override
-  public String toString() {
-    return "Connection [id=" + id + ", bitfield=" + Arrays.toString(bitfield) + ", mailbox=" + mailbox
-        + ", amInterested=" + amInterested + ", interested=" + interested + ", chokedUpload=" + chokedUpload
-        + ", chokedDownload=" + chokedDownload + "]";
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/Main.java b/examples/deprecated/java/app/bittorrent/Main.java
deleted file mode 100644 (file)
index 8500c6d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-
-import org.simgrid.msg.Msg;
-
-class Main{
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 2) {
-      Msg.info("Usage   : Bittorrent platform_file deployment_file");
-      Msg.info("example : Bittorrent ../platforms/cluster_backbone.xml bittorrent.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    Msg.deployApplication(args[1]);
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/MessageTask.java b/examples/deprecated/java/app/bittorrent/MessageTask.java
deleted file mode 100644 (file)
index a43dbd9..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-import org.simgrid.msg.Task;
-
-public class MessageTask extends Task {
-  public enum Type {
-    HANDSHAKE,
-    CHOKE,
-    UNCHOKE,
-    INTERESTED,
-    NOTINTERESTED,
-    HAVE,
-    BITFIELD,
-    REQUEST,
-    PIECE
-  }
-
-  protected Type type;
-  protected String issuerHostname;
-  protected String mailbox;
-  protected int peerId;
-  protected char[] bitfield;
-  protected int index;
-  protected int blockIndex;
-  protected int blockLength;
-  protected boolean stalled;
-
-  public MessageTask(Type type, String issuerHostname, String mailbox, int peerId) {
-    this(type,issuerHostname,mailbox,peerId,-1,false,-1,-1);
-  }
-
-  public MessageTask(Type type, String issuerHostname, String mailbox, int peerId, int index) {
-    this(type,issuerHostname,mailbox,peerId,index,false,-1,-1);
-  }
-
-  // builds a new bitfield message
-  public MessageTask(Type type, String issuerHostname, String mailbox, int peerId, char[] bitfield) {
-    this(type,issuerHostname,mailbox,peerId,-1,false,-1,-1);
-    this.bitfield = bitfield;
-  }
-
-  // build a new "request"  message
-  public MessageTask(Type type, String issuerHostname, String mailbox, int peerId, int index, int blockIndex,
-                     int blockLength) {
-    this(type,issuerHostname,mailbox,peerId,index,false,blockIndex,blockLength);
-  }
-
-  // build a new "piece" message
-  public MessageTask(Type type, String issuerHostname, String mailbox, int peerId, int index, boolean stalled,
-                     int blockIndex, int blockLength) {
-    this.type = type;
-    this.issuerHostname = issuerHostname;
-    this.mailbox = mailbox;
-    this.peerId = peerId;
-    this.index = index;
-    this.stalled = stalled;
-    this.blockIndex = blockIndex;
-    this.blockLength = blockLength;
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/Peer.java b/examples/deprecated/java/app/bittorrent/Peer.java
deleted file mode 100644 (file)
index 8d86aac..0000000
+++ /dev/null
@@ -1,627 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.Random;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Comm;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Peer extends Process {
-  Random rand = new Random();
-  protected int round = 0;
-  protected double beginReceiveTime;
-  protected double deadline;
-  protected int id;
-  protected String mailbox;
-  protected String mailboxTracker;
-  protected String hostname;
-  protected int pieces = 0;
-  protected char[] bitfield = new char[Common.FILE_PIECES];
-  protected char[][] bitfieldBlocks = new char[Common.FILE_PIECES][Common.PIECES_BLOCKS];
-  protected short[] piecesCount = new short[Common.FILE_PIECES];
-  protected int piecesRequested = 0;
-  protected ArrayList<Integer> currentPieces = new ArrayList<>();
-  protected int currentPiece = -1;
-  protected HashMap<Integer, Connection> activePeers = new HashMap<>();
-  protected HashMap<Integer, Connection> peers = new HashMap<>();
-  protected Comm commReceived = null;
-
-  public Peer(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  @Override
-  public void main(String[] args) throws MsgException {
-    //Check arguments
-    if (args.length != 3 && args.length != 2) {
-      Msg.info("Wrong number of arguments");
-    }
-    init(Integer.parseInt(args[0]), (args.length == 3));
-
-    //Retrieve the deadline
-    deadline = Double.parseDouble(args[1]);
-    if (deadline < 0) {
-      Msg.info("Wrong deadline supplied");
-      return;
-    }
-    Msg.info("Hi, I'm joining the network with id " + id);
-    //Getting peer data from the tracker
-    if (getPeersData()) {
-      Msg.debug("Got " + peers.size() + " peers from the tracker");
-      Msg.debug("Here is my current status: " + getStatus());
-      beginReceiveTime = Msg.getClock();
-      if (hasFinished()) {
-        pieces = Common.FILE_PIECES;
-        sendHandshakeAll();
-        seedLoop();
-      } else {
-        leechLoop();
-        seedLoop();
-      }
-    } else {
-      Msg.info("Couldn't contact the tracker.");
-    }
-    Msg.info("Here is my current status: " + getStatus());
-  }
-
-  private void leechLoop() {
-    double nextChokedUpdate = Msg.getClock() + Common.UPDATE_CHOKED_INTERVAL;
-    Msg.debug("Start downloading.");
-    // Send a "handshake" message to all the peers it got(it couldn't have gotten more than 50 peers anyway)
-    sendHandshakeAll();
-    //Wait for at least one "bitfield" message.
-    waitForPieces();
-    Msg.debug("Starting main leech loop");
-    while (Msg.getClock() < deadline && pieces < Common.FILE_PIECES) {
-      if (commReceived == null) {
-        commReceived = Task.irecv(mailbox);
-      }
-      try {
-        if (commReceived.test()) {
-          handleMessage(commReceived.getTask());
-          commReceived = null;
-        } else {
-          //If the user has a pending interesting
-          if (currentPiece != -1) {
-            sendInterestedToPeers();
-          } else {
-            if (currentPieces.size() < Common.MAX_PIECES) {
-              updateCurrentPiece();
-            }
-          }
-          //We don't execute the choke algorithm if we don't already have a piece
-          if (Msg.getClock() >= nextChokedUpdate && pieces > 0) {
-            updateChokedPeers();
-            nextChokedUpdate += Common.UPDATE_CHOKED_INTERVAL;
-          } else {
-            waitFor(1);
-          }
-        }
-      }
-      catch (MsgException e) {
-        e.printStackTrace();
-        commReceived = null;
-      }
-    }
-  }
-
-  private void seedLoop() {
-    double nextChokedUpdate = Msg.getClock() + Common.UPDATE_CHOKED_INTERVAL;
-    Msg.debug("Start seeding.");
-    //start the main seed loop
-    while (Msg.getClock() < deadline) {
-      if (commReceived == null) {
-        commReceived = Task.irecv(mailbox);
-      }
-      try {
-        if (commReceived.test()) {
-          handleMessage(commReceived.getTask());
-          commReceived = null;
-        } else {
-          if (Msg.getClock() >= nextChokedUpdate) {
-            updateChokedPeers();
-            //TODO: Change the choked peer algorithm when seeding
-            nextChokedUpdate += Common.UPDATE_CHOKED_INTERVAL;
-          } else {
-            waitFor(1);
-          }
-        }
-      }
-      catch (MsgException e) {
-        commReceived = null;
-      }
-    }
-  }
-
-  /**
-   * @brief Initialize the various peer data
-   * @param id id of the peer to take in the network
-   * @param seed indicates if the peer is a seed
-   */
-  private void init(int id, boolean seed) {
-    this.id = id;
-    this.mailbox = Integer.toString(id);
-    this.mailboxTracker = "tracker_" + Integer.toString(id);
-    if (seed) {
-      for (int i = 0; i < bitfield.length; i++) {
-        bitfield[i] = '1';
-        for (int j = 0; j < bitfieldBlocks[i].length; j++) {
-          bitfieldBlocks[i][j] = '1';
-        }
-      }
-    } else {
-      for (int i = 0; i < bitfield.length; i++) {
-        bitfield[i] = '0';
-        for (int j = 0; j < bitfieldBlocks[i].length; j++) {
-          bitfieldBlocks[i][j] = '0'  ;
-        }
-      }
-    }
-    this.hostname = getHost().getName();
-  }
-
-  private boolean getPeersData() {
-    boolean success = false;
-    double timeout = Msg.getClock() + Common.GET_PEERS_TIMEOUT;
-    //Build the task to send to the tracker
-    TrackerTask taskSend = new TrackerTask(hostname, mailboxTracker, id);
-
-    while (Msg.getClock() < timeout) {
-      try {
-        Msg.debug("Sending a peer request to the tracker.");
-        taskSend.send(Common.TRACKER_MAILBOX,Common.GET_PEERS_TIMEOUT);
-        break;
-      }
-      catch (MsgException e) {
-        e.printStackTrace();
-      }
-    }
-    while (!success && Msg.getClock() < timeout) {
-      commReceived = Task.irecv(this.mailboxTracker);
-      try {
-        commReceived.waitCompletion(Common.GET_PEERS_TIMEOUT);
-        if (commReceived.getTask() instanceof TrackerTask) {
-          TrackerTask task = (TrackerTask)commReceived.getTask();
-          for (Integer peerId: task.peers) {
-            if (peerId != this.id) {
-              peers.put(peerId, new Connection(peerId));
-            }
-          }
-          success = true;
-        }
-      }
-      catch (MsgException e) {
-        e.printStackTrace();
-      }
-      commReceived = null;
-    }
-    return success;
-  }
-
-  private void handleMessage(Task task) {
-    MessageTask message = (MessageTask)task;
-    Connection remotePeer = peers.get(message.peerId);
-    switch (message.type) {
-      case HANDSHAKE:
-        Msg.debug("Received a HANDSHAKE message from " + message.mailbox);
-        //Check if the peer is in our connection list
-        if (remotePeer == null) {
-          peers.put(message.peerId, new Connection(message.peerId));
-          sendHandshake(message.mailbox);
-        }
-        //Send our bitfield to the pair
-        sendBitfield(message.mailbox);
-      break;
-      case BITFIELD:
-        Msg.debug("Received a BITFIELD message from " + message.peerId + " (" + message.issuerHostname + ")");
-        //update the pieces list
-        updatePiecesCountFromBitfield(message.bitfield);
-        //Update the current piece
-        if (currentPiece == -1 && pieces < Common.FILE_PIECES && currentPieces.size() < Common.MAX_PIECES) {
-          updateCurrentPiece();
-        }
-        remotePeer.bitfield  = message.bitfield.clone();
-      break;
-      case INTERESTED:
-        Msg.debug("Received an INTERESTED message from " + message.peerId + " (" + message.issuerHostname + ")");
-        assert remotePeer != null;
-        remotePeer.interested = true;
-      break;
-      case NOTINTERESTED:
-        Msg.debug("Received a NOTINTERESTED message from " + message.peerId + " (" + message.issuerHostname + ")");
-        assert remotePeer != null;
-        remotePeer.interested = false;
-      break;
-      case UNCHOKE:
-        Msg.debug("Received an UNCHOKE message from " + message.peerId + "(" + message.issuerHostname + ")");
-        assert remotePeer != null;
-        remotePeer.chokedDownload = false;
-        activePeers.put(remotePeer.id,remotePeer);
-        sendRequestsToPeer(remotePeer);
-      break;
-      case CHOKE:
-        Msg.debug("Received a CHOKE message from " + message.peerId + " (" + message.issuerHostname + ")");
-        assert remotePeer != null;
-        remotePeer.chokedDownload = true;
-        activePeers.remove(remotePeer.id);
-      break;
-      case HAVE:
-        if (remotePeer.bitfield == null) {
-          return;
-        }
-        Msg.debug("Received a HAVE message from " + message.peerId + " (" + message.issuerHostname + ")");
-        assert message.index >= 0 && message.index < Common.FILE_PIECES;
-        assert remotePeer.bitfield != null;
-        remotePeer.bitfield[message.index] = '1';
-        piecesCount[message.index]++;
-        //Send interested message to the peer if he has what we want
-        if (!remotePeer.amInterested && currentPieces.contains(message.index) ) {
-          remotePeer.amInterested = true;
-          sendInterested(remotePeer.mailbox);
-        }
-
-        if (currentPieces.contains(message.index)) {
-          int blockIndex = getFirstBlock(message.index);
-          int blockLength = Common.PIECES_BLOCKS - blockIndex ;
-          blockLength = blockLength > Common.BLOCKS_REQUESTED ? Common.BLOCKS_REQUESTED : blockLength;
-          sendRequest(message.mailbox,message.index,blockIndex,blockLength);
-        }
-      break;
-      case REQUEST:
-        assert message.index >= 0 && message.index < Common.FILE_PIECES;
-        if (!remotePeer.chokedUpload) {
-          Msg.debug("Received a REQUEST from " + message.peerId + "(" + message.issuerHostname + ") for "
-                    + message.peerId);
-          if (bitfield[message.index] == '1') {
-            sendPiece(message.mailbox,message.index,false,message.blockIndex,message.blockLength);
-          } else {
-            Msg.debug("Received a REQUEST from " + message.peerId + " (" + message.issuerHostname
-                      + ") but he is choked" );
-          }
-        }
-      break;
-      case PIECE:
-        if (message.stalled) {
-          Msg.debug("The received piece " + message.index + " from " + message.peerId + " (" + message.issuerHostname
-                    + ") is stalled");
-        } else {
-          Msg.debug("Received piece " + message.index + " from " + message.peerId + " ("
-                    + message.issuerHostname + ")");
-          if (bitfield[message.index] == '0') {
-            updateBitfieldBlocks(message.index,message.blockIndex,message.blockLength);
-            if (pieceComplete(message.index)) {
-              piecesRequested--;
-              //Removing the piece from our piece list.
-              currentPieces.remove((Object)Integer.valueOf(message.index));
-              //Setting the fact that we have the piece
-              bitfield[message.index] = '1';
-              pieces++;
-              Msg.debug("My status is now " + getStatus());
-              //Sending the information to all the peers we are connected to
-              sendHave(message.index);
-              //sending UNINTERESTED to peers that doesn't have what we want.
-              updateInterestedAfterReceive();
-            }
-          } else {
-            Msg.debug("However, we already have it.");
-          }
-        }
-      break;
-      default:
-        Msg.error("Unexpected message type: " + message.type);
-        break;
-    }
-    if (remotePeer != null) {
-      remotePeer.addSpeedValue(1 / (Msg.getClock() - beginReceiveTime));
-    }
-    beginReceiveTime = Msg.getClock();
-  }
-
-  private void waitForPieces() {
-    boolean finished = false;
-    while (Msg.getClock() < deadline && !finished) {
-      if (commReceived == null) {
-        commReceived = Task.irecv(mailbox);
-      }
-      try {
-        commReceived.waitCompletion(Common.TIMEOUT_MESSAGE);
-        handleMessage(commReceived.getTask());
-        if (currentPiece != -1) {
-          finished = true;
-        }
-        commReceived = null;
-      }
-      catch (MsgException e) {
-        commReceived = null;
-      }
-    }
-  }
-
-  private boolean hasFinished() {
-    for (int i = 0; i < bitfield.length; i++) {
-      if (bitfield[i] == '1') {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * @brief Updates the list of who has a piece from a bitfield
-   * @param bitfield bitfield
-   */
-  private void updatePiecesCountFromBitfield(char[] bitfield) {
-    for (int i = 0; i < Common.FILE_PIECES; i++) {
-      if (bitfield[i] == '1') {
-        piecesCount[i]++;
-      }
-    }
-  }
-
-  /**
-   * Update the piece the peer is currently interested in.
-   * There is two cases (as described in "Bittorrent Architecture Protocol", Ryan Toole :
-   * If the peer has less than 3 pieces, he chooses a piece at random.
-   * If the peer has more than pieces, he downloads the pieces that are the less
-   * replicated
-   */
-  private void updateCurrentPiece() {
-    if (currentPieces.size() >= (Common.FILE_PIECES - pieces)) {
-      return;
-    }
-
-    //TODO: trivial min algorithm when pieces >= 3
-    do {
-      currentPiece = rand.nextInt(Common.FILE_PIECES);
-    } while (!(bitfield[currentPiece] == '0' && !currentPieces.contains(currentPiece)));
-
-    currentPieces.add(currentPiece);
-    Msg.debug("New interested piece: " + currentPiece);
-    assert currentPiece >= 0 && currentPiece < Common.FILE_PIECES;
-  }
-
-  // Update the list of current choked and unchoked peers, using the choke algorithm
-  private void updateChokedPeers() {
-    round = (round + 1) % 3;
-    if (peers.isEmpty()) {
-      return;
-    }
-    //remove a peer from the list
-    Iterator<Entry<Integer, Connection>> it = activePeers.entrySet().iterator();
-    if (it.hasNext()) {
-      Entry<Integer,Connection> e = it.next();
-      Connection peerChoked = e.getValue();
-      peerChoked.chokedUpload = true;
-      sendChoked(peerChoked.mailbox);
-      activePeers.remove(e.getKey());
-    }
-    Connection peerChosen = null;
-    //Separate the case from when the peer is seeding.
-    if (pieces == Common.FILE_PIECES) {
-      //Find the last unchoked peer.
-      double unchokeTime = deadline + 1;
-      for (Connection connection : peers.values()) {
-        if (connection.lastUnchoke < unchokeTime && connection.interested) {
-          peerChosen = connection;
-          unchokeTime = connection.lastUnchoke;
-        }
-      }
-    } else {
-      //Random optimistic unchoking
-      if (round == 0) {
-        int j = 0;
-        do {
-          int i = 0;
-          int idChosen = rand.nextInt(peers.size());
-          for (Connection connection : peers.values()) {
-            if (i == idChosen) {
-              peerChosen = connection;
-              break;
-            }
-            i++;
-          } //TODO: Not really the best way ever
-          if (peerChosen != null && !peerChosen.interested) {
-            peerChosen = null;
-          }
-          j++;
-        } while (peerChosen == null && j < Common.MAXIMUM_PEERS);
-      } else {
-        Connection fastest = null;
-        double fastestSpeed = 0;
-        for (Connection c : peers.values()) {
-          if (c.peerSpeed > fastestSpeed && c.interested && c.chokedUpload) {
-            fastest = c;
-            fastestSpeed = c.peerSpeed;
-          }
-        }
-        peerChosen = fastest;
-      }
-    }
-    if (peerChosen != null) {
-      activePeers.put(peerChosen.id,peerChosen);
-      peerChosen.chokedUpload = false;
-      peerChosen.lastUnchoke = Msg.getClock();
-      sendUnchoked(peerChosen.mailbox);
-    }
-  }
-
-  // Updates our "interested" state about peers: send "not interested" to peers that don't have any more pieces we want.
-  private void updateInterestedAfterReceive() {
-    boolean interested;
-    for (Connection connection : peers.values()) {
-      interested = false;
-      if (connection.amInterested) {
-        for (Integer piece : currentPieces) {
-          if (connection.bitfield[piece] == '1') {
-            interested = true;
-            break;
-          }
-        }
-        if (!interested) {
-          connection.amInterested = false;
-          sendNotInterested(connection.mailbox);
-        }
-      }
-    }
-  }
-
-  private void updateBitfieldBlocks(int index, int blockIndex, int blockLength) {
-    for (int i = blockIndex; i < (blockIndex + blockLength); i++) {
-      bitfieldBlocks[index][i] = '1';
-    }
-  }
-
-  // Returns if a piece is complete in the peer's bitfield.
-  private boolean pieceComplete(int index) {
-    for (int i = 0; i < bitfieldBlocks[index].length; i++) {
-      if (bitfieldBlocks[index][i] == '0') {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  // Returns the first block of a piece that we don't have.
-  private int getFirstBlock(int piece) {
-    int blockIndex = -1;
-    for (int i = 0; i < Common.PIECES_BLOCKS; i++) {
-      if (bitfieldBlocks[piece][i] == '0') {
-        blockIndex = i;
-        break;
-      }
-    }
-    return blockIndex;
-  }
-
-  /**
-   * @brief Send request messages to a peer that have unchoked us
-   * @param remotePeer peer data to the peer we want to send the request
-   */
-  private void sendRequestsToPeer(Connection remotePeer) {
-    if (remotePeer.bitfield == null) {
-      return;
-    }
-    for (Integer piece : currentPieces) {
-      //Getting the block to send.
-      int blockIndex = getFirstBlock(piece);
-      int blockLength = Common.PIECES_BLOCKS - blockIndex ;
-      blockLength = blockLength > Common.BLOCKS_REQUESTED ? Common.BLOCKS_REQUESTED : blockLength;
-      if (remotePeer.bitfield[piece] == '1') {
-        sendRequest(remotePeer.mailbox, piece, blockIndex, blockLength);
-      }
-    }
-  }
-
-  // Find the peers that have the current interested piece and send them the "interested" message
-  private void sendInterestedToPeers() {
-    if (currentPiece == -1) {
-      return;
-    }
-    for (Connection connection : peers.values()) {
-      if (connection.bitfield != null && connection.bitfield[currentPiece] == '1' && !connection.amInterested) {
-        connection.amInterested = true;
-        MessageTask task = new MessageTask(MessageTask.Type.INTERESTED, hostname, this.mailbox, this.id);
-        task.dsend(connection.mailbox);
-      }
-    }
-    currentPiece = -1;
-    piecesRequested++;
-  }
-
-  // Send a "interested" message to a peer.
-  private void sendInterested(String mailbox) {
-    MessageTask task = new MessageTask(MessageTask.Type.INTERESTED, hostname, this.mailbox, this.id);
-    task.dsend(mailbox);
-  }
-
-  /**
-   * @brief Send a "not interested" message to a peer
-   * @param mailbox mailbox destination mailbox
-   */
-  private void sendNotInterested(String mailbox) {
-    MessageTask task = new MessageTask(MessageTask.Type.NOTINTERESTED, hostname, this.mailbox, this.id);
-    task.dsend(mailbox);
-  }
-
-  // Send a handshake message to all the peers the peer has.
-  private void sendHandshakeAll() {
-    for (Connection remotePeer : peers.values()) {
-      MessageTask task = new MessageTask(MessageTask.Type.HANDSHAKE, hostname, mailbox, id);
-      task.dsend(remotePeer.mailbox);
-    }
-  }
-
-  /**
-   * @brief Send a "handshake" message to an user
-   * @param mailbox mailbox where to we send the message
-   */
-  private void sendHandshake(String mailbox) {
-    Msg.debug("Sending a HANDSHAKE to " + mailbox);
-    MessageTask task = new MessageTask(MessageTask.Type.HANDSHAKE, hostname, this.mailbox, this.id);
-    task.dsend(mailbox);
-  }
-
-  // Send a "choked" message to a peer
-  private void sendChoked(String mailbox) {
-    Msg.debug("Sending a CHOKE to " + mailbox);
-    MessageTask task = new MessageTask(MessageTask.Type.CHOKE, hostname, this.mailbox, this.id);
-    task.dsend(mailbox);
-  }
-
-  // Send a "unchoked" message to a peer
-  private void sendUnchoked(String mailbox) {
-    Msg.debug("Sending a UNCHOKE to " + mailbox);
-    MessageTask task = new MessageTask(MessageTask.Type.UNCHOKE, hostname, this.mailbox, this.id);
-    task.dsend(mailbox);
-  }
-
-  // Send a "HAVE" message to all peers we are connected to
-  private void sendHave(int piece) {
-    Msg.debug("Sending HAVE message to all my peers");
-    for (Connection remotePeer : peers.values()) {
-      MessageTask task = new MessageTask(MessageTask.Type.HAVE, hostname, this.mailbox, this.id, piece);
-      task.dsend(remotePeer.mailbox);
-    }
-  }
-  // Send a bitfield message to all the peers the peer has.
-  private void sendBitfield(String mailbox) {
-    Msg.debug("Sending a BITFIELD to " + mailbox);
-    MessageTask task = new MessageTask(MessageTask.Type.BITFIELD, hostname, this.mailbox, this.id, this.bitfield);
-    task.dsend(mailbox);
-  }
-  // Send a "request" message to a peer, containing a request for a piece
-  private void sendRequest(String mailbox, int piece, int blockIndex, int blockLength) {
-    Msg.debug("Sending a REQUEST to " + mailbox + " for piece " + piece + " and blocks " + blockIndex + ","
-              + (blockIndex + blockLength));
-    MessageTask task = new MessageTask(MessageTask.Type.REQUEST, hostname, this.mailbox, this.id, piece, blockIndex,
-                                       blockLength);
-    task.dsend(mailbox);
-  }
-
-  // Send a "piece" message to a peer, containing a piece of the file
-  private void sendPiece(String mailbox, int piece, boolean stalled, int blockIndex, int blockLength) {
-    Msg.debug("Sending the PIECE " + piece + " to " + mailbox);
-    MessageTask task = new MessageTask(MessageTask.Type.PIECE, hostname, this.mailbox, this.id, piece, stalled,
-                                       blockIndex, blockLength);
-    task.dsend(mailbox);
-  }
-
-  private String getStatus() {
-    StringBuilder s = new StringBuilder("");
-    for (int i = 0; i < Common.FILE_PIECES; i++)
-      s.append(bitfield[i]);
-    return s.toString();
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/Tracker.java b/examples/deprecated/java/app/bittorrent/Tracker.java
deleted file mode 100644 (file)
index f6d0fb5..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-import java.util.ArrayList;
-import java.util.Random;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Comm;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Tracker extends Process {
-  Random rand = new Random();
-  protected ArrayList<Integer> peersList;
-  protected double deadline;
-  protected Comm commReceived = null;
-
-  public Tracker(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  @Override
-  public void main(String[] args) throws MsgException {
-    if (args.length != 1) {
-      Msg.info("Wrong number of arguments for the tracker.");
-      return;
-    }
-    //Retrieve the end time
-    deadline = Double.parseDouble(args[0]);
-    //Building peers array
-    peersList = new ArrayList<>();
-
-    Msg.info("Tracker launched.");
-    while (Msg.getClock() < deadline) {
-      if (commReceived == null) {
-        commReceived = Task.irecv(Common.TRACKER_MAILBOX);
-      }
-      try {
-        if (commReceived.test()) {
-          Task task = commReceived.getTask();
-          if (task instanceof TrackerTask) {
-            TrackerTask tTask = (TrackerTask)task;
-            //Sending peers to the peer
-            int nbPeers = 0;
-            while (nbPeers < Common.MAXIMUM_PEERS && nbPeers < peersList.size()) {
-              int nextPeer;
-              do {
-                nextPeer = rand.nextInt(peersList.size());
-              } while (tTask.peers.contains(peersList.get(nextPeer)));
-              tTask.peers.add(peersList.get(nextPeer));
-              nbPeers++;
-            }
-            //Adding the peer to our list
-            peersList.add(tTask.peerId);
-            tTask.type = TrackerTask.Type.ANSWER;
-            //Setting the interval
-            tTask.interval = Common.TRACKER_QUERY_INTERVAL;
-            //Sending the task back to the peer
-            tTask.dsend(tTask.mailbox);
-          }
-          commReceived = null;
-        } else {
-          waitFor(1);
-        }
-      }
-      catch (MsgException e) {
-        commReceived = null;
-      }
-    }
-    Msg.info("Tracker is leaving");
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/TrackerTask.java b/examples/deprecated/java/app/bittorrent/TrackerTask.java
deleted file mode 100644 (file)
index 20ce04b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.bittorrent;
-import java.util.ArrayList;
-
-import org.simgrid.msg.Task;
-
-/* Task exchanged between the tracker and the peers. */
-public class TrackerTask extends Task {
-  public enum Type {
-    REQUEST,
-    ANSWER
-  }
-
-  protected Type type;
-  protected String hostname;
-  protected String mailbox;
-  protected int peerId;
-  protected int uploaded;
-  protected int downloaded;
-  protected int left;
-  protected double interval;
-  protected ArrayList<Integer> peers;
-
-  public TrackerTask(String hostname, String mailbox, int peerId) {
-    this(hostname, mailbox, peerId, 0, 0, Common.FILE_SIZE);
-  }
-
-  public TrackerTask(String hostname, String mailbox, int peerId, int uploaded, int downloaded, int left) {
-    super("", 0, Common.TRACKER_COMM_SIZE);
-    this.type = Type.REQUEST;
-    this.hostname = hostname;
-    this.mailbox = mailbox;
-    this.peerId = peerId;
-    this.uploaded = uploaded;
-    this.downloaded = downloaded;
-    this.left = left;
-    this.peers = new ArrayList<>();
-  }
-}
diff --git a/examples/deprecated/java/app/bittorrent/app-bittorrent.tesh b/examples/deprecated/java/app/bittorrent/app-bittorrent.tesh
deleted file mode 100644 (file)
index ce00fa8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-! timeout 15
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/bittorrent/Main ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/app/bittorrent/bittorrent.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [5000.039030] [java/INFO] Terminating the simulation...
-> [node-0.simgrid.org:app.bittorrent.Tracker:(1) 0.000000] [java/INFO] Tracker launched.
-> [node-0.simgrid.org:app.bittorrent.Tracker:(1) 3000.000000] [java/INFO] Tracker is leaving
-> [node-1.simgrid.org:app.bittorrent.Peer:(2) 0.000000] [java/INFO] Hi, I'm joining the network with id 2
-> [node-1.simgrid.org:app.bittorrent.Peer:(2) 5000.007806] [java/INFO] Here is my current status: 1111111111
-> [node-2.simgrid.org:app.bittorrent.Peer:(3) 0.000000] [java/INFO] Hi, I'm joining the network with id 3
-> [node-2.simgrid.org:app.bittorrent.Peer:(3) 5000.031224] [java/INFO] Here is my current status: 1111111111
-> [node-3.simgrid.org:app.bittorrent.Peer:(4) 0.000000] [java/INFO] Hi, I'm joining the network with id 4
-> [node-3.simgrid.org:app.bittorrent.Peer:(4) 5000.039030] [java/INFO] Here is my current status: 1111111111
-> [node-4.simgrid.org:app.bittorrent.Peer:(5) 0.000000] [java/INFO] Hi, I'm joining the network with id 5
-> [node-4.simgrid.org:app.bittorrent.Peer:(5) 5000.007806] [java/INFO] Here is my current status: 1111111111
-> [node-5.simgrid.org:app.bittorrent.Peer:(6) 0.000000] [java/INFO] Hi, I'm joining the network with id 6
-> [node-5.simgrid.org:app.bittorrent.Peer:(6) 5000.023418] [java/INFO] Here is my current status: 1111111111
-> [node-6.simgrid.org:app.bittorrent.Peer:(7) 0.000000] [java/INFO] Hi, I'm joining the network with id 7
-> [node-6.simgrid.org:app.bittorrent.Peer:(7) 5000.039030] [java/INFO] Here is my current status: 1111111111
-> [node-7.simgrid.org:app.bittorrent.Peer:(8) 0.000000] [java/INFO] Hi, I'm joining the network with id 8
-> [node-7.simgrid.org:app.bittorrent.Peer:(8) 5000.031224] [java/INFO] Here is my current status: 1111111111
diff --git a/examples/deprecated/java/app/bittorrent/bittorrent.xml b/examples/deprecated/java/app/bittorrent/bittorrent.xml
deleted file mode 100644 (file)
index a510cf0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-
-  <actor host="node-0.simgrid.org" function="app.bittorrent.Tracker">
-    <argument value="3000" />
-  </actor>
-
-  <actor host="node-1.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000002"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-    <argument value="1" />       <!-- indicates if the app.bittorrent.Peer is a seed at the beginning of the simulation -->
-  </actor>
-  <actor host="node-2.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000003"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-  </actor>
-  <actor host="node-3.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000004"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-  </actor>
-  <actor host="node-4.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000005"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-    <argument value="1" />       <!-- indicates if the app.bittorrent.Peer is a seed at the beginning of the simulation -->
-  </actor>
-  <actor host="node-5.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000006"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-  </actor>
-  <actor host="node-6.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000007"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-  </actor>
-  <actor host="node-7.simgrid.org" function="app.bittorrent.Peer">
-    <argument value="00000008"/>    <!-- my id -->
-    <argument value="5000" />    <!-- end time -->
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/app/bittorrent/generate.py b/examples/deprecated/java/app/bittorrent/generate.py
deleted file mode 100755 (executable)
index 6d5e71b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2013-2023. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-"""
-This script generates a specific deployment file for the Bittorrent example.
-It assumes that the platform will be a cluster.
-Usage: python generate.py nb_nodes nb_bits end_date percentage
-Example: python generate.py 10000 5000
-"""
-
-import sys
-import random
-
-if len(sys.argv) != 4:
-    print(
-        "Usage: python generate.py nb_nodes end_date seed_percentage > deployment_file.xml")
-    sys.exit(1)
-
-nb_nodes = int(sys.argv[1])
-end_date = int(sys.argv[2])
-seed_percentage = int(sys.argv[3])
-
-nb_bits = 24
-max_id = 2 ** nb_bits - 1
-all_ids = [42]
-
-sys.stdout.write("<?xml version='1.0'?>\n"
-                 "<!DOCTYPE platform SYSTEM \"https://simgrid.org/simgrid.dtd\">\n"
-                 "<platform version=\"3\">\n"
-                 "  <process host=\"c-0.me\" function=\"bittorrent.Tracker\"><argument value=\"%d\"/></process>\n" %
-                 end_date)
-
-for i in range(1, nb_nodes):
-
-    ok = False
-    while not ok:
-        my_id = random.randint(0, max_id)
-        ok = my_id not in all_ids
-    start_date = i * 10
-    line = "  <process host=\"c-%d.me\" function=\"bittorrent.Peer\"><argument value=\"%d\" />" \
-           "<argument value=\"%d\" />" % (i, my_id, end_date)
-    if random.randint(0, 100) < seed_percentage:
-        line += "<argument value=\"1\" />"
-    line += "</process>\n"
-    sys.stdout.write(line)
-    all_ids.append(my_id)
-sys.stdout.write("</platform>")
diff --git a/examples/deprecated/java/app/centralizedmutex/Coordinator.java b/examples/deprecated/java/app/centralizedmutex/Coordinator.java
deleted file mode 100644 (file)
index 4d47da2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.centralizedmutex;
-import java.util.LinkedList;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Coordinator extends Process {
-  public Coordinator(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  public void main(String[] args) throws MsgException {
-    int csToServe = Integer.parseInt(args[0]);
-    LinkedList<RequestTask> waitingQueue=new LinkedList<>();
-
-    while (csToServe >0) {
-      Task task = Task.receive("coordinator");
-      if (task instanceof RequestTask) {
-        RequestTask t = (RequestTask) task;
-        if (waitingQueue.isEmpty()) {
-          Msg.info("Got a request from "+t.from+". Queue empty: grant it");
-          GrantTask tosend =  new GrantTask();
-          tosend.send(t.from);
-        } else {
-          waitingQueue.addFirst(t);
-        }
-      } else if (task instanceof ReleaseTask) {
-        if (!waitingQueue.isEmpty()) {
-          RequestTask req = waitingQueue.removeLast();
-          GrantTask tosend = new GrantTask();
-          tosend.send(req.from);
-        }
-        csToServe--;
-        if (waitingQueue.isEmpty() && csToServe==0) {
-          Msg.info("we should shutdown the simulation now");
-        }
-      }
-    }
-  }
-}
diff --git a/examples/deprecated/java/app/centralizedmutex/GrantTask.java b/examples/deprecated/java/app/centralizedmutex/GrantTask.java
deleted file mode 100644 (file)
index b5bf482..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.centralizedmutex;
-public class GrantTask extends org.simgrid.msg.Task {}
diff --git a/examples/deprecated/java/app/centralizedmutex/Main.java b/examples/deprecated/java/app/centralizedmutex/Main.java
deleted file mode 100644 (file)
index 9296d83..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.centralizedmutex;
-
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-
-    String platf  = args.length > 1 ? args[0] : "../platforms/small_platform.xml";
-    String deploy =  args.length > 1 ? args[1] : "./centralizedmutex.xml";
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(platf);
-    Msg.deployApplication(deploy);
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/app/centralizedmutex/Node.java b/examples/deprecated/java/app/centralizedmutex/Node.java
deleted file mode 100644 (file)
index 820123b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.centralizedmutex;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Node extends Process {
-  public Node(Host host, String name, String[]args) {
-   super(host,name,args);
-  }
-  public void request(double csTime) throws MsgException {
-    RequestTask req = new RequestTask(getName());
-    Msg.info("Send a request to the coordinator");
-    req.send("coordinator");
-    Msg.info("Wait for a grant from the coordinator");
-    Task.receive(getName());
-    Task compute = new Task("CS", csTime, 0);
-    compute.execute();
-    ReleaseTask release = new ReleaseTask();
-    release.send("coordinator");
-  }
-
-  public void main(String[] args) throws MsgException {
-    request(Double.parseDouble(args[1]));
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/app/centralizedmutex/ReleaseTask.java b/examples/deprecated/java/app/centralizedmutex/ReleaseTask.java
deleted file mode 100644 (file)
index 79b42ec..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.centralizedmutex;
-public class ReleaseTask extends org.simgrid.msg.Task {}
diff --git a/examples/deprecated/java/app/centralizedmutex/RequestTask.java b/examples/deprecated/java/app/centralizedmutex/RequestTask.java
deleted file mode 100644 (file)
index 85cf4f2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.centralizedmutex;
-import org.simgrid.msg.Task;
-
-public class RequestTask extends Task {
-  protected String from;
-  public RequestTask(String name) {
-    super();
-    from=name;
-  }
-}
diff --git a/examples/deprecated/java/app/centralizedmutex/app-centralizedmutex.tesh b/examples/deprecated/java/app/centralizedmutex/app-centralizedmutex.tesh
deleted file mode 100644 (file)
index 74d30a1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/centralizedmutex/Main ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/app/centralizedmutex/centralizedmutex.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [Jupiter:app.centralizedmutex.Node:(2) 0.000000] [java/INFO] Send a request to the coordinator
-> [Fafard:app.centralizedmutex.Node:(3) 0.000000] [java/INFO] Send a request to the coordinator
-> [Tremblay:app.centralizedmutex.Coordinator:(1) 0.019014] [java/INFO] Got a request from app.centralizedmutex.Node. Queue empty: grant it
-> [Jupiter:app.centralizedmutex.Node:(2) 0.019014] [java/INFO] Wait for a grant from the coordinator
-> [Fafard:app.centralizedmutex.Node:(3) 0.063737] [java/INFO] Wait for a grant from the coordinator
-> [Tremblay:app.centralizedmutex.Coordinator:(1) 0.063737] [java/INFO] Got a request from app.centralizedmutex.Node. Queue empty: grant it
-> [Tremblay:app.centralizedmutex.Coordinator:(1) 0.134167] [java/INFO] we should shutdown the simulation now
-> [0.134167] [java/INFO] Terminating the simulation...
diff --git a/examples/deprecated/java/app/centralizedmutex/centralizedmutex.xml b/examples/deprecated/java/app/centralizedmutex/centralizedmutex.xml
deleted file mode 100644 (file)
index cffdc2e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <actor host="Tremblay" function="app.centralizedmutex.Coordinator">
-    <argument value="2"/> <!-- Amount of CS to serve -->
-  </actor>
-  <actor host="Jupiter" function="app.centralizedmutex.Node">
-    <argument value="2"/> <!-- initial sleep time -->
-    <argument value="5"/> <!-- CS time -->
-  </actor>
-  <actor host="Fafard" function="app.centralizedmutex.Node">
-    <argument value="2"/> <!-- initial sleep time -->
-    <argument value="5"/> <!-- CS time -->
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/app/masterworker/Main.java b/examples/deprecated/java/app/masterworker/Main.java
deleted file mode 100644 (file)
index de6eb0c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.masterworker;
-
-import java.io.File;
-
-import org.simgrid.msg.Msg;
-
-class Main {
-  public static final int TASK_COMP_SIZE = 10000000;
-  public static final int TASK_COMM_SIZE = 10000000;
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    /* initialize the MSG simulation. Must be done before anything else (even logging). */
-    Msg.init(args);
-
-    String platf  = args.length > 1 ? args[0] : "../platforms/small_platform.xml";
-    String deploy =  args.length > 1 ? args[1] : "app/masterworker/masterworker.xml";
-
-    Msg.verb("Platform: "+platf+"; Deployment:"+deploy+"; Current directory: "+new File(".").getAbsolutePath());
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(platf);
-    Msg.deployApplication(deploy);
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/app/masterworker/Master.java b/examples/deprecated/java/app/masterworker/Master.java
deleted file mode 100644 (file)
index b95cd0c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Master of a basic master/worker example in Java */
-
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.masterworker;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-
-public class Master extends Process {
-  public Master(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-  public void main(String[] args) throws MsgException {
-    if (args.length < 4) {
-      Msg.info("Master needs 4 arguments");
-      System.exit(1);
-    }
-
-    int tasksCount = Integer.parseInt(args[0]);
-    double taskComputeSize = Double.parseDouble(args[1]);
-    double taskCommunicateSize = Double.parseDouble(args[2]);
-
-    int workersCount = Integer.parseInt(args[3]);
-
-    Msg.info("Hello! My PID is "+getPID()+". Got "+  workersCount + " workers and "+tasksCount+" tasks to process");
-
-    for (int i = 0; i < tasksCount; i++) {
-      Task task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize);
-      Msg.debug("Sending \"" + task.getName()+ "\" to \"worker_" + i % workersCount + "\"");
-      task.send("worker_"+(i%workersCount));
-    }
-
-    Msg.info("All tasks have been dispatched. Let's tell everybody the computation is over.");
-
-    for (int i = 0; i < workersCount; i++) {
-      Task task = new Task("finalize", 0, 0);
-      task.send("worker_"+(i%workersCount));
-    }
-
-    Msg.info("Goodbye now!");
-  }
-}
diff --git a/examples/deprecated/java/app/masterworker/README b/examples/deprecated/java/app/masterworker/README
deleted file mode 100644 (file)
index 56d2f29..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a somehow basic master/workers example.
-
-There is 2 kind of processes:
- * Master: creates some tasks, and dispatches them to its workers
- * Worker: get tasks from the master and run them
-
-At the end of the execution:
- - the master sends a Task whose name is "finalize" to every known worker to stop them
- - On reception of such tasks workers stop.
\ No newline at end of file
diff --git a/examples/deprecated/java/app/masterworker/Worker.java b/examples/deprecated/java/app/masterworker/Worker.java
deleted file mode 100644 (file)
index b03b23a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.masterworker;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.TaskCancelledException;
-import org.simgrid.msg.TimeoutException;
-import org.simgrid.msg.TransferFailureException;
-import org.simgrid.msg.Process;
-
-public class Worker extends Process {
-  public Worker(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-  public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
-    if (args.length < 1) {
-      Msg.info("Worker needs 1 argument (its number)");
-      System.exit(1);
-    }
-
-    int num = Integer.parseInt(args[0]);
-    Msg.debug("Receiving on 'worker_"+num+"'");
-
-    while(true) {
-      Task task = Task.receive("worker_"+num);
-
-      if ("finalize".equals(task.getName())) {
-        break;
-      }
-      Msg.info("Received \"" + task.getName() +  "\". Processing it (my pid is "+getPID()+").");
-      try {
-        task.execute();
-      } catch (TaskCancelledException e) {
-        e.printStackTrace();
-      }
-    }
-
-    Msg.info("Received Finalize. I'm done. See you!");
-  }
-}
diff --git a/examples/deprecated/java/app/masterworker/app-masterworker.tesh b/examples/deprecated/java/app/masterworker/app-masterworker.tesh
deleted file mode 100644 (file)
index 9d451db..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/masterworker/Main ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/app/masterworker/masterworker.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:app.masterworker.Master@Jacquelin) Hello! My PID is 1. Got 7 workers and 5 tasks to process
-> [  0.860026] (2:app.masterworker.Worker@Tremblay) Received "Task_0". Processing it (my pid is 2).
-> [  1.752187] (3:app.masterworker.Worker@Fafard) Received "Task_1". Processing it (my pid is 3).
-> [  1.757531] (4:app.masterworker.Worker@Bourassa) Received "Task_2". Processing it (my pid is 4).
-> [  2.806417] (5:app.masterworker.Worker@Boivin) Received "Task_3". Processing it (my pid is 5).
-> [  2.811761] (6:app.masterworker.Worker@Ginette) Received "Task_4". Processing it (my pid is 6).
-> [  2.811761] (1:app.masterworker.Master@Jacquelin) All tasks have been dispatched. Let's tell everybody the computation is over.
-> [  3.671783] (2:app.masterworker.Worker@Tremblay) Received Finalize. I'm done. See you!
-> [  4.563940] (3:app.masterworker.Worker@Fafard) Received Finalize. I'm done. See you!
-> [  4.569280] (4:app.masterworker.Worker@Bourassa) Received Finalize. I'm done. See you!
-> [  5.618161] (5:app.masterworker.Worker@Boivin) Received Finalize. I'm done. See you!
-> [  5.623501] (6:app.masterworker.Worker@Ginette) Received Finalize. I'm done. See you!
-> [  5.628842] (7:app.masterworker.Worker@Jupiter) Received Finalize. I'm done. See you!
-> [  5.628842] (8:app.masterworker.Worker@Jacquelin) Received Finalize. I'm done. See you!
-> [  5.628842] (1:app.masterworker.Master@Jacquelin) Goodbye now!
-> [  5.628842] (0:maestro@) Terminating the simulation...
diff --git a/examples/deprecated/java/app/masterworker/masterworker.xml b/examples/deprecated/java/app/masterworker/masterworker.xml
deleted file mode 100644 (file)
index a059ff1..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <actor host="Jacquelin" function="app.masterworker.Master">
-    <argument value="5"/>     <!-- Amount of tasks to dispatch -->
-    <argument value="50000"/> <!-- Computation size of each task -->
-    <argument value="10"/>    <!-- Communication size of each one -->
-    <argument value="7"/>     <!-- Amount of workers waiting for orders -->
-  </actor>
-
-  <actor host="Tremblay" function="app.masterworker.Worker">
-    <argument value="0"/>  <!-- Input mailbox -->
-  </actor>
-  <actor host="Fafard" function="app.masterworker.Worker">
-    <argument value="1"/>  <!-- Input mailbox -->
-  </actor>
-  <actor host="Bourassa" function="app.masterworker.Worker">
-    <argument value="2"/>  <!-- Input mailbox -->
-  </actor>
-  <actor host="Boivin" function="app.masterworker.Worker">
-    <argument value="3"/>  <!-- Input mailbox -->
-  </actor>
-  <actor host="Ginette" function="app.masterworker.Worker">
-    <argument value="4"/>  <!-- Input mailbox -->
-  </actor>
-  <actor host="Jupiter" function="app.masterworker.Worker">
-    <argument value="5"/>  <!-- Input mailbox -->
-  </actor>
-  <actor host="Jacquelin" function="app.masterworker.Worker">
-    <argument value="6"/>  <!-- Input mailbox -->
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/app/pingpong/Main.java b/examples/deprecated/java/app/pingpong/Main.java
deleted file mode 100644 (file)
index 5855d6d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.pingpong;
-import java.io.File;
-
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-
-class Main {
-  protected static final int TASK_COUNT = 3;
-
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) throws HostNotFoundException {
-    Msg.init(args);
-
-    String platfFile = "../../examples/platforms/small_platform.xml";
-    if (args.length == 1)
-       platfFile = args[0];
-
-    File f = new File(platfFile);
-    if (!f.exists()) {
-      Msg.error("File " + platfFile + " does not exist in " + System.getProperty("user.dir"));
-      Msg.error("Usage  : Main ../platforms/platform.xml");
-    }
-
-    Msg.createEnvironment(platfFile);
-    new Sender("Jacquelin", "Sender", new String[] {"Boivin"}).start();
-    new Receiver ("Boivin", "Receiver", null).start();
-
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/app/pingpong/PingPongTask.java b/examples/deprecated/java/app/pingpong/PingPongTask.java
deleted file mode 100644 (file)
index 8d21f5b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.pingpong;
-import org.simgrid.msg.Task;
-
-public class PingPongTask extends Task {
-  private double timeVal;
-
-  public PingPongTask() {
-    this.timeVal = 0;
-  }
-
-  public PingPongTask(String name, double computeDuration, double messageSize, double timeVal) {
-    super(name,computeDuration,messageSize);
-
-    this.timeVal = timeVal;
-  }
-
-  public double getTime() {
-    return this.timeVal;
-  }
-}
diff --git a/examples/deprecated/java/app/pingpong/Receiver.java b/examples/deprecated/java/app/pingpong/Receiver.java
deleted file mode 100644 (file)
index 34f5ec6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.pingpong;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-
-public class Receiver extends Process {
-       private static final double COMM_SIZE_BW = 100000000;
-       public Receiver(String hostname, String name, String[]args) throws HostNotFoundException {
-               super(hostname, name, args);
-       }
-
-       public void main(String[] args) throws MsgException {
-               for (int i = 0 ; i < Main.TASK_COUNT; i++) {
-                       Msg.info("Wait for a task");
-
-                       PingPongTask task = (PingPongTask)Task.receive(getHost().getName());
-                       double timeGot = Msg.getClock();
-                       double timeSent = task.getTime();
-
-                       Msg.info("Got one that was sent at time "+ timeSent);
-
-                       double communicationTime = timeGot - timeSent;
-                       Msg.info("Communication time : " + communicationTime);
-                       Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----");
-               }
-               Msg.info("Done.");
-       }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/app/pingpong/Sender.java b/examples/deprecated/java/app/pingpong/Sender.java
deleted file mode 100644 (file)
index 2f511f9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.pingpong;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-
-public class Sender extends Process {
-       private static final double COMM_SIZE_LAT = 1;
-
-       public Sender(String hostname, String name, String[] args) throws HostNotFoundException {
-               super(hostname,name,args);
-       }
-
-       public void main(String[] args) throws MsgException {
-               Msg.info("Host count: " + args.length);
-
-               for (int i = 0 ; i<Main.TASK_COUNT; i++) {
-
-                       for(int pos = 0; pos < args.length ; pos++) {
-                               String hostname = Host.getByName(args[pos]).getName(); // Make sure that this host exists
-
-                               double time = Msg.getClock();
-                               Msg.info("sender time: " + time);
-
-                               PingPongTask task = new PingPongTask("no name", /* Duration: 0 flops */ 0, COMM_SIZE_LAT, time);
-                               task.send(hostname);
-                       }
-               }
-               Msg.info("Done.");
-       }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/app/pingpong/app-pingpong.tesh b/examples/deprecated/java/app/pingpong/app-pingpong.tesh
deleted file mode 100644 (file)
index e68b679..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/pingpong/Main ${srcdir:=.}/../../platforms/small_platform.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [Jacquelin:Sender:(1) 0.000000] [java/INFO] Host count: 1
-> [Jacquelin:Sender:(1) 0.000000] [java/INFO] sender time: 0.0
-> [Boivin:Receiver:(2) 0.000000] [java/INFO] Wait for a task
-> [Boivin:Receiver:(2) 1.048882] [java/INFO] Got one that was sent at time 0.0
-> [Boivin:Receiver:(2) 1.048882] [java/INFO] Communication time : 1.0488818628325232
-> [Boivin:Receiver:(2) 1.048882] [java/INFO]  --- bw 9.533962169004269E7 ----
-> [Boivin:Receiver:(2) 1.048882] [java/INFO] Wait for a task
-> [Jacquelin:Sender:(1) 1.048882] [java/INFO] sender time: 1.0488818628325232
-> [Boivin:Receiver:(2) 2.097764] [java/INFO] Got one that was sent at time 1.0488818628325232
-> [Boivin:Receiver:(2) 2.097764] [java/INFO] Communication time : 1.0488818628325232
-> [Boivin:Receiver:(2) 2.097764] [java/INFO]  --- bw 9.533962169004269E7 ----
-> [Boivin:Receiver:(2) 2.097764] [java/INFO] Wait for a task
-> [Jacquelin:Sender:(1) 2.097764] [java/INFO] sender time: 2.0977637256650463
-> [Boivin:Receiver:(2) 3.146646] [java/INFO] Got one that was sent at time 2.0977637256650463
-> [Boivin:Receiver:(2) 3.146646] [java/INFO] Communication time : 1.0488818628325234
-> [Boivin:Receiver:(2) 3.146646] [java/INFO]  --- bw 9.533962169004266E7 ----
-> [Boivin:Receiver:(2) 3.146646] [java/INFO] Done.
-> [Jacquelin:Sender:(1) 3.146646] [java/INFO] Done.
-> [3.146646] [java/INFO] Terminating the simulation...
diff --git a/examples/deprecated/java/app/tokenring/Main.java b/examples/deprecated/java/app/tokenring/Main.java
deleted file mode 100644 (file)
index f960da9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.tokenring;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-
-class Main {
-       private Main() {
-               /* This is just to prevent anyone from creating an instance of this singleton */
-               throw new IllegalAccessError("Utility class");
-       }
-
-       public static void main(String[] args) {
-               Msg.init(args);
-
-               String platform = "../platforms/small_platform.xml";
-               if(args.length >= 1)
-                       platform = args[0];
-               Msg.createEnvironment(platform);
-
-               Host[] hosts = Host.all();
-               for (int rank = 0; rank < hosts.length; rank++) {
-                       Process proc = new RelayRunner(hosts[rank], Integer.toString(rank),  null);
-                       proc.start();
-               }
-               Msg.info("Number of hosts '"+hosts.length+"'");
-               Msg.run();
-
-               Msg.info("Simulation time " + Msg.getClock());
-       }
-}
diff --git a/examples/deprecated/java/app/tokenring/RelayRunner.java b/examples/deprecated/java/app/tokenring/RelayRunner.java
deleted file mode 100644 (file)
index dc3a03d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package app.tokenring;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-
-public class RelayRunner extends Process {
-
-       private static final int TASK_COMM_SIZE = 1000000; /* The token is 1MB long*/
-
-       public RelayRunner(Host host, String name, String[]args) {
-               super(host,name,args);
-       }
-
-       /* This is the function executed by this kind of processes */
-       @Override
-       public void main(String[] args) throws MsgException {
-               // In this example, the processes are given numerical names: "0", "1", "2", and so on
-               int rank = Integer.parseInt(this.getName());
-
-               if (rank == 0) {
-                       /* The root (rank 0) first sends the token then waits to receive it back */
-
-                       String mailbox = "1";
-                       Task token = new Task("Token", 0/* no computation associated*/ , TASK_COMM_SIZE );
-
-                       Msg.info("Host '"+rank+"' send '"+token.getName()+"' to Host '"+mailbox+"'");
-                       token.send(mailbox);
-
-                       token = Task.receive(this.getName()); // Get a message from the mailbox having the same name as the current processor
-
-                       Msg.info("Host '"+rank+"' received '"+token.getName()+"'");
-
-               } else {
-                   /* The others processes receive on their name (coming from their left neighbor -- rank-1)
-                    * and send to their right neighbor (rank+1) */
-                       Task token = Task.receive(this.getName());
-
-                   Msg.info("Host '"+rank+"' received '"+token.getName()+"'");
-
-                   String mailbox = Integer.toString(rank+1);
-                   if (rank+1 == Host.getCount()) {
-                       /* The last process has no right neighbor, so it sends the token back to rank 0 */
-                       mailbox = "0";
-                   }
-
-                   Msg.info("Host '"+rank+"' send '"+token.getName()+"' to Host '"+mailbox+"'");
-                   token.send(mailbox);
-               }
-       }
-}
diff --git a/examples/deprecated/java/app/tokenring/app-tokenring.tesh b/examples/deprecated/java/app/tokenring/app-tokenring.tesh
deleted file mode 100644 (file)
index 3972847..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/tokenring/Main ${srcdir:=.}/../../platforms/routing_cluster.xml '--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n'
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (0:maestro@) Number of hosts '6'
-> [  0.000000] (1:0@host1) Host '0' send 'Token' to Host '1'
-> [  0.017354] (2:1@host2) Host '1' received 'Token'
-> [  0.017354] (2:1@host2) Host '1' send 'Token' to Host '2'
-> [  0.035121] (3:2@host3) Host '2' received 'Token'
-> [  0.035121] (3:2@host3) Host '2' send 'Token' to Host '3'
-> [  0.065898] (4:3@host4) Host '3' received 'Token'
-> [  0.065898] (4:3@host4) Host '3' send 'Token' to Host '4'
-> [  0.083252] (5:4@host5) Host '4' received 'Token'
-> [  0.083252] (5:4@host5) Host '4' send 'Token' to Host '5'
-> [  0.101019] (6:5@host6) Host '5' received 'Token'
-> [  0.101019] (6:5@host6) Host '5' send 'Token' to Host '0'
-> [  0.131796] (1:0@host1) Host '0' received 'Token'
-> [  0.131796] (0:maestro@) Terminating the simulation...
-> [  0.131796] (0:maestro@) Simulation time 0.13179602061855672
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/tokenring/Main ${srcdir:=.}/../../platforms/two_peers.xml '--log=root.fmt:[%12.6r]%e(%i:%a@%h)%e%m%n'
-> [    0.000000] (0:maestro@) Using regular java threads.
-> [    0.000000] (0:maestro@) Number of hosts '2'
-> [    0.000000] (1:0@100030591) Host '0' send 'Token' to Host '1'
-> [    0.625106] (2:1@100036570) Host '1' received 'Token'
-> [    0.625106] (2:1@100036570) Host '1' send 'Token' to Host '0'
-> [    1.250212] (1:0@100030591) Host '0' received 'Token'
-> [    1.250212] (0:maestro@) Terminating the simulation...
-> [    1.250212] (0:maestro@) Simulation time 1.250212042288475
-
-$ ${javacmd:=java} -classpath ${classpath:=.} app/tokenring/Main ${srcdir:=.}/../../platforms/meta_cluster.xml '--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n'
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (0:maestro@) Number of hosts '60'
-> [  0.000000] (1:0@host-1.cluster1) Host '0' send 'Token' to Host '1'
-> [  0.030364] (2:1@host-1.cluster2) Host '1' received 'Token'
-> [  0.030364] (2:1@host-1.cluster2) Host '1' send 'Token' to Host '2'
-> [  0.060729] (3:2@host-10.cluster1) Host '2' received 'Token'
-> [  0.060729] (3:2@host-10.cluster1) Host '2' send 'Token' to Host '3'
-> [  0.091093] (4:3@host-10.cluster2) Host '3' received 'Token'
-> [  0.091093] (4:3@host-10.cluster2) Host '3' send 'Token' to Host '4'
-> [  0.121458] (5:4@host-11.cluster1) Host '4' received 'Token'
-> [  0.121458] (5:4@host-11.cluster1) Host '4' send 'Token' to Host '5'
-> [  0.151822] (6:5@host-11.cluster2) Host '5' received 'Token'
-> [  0.151822] (6:5@host-11.cluster2) Host '5' send 'Token' to Host '6'
-> [  0.182187] (7:6@host-12.cluster1) Host '6' received 'Token'
-> [  0.182187] (7:6@host-12.cluster1) Host '6' send 'Token' to Host '7'
-> [  0.212551] (8:7@host-12.cluster2) Host '7' received 'Token'
-> [  0.212551] (8:7@host-12.cluster2) Host '7' send 'Token' to Host '8'
-> [  0.242915] (9:8@host-13.cluster1) Host '8' received 'Token'
-> [  0.242915] (9:8@host-13.cluster1) Host '8' send 'Token' to Host '9'
-> [  0.273280] (10:9@host-13.cluster2) Host '9' received 'Token'
-> [  0.273280] (10:9@host-13.cluster2) Host '9' send 'Token' to Host '10'
-> [  0.303644] (11:10@host-14.cluster1) Host '10' received 'Token'
-> [  0.303644] (11:10@host-14.cluster1) Host '10' send 'Token' to Host '11'
-> [  0.334009] (12:11@host-14.cluster2) Host '11' received 'Token'
-> [  0.334009] (12:11@host-14.cluster2) Host '11' send 'Token' to Host '12'
-> [  0.364373] (13:12@host-15.cluster1) Host '12' received 'Token'
-> [  0.364373] (13:12@host-15.cluster1) Host '12' send 'Token' to Host '13'
-> [  0.394737] (14:13@host-15.cluster2) Host '13' received 'Token'
-> [  0.394737] (14:13@host-15.cluster2) Host '13' send 'Token' to Host '14'
-> [  0.425102] (15:14@host-16.cluster1) Host '14' received 'Token'
-> [  0.425102] (15:14@host-16.cluster1) Host '14' send 'Token' to Host '15'
-> [  0.455466] (16:15@host-16.cluster2) Host '15' received 'Token'
-> [  0.455466] (16:15@host-16.cluster2) Host '15' send 'Token' to Host '16'
-> [  0.485831] (17:16@host-17.cluster1) Host '16' received 'Token'
-> [  0.485831] (17:16@host-17.cluster1) Host '16' send 'Token' to Host '17'
-> [  0.516195] (18:17@host-17.cluster2) Host '17' received 'Token'
-> [  0.516195] (18:17@host-17.cluster2) Host '17' send 'Token' to Host '18'
-> [  0.546560] (19:18@host-18.cluster1) Host '18' received 'Token'
-> [  0.546560] (19:18@host-18.cluster1) Host '18' send 'Token' to Host '19'
-> [  0.576924] (20:19@host-18.cluster2) Host '19' received 'Token'
-> [  0.576924] (20:19@host-18.cluster2) Host '19' send 'Token' to Host '20'
-> [  0.607288] (21:20@host-19.cluster1) Host '20' received 'Token'
-> [  0.607288] (21:20@host-19.cluster1) Host '20' send 'Token' to Host '21'
-> [  0.637653] (22:21@host-19.cluster2) Host '21' received 'Token'
-> [  0.637653] (22:21@host-19.cluster2) Host '21' send 'Token' to Host '22'
-> [  0.668017] (23:22@host-2.cluster1) Host '22' received 'Token'
-> [  0.668017] (23:22@host-2.cluster1) Host '22' send 'Token' to Host '23'
-> [  0.698382] (24:23@host-2.cluster2) Host '23' received 'Token'
-> [  0.698382] (24:23@host-2.cluster2) Host '23' send 'Token' to Host '24'
-> [  0.728746] (25:24@host-20.cluster1) Host '24' received 'Token'
-> [  0.728746] (25:24@host-20.cluster1) Host '24' send 'Token' to Host '25'
-> [  0.759111] (26:25@host-20.cluster2) Host '25' received 'Token'
-> [  0.759111] (26:25@host-20.cluster2) Host '25' send 'Token' to Host '26'
-> [  0.789475] (27:26@host-21.cluster1) Host '26' received 'Token'
-> [  0.789475] (27:26@host-21.cluster1) Host '26' send 'Token' to Host '27'
-> [  0.819839] (28:27@host-21.cluster2) Host '27' received 'Token'
-> [  0.819839] (28:27@host-21.cluster2) Host '27' send 'Token' to Host '28'
-> [  0.850204] (29:28@host-22.cluster1) Host '28' received 'Token'
-> [  0.850204] (29:28@host-22.cluster1) Host '28' send 'Token' to Host '29'
-> [  0.880568] (30:29@host-22.cluster2) Host '29' received 'Token'
-> [  0.880568] (30:29@host-22.cluster2) Host '29' send 'Token' to Host '30'
-> [  0.910933] (31:30@host-23.cluster1) Host '30' received 'Token'
-> [  0.910933] (31:30@host-23.cluster1) Host '30' send 'Token' to Host '31'
-> [  0.941297] (32:31@host-23.cluster2) Host '31' received 'Token'
-> [  0.941297] (32:31@host-23.cluster2) Host '31' send 'Token' to Host '32'
-> [  0.971662] (33:32@host-24.cluster1) Host '32' received 'Token'
-> [  0.971662] (33:32@host-24.cluster1) Host '32' send 'Token' to Host '33'
-> [  1.002026] (34:33@host-24.cluster2) Host '33' received 'Token'
-> [  1.002026] (34:33@host-24.cluster2) Host '33' send 'Token' to Host '34'
-> [  1.032390] (35:34@host-25.cluster1) Host '34' received 'Token'
-> [  1.032390] (35:34@host-25.cluster1) Host '34' send 'Token' to Host '35'
-> [  1.062755] (36:35@host-25.cluster2) Host '35' received 'Token'
-> [  1.062755] (36:35@host-25.cluster2) Host '35' send 'Token' to Host '36'
-> [  1.093119] (37:36@host-26.cluster1) Host '36' received 'Token'
-> [  1.093119] (37:36@host-26.cluster1) Host '36' send 'Token' to Host '37'
-> [  1.123484] (38:37@host-26.cluster2) Host '37' received 'Token'
-> [  1.123484] (38:37@host-26.cluster2) Host '37' send 'Token' to Host '38'
-> [  1.153848] (39:38@host-27.cluster1) Host '38' received 'Token'
-> [  1.153848] (39:38@host-27.cluster1) Host '38' send 'Token' to Host '39'
-> [  1.184212] (40:39@host-27.cluster2) Host '39' received 'Token'
-> [  1.184212] (40:39@host-27.cluster2) Host '39' send 'Token' to Host '40'
-> [  1.214577] (41:40@host-28.cluster1) Host '40' received 'Token'
-> [  1.214577] (41:40@host-28.cluster1) Host '40' send 'Token' to Host '41'
-> [  1.244941] (42:41@host-28.cluster2) Host '41' received 'Token'
-> [  1.244941] (42:41@host-28.cluster2) Host '41' send 'Token' to Host '42'
-> [  1.275306] (43:42@host-29.cluster1) Host '42' received 'Token'
-> [  1.275306] (43:42@host-29.cluster1) Host '42' send 'Token' to Host '43'
-> [  1.305670] (44:43@host-29.cluster2) Host '43' received 'Token'
-> [  1.305670] (44:43@host-29.cluster2) Host '43' send 'Token' to Host '44'
-> [  1.336035] (45:44@host-3.cluster1) Host '44' received 'Token'
-> [  1.336035] (45:44@host-3.cluster1) Host '44' send 'Token' to Host '45'
-> [  1.366399] (46:45@host-3.cluster2) Host '45' received 'Token'
-> [  1.366399] (46:45@host-3.cluster2) Host '45' send 'Token' to Host '46'
-> [  1.396763] (47:46@host-30.cluster1) Host '46' received 'Token'
-> [  1.396763] (47:46@host-30.cluster1) Host '46' send 'Token' to Host '47'
-> [  1.427128] (48:47@host-30.cluster2) Host '47' received 'Token'
-> [  1.427128] (48:47@host-30.cluster2) Host '47' send 'Token' to Host '48'
-> [  1.457492] (49:48@host-4.cluster1) Host '48' received 'Token'
-> [  1.457492] (49:48@host-4.cluster1) Host '48' send 'Token' to Host '49'
-> [  1.487857] (50:49@host-4.cluster2) Host '49' received 'Token'
-> [  1.487857] (50:49@host-4.cluster2) Host '49' send 'Token' to Host '50'
-> [  1.518221] (51:50@host-5.cluster1) Host '50' received 'Token'
-> [  1.518221] (51:50@host-5.cluster1) Host '50' send 'Token' to Host '51'
-> [  1.548586] (52:51@host-5.cluster2) Host '51' received 'Token'
-> [  1.548586] (52:51@host-5.cluster2) Host '51' send 'Token' to Host '52'
-> [  1.578950] (53:52@host-6.cluster1) Host '52' received 'Token'
-> [  1.578950] (53:52@host-6.cluster1) Host '52' send 'Token' to Host '53'
-> [  1.609314] (54:53@host-6.cluster2) Host '53' received 'Token'
-> [  1.609314] (54:53@host-6.cluster2) Host '53' send 'Token' to Host '54'
-> [  1.639679] (55:54@host-7.cluster1) Host '54' received 'Token'
-> [  1.639679] (55:54@host-7.cluster1) Host '54' send 'Token' to Host '55'
-> [  1.670043] (56:55@host-7.cluster2) Host '55' received 'Token'
-> [  1.670043] (56:55@host-7.cluster2) Host '55' send 'Token' to Host '56'
-> [  1.700408] (57:56@host-8.cluster1) Host '56' received 'Token'
-> [  1.700408] (57:56@host-8.cluster1) Host '56' send 'Token' to Host '57'
-> [  1.730772] (58:57@host-8.cluster2) Host '57' received 'Token'
-> [  1.730772] (58:57@host-8.cluster2) Host '57' send 'Token' to Host '58'
-> [  1.761137] (59:58@host-9.cluster1) Host '58' received 'Token'
-> [  1.761137] (59:58@host-9.cluster1) Host '58' send 'Token' to Host '59'
-> [  1.791501] (60:59@host-9.cluster2) Host '59' received 'Token'
-> [  1.791501] (60:59@host-9.cluster2) Host '59' send 'Token' to Host '0'
-> [  1.821865] (1:0@host-1.cluster1) Host '0' received 'Token'
-> [  1.821865] (0:maestro@) Terminating the simulation...
-> [  1.821865] (0:maestro@) Simulation time 1.8218653608247406
diff --git a/examples/deprecated/java/async/dsend/Main.java b/examples/deprecated/java/async/dsend/Main.java
deleted file mode 100644 (file)
index 3b2c02f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.dsend;
-
-/** This example demonstrates the use of the Task.dsend() method.
- *
- *  This way, the sender can be detached from the communication: it is not blocked as with Task.send()
- *  and has nothing to do at the end as with Task.isend() where it must do a Comm.wait().
- */
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-       /* This is just to ensure that nobody creates an instance of this singleton */
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-
-    String platform = "../platforms/small_platform.xml";
-    if (args.length >= 1) {
-       platform = args[0]; // Override the default value if passed on the command line
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(platform);
-    Host[] hosts = Host.all();
-    new Sender(hosts[0],"Sender").start();
-    for (int i=1; i < hosts.length; i++){
-      new Receiver(hosts[i], "Receiver").start();
-    }
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/async/dsend/Receiver.java b/examples/deprecated/java/async/dsend/Receiver.java
deleted file mode 100644 (file)
index 1284858..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.dsend;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.TimeoutException;
-import org.simgrid.msg.TransferFailureException;
-
-public class Receiver extends Process {
-  public Receiver (Host host, String name) {
-    super(host,name);
-  }
-
-  @Override
-  public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
-    Msg.info("Receiving on '"+ getHost().getName() + "'");
-    Task.receive(getHost().getName());
-    Msg.info("Received a task. I'm done. See you!");
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/async/dsend/Sender.java b/examples/deprecated/java/async/dsend/Sender.java
deleted file mode 100644 (file)
index 6059925..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.dsend;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Sender extends Process {
-  public Sender (Host host, String name){
-    super(host,name);
-  }
-
-  @Override
-  public void main(String[] args) throws MsgException {
-    double taskComputeSize =0;
-    double taskCommunicateSize = 5000000;
-    Host[] hosts = Host.all();
-    int receiverCount = hosts.length - 1;
-
-    Msg.info("Hello! Got "+ receiverCount + " receivers to contact");
-
-    for (int i = 1; i <= receiverCount; i++) {
-      Task task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize);
-      Msg.info("Sending \"" + task.getName()+ "\" to \"" + hosts[i].getName() + "\"");
-      task.dsend(hosts[i].getName());
-    }
-
-    Msg.info("All tasks have been (asynchronously) dispatched."+
-             " Let's sleep for 20s so that nobody gets a message from a terminated process.");
-
-    waitFor(20);
-
-    Msg.info("Done sleeping. Goodbye now!");
-  }
-}
diff --git a/examples/deprecated/java/async/dsend/async-dsend.tesh b/examples/deprecated/java/async/dsend/async-dsend.tesh
deleted file mode 100644 (file)
index fa926a1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env tesh
-
-! timeout 30
-$ ${javacmd:=java} -classpath ${classpath:=.} async/dsend/Main ${srcdir:=.}/../../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:Sender@Boivin) Hello! Got 6 receivers to contact
-> [  0.000000] (1:Sender@Boivin) Sending "Task_1" to "Bourassa"
-> [  0.000000] (2:Receiver@Bourassa) Receiving on 'Bourassa'
-> [  0.000000] (3:Receiver@Fafard) Receiving on 'Fafard'
-> [  0.000000] (4:Receiver@Ginette) Receiving on 'Ginette'
-> [  0.000000] (5:Receiver@Jacquelin) Receiving on 'Jacquelin'
-> [  0.000000] (6:Receiver@Jupiter) Receiving on 'Jupiter'
-> [  0.000000] (7:Receiver@Tremblay) Receiving on 'Tremblay'
-> [  0.000000] (1:Sender@Boivin) Sending "Task_2" to "Fafard"
-> [  0.000000] (1:Sender@Boivin) Sending "Task_3" to "Ginette"
-> [  0.000000] (1:Sender@Boivin) Sending "Task_4" to "Jacquelin"
-> [  0.000000] (1:Sender@Boivin) Sending "Task_5" to "Jupiter"
-> [  0.000000] (1:Sender@Boivin) Sending "Task_6" to "Tremblay"
-> [  0.000000] (1:Sender@Boivin) All tasks have been (asynchronously) dispatched. Let's sleep for 20s so that nobody gets a message from a terminated process.
-> [  1.933362] (6:Receiver@Jupiter) Received a task. I'm done. See you!
-> [  1.933362] (4:Receiver@Ginette) Received a task. I'm done. See you!
-> [  1.933362] (2:Receiver@Bourassa) Received a task. I'm done. See you!
-> [  2.449247] (7:Receiver@Tremblay) Received a task. I'm done. See you!
-> [  2.964768] (3:Receiver@Fafard) Received a task. I'm done. See you!
-> [  4.162002] (5:Receiver@Jacquelin) Received a task. I'm done. See you!
-> [ 20.000000] (1:Sender@Boivin) Done sleeping. Goodbye now!
-> [ 20.000000] (0:maestro@) Terminating the simulation...
diff --git a/examples/deprecated/java/async/waitall/Main.java b/examples/deprecated/java/async/waitall/Main.java
deleted file mode 100644 (file)
index 801327c..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.waitall;
-
-/** This example demonstrates the use of the asynchronous communications
- *
- *  Task.isend() and Task.irecv() are used to start the communications in non-blocking mode.
- *
- *  The sends are then blocked onto with Comm.waitCompletion(), that locks until the given
- *  communication terminates.
- *
- *  The receives are packed into an array, and the sender blocks until all of them terminate
- *  with Comm.waitAll().
- */
-
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-
-class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-
-    String platform = "../platforms/small_platform.xml";
-    if (args.length >= 1) {
-       platform = args[0]; // Override the default value if passed on the command line
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(platform);
-    Host[] hosts = Host.all();
-    new Sender(hosts[0],"Sender").start();
-    for (int i=1; i < hosts.length; i++){
-      new Receiver(hosts[i], "Receiver").start();
-    }
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/async/waitall/Receiver.java b/examples/deprecated/java/async/waitall/Receiver.java
deleted file mode 100644 (file)
index fb224d6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.waitall;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Comm;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.TimeoutException;
-import org.simgrid.msg.TransferFailureException;
-
-public class Receiver extends Process {
-  public Receiver (Host host, String name) {
-    super(host,name);
-  }
-
-  @Override
-  public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
-    Comm comm = Task.irecv(getHost().getName());
-    Msg.info("I started receiving on '"+ getHost().getName() +". Wait 0.1 second, and block on the communication.");
-    waitFor(0.1);
-    try {
-       comm.waitCompletion();
-    } catch (TimeoutException e) {
-       Msg.info("Timeout while waiting for my task");
-       throw e; // Stop this process
-    }
-    Msg.info("I got my task, good bye.");
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/async/waitall/Sender.java b/examples/deprecated/java/async/waitall/Sender.java
deleted file mode 100644 (file)
index 6dc86f1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.waitall;
-
-import org.simgrid.msg.Comm;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-
-public class Sender extends Process {
-  public Sender (Host host, String name){
-    super(host,name);
-  }
-
-  @Override
-  public void main(String[] args) throws MsgException {
-    double taskComputeSize =0;
-    double taskCommunicateSize = 5000000;
-    Host[] hosts = Host.all();
-    int receiverCount = hosts.length - 1;
-
-    Msg.info("I have "+ receiverCount + " receivers to contact");
-
-    Comm[] communicators = new Comm[receiverCount];
-    for (int i = 1; i <= receiverCount; i++) {
-      Task task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize);
-      Msg.info("Start the Sending '" + task.getName()+ "' to '" + hosts[i].getName() + "'");
-      communicators[i-1] = task.isend(hosts[i].getName());
-    }
-
-    Msg.info("All tasks have been (asynchronously) dispatched. Let's wait for their completion.");
-    Comm.waitAll(communicators);
-
-    Msg.info("Goodbye now!");
-  }
-}
diff --git a/examples/deprecated/java/async/waitall/async-waitall.tesh b/examples/deprecated/java/async/waitall/async-waitall.tesh
deleted file mode 100644 (file)
index 8aeab7b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} async/waitall/Main ${srcdir:=.}/../../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:Sender@Boivin) I have 6 receivers to contact
-> [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_1' to 'Bourassa'
-> [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_2' to 'Fafard'
-> [  0.000000] (2:Receiver@Bourassa) I started receiving on 'Bourassa. Wait 0.1 second, and block on the communication.
-> [  0.000000] (3:Receiver@Fafard) I started receiving on 'Fafard. Wait 0.1 second, and block on the communication.
-> [  0.000000] (4:Receiver@Ginette) I started receiving on 'Ginette. Wait 0.1 second, and block on the communication.
-> [  0.000000] (5:Receiver@Jacquelin) I started receiving on 'Jacquelin. Wait 0.1 second, and block on the communication.
-> [  0.000000] (6:Receiver@Jupiter) I started receiving on 'Jupiter. Wait 0.1 second, and block on the communication.
-> [  0.000000] (7:Receiver@Tremblay) I started receiving on 'Tremblay. Wait 0.1 second, and block on the communication.
-> [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_3' to 'Ginette'
-> [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_4' to 'Jacquelin'
-> [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_5' to 'Jupiter'
-> [  0.000000] (1:Sender@Boivin) Start the Sending 'Task_6' to 'Tremblay'
-> [  0.000000] (1:Sender@Boivin) All tasks have been (asynchronously) dispatched. Let's wait for their completion.
-> [  1.933362] (6:Receiver@Jupiter) I got my task, good bye.
-> [  1.933362] (4:Receiver@Ginette) I got my task, good bye.
-> [  1.933362] (2:Receiver@Bourassa) I got my task, good bye.
-> [  2.449247] (7:Receiver@Tremblay) I got my task, good bye.
-> [  2.964768] (3:Receiver@Fafard) I got my task, good bye.
-> [  4.162002] (5:Receiver@Jacquelin) I got my task, good bye.
-> [  4.162002] (1:Sender@Boivin) Goodbye now!
-> [  4.162002] (0:maestro@) Terminating the simulation...
diff --git a/examples/deprecated/java/async/yield/Main.java b/examples/deprecated/java/async/yield/Main.java
deleted file mode 100644 (file)
index 5ccdb85..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.yield;
-
-/** This example demonstrates the use of the Task.dsend() method.
- *
- *  This way, the sender can be detached from the communication: it is not blocked as with Task.send()
- *  and has nothing to do at the end as with Task.isend() where it must do a Comm.wait().
- */
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-       /* This is just to ensure that nobody creates an instance of this singleton */
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-
-    String platform = "../platforms/small_platform.xml";
-    if (args.length >= 1) {
-       platform = args[0]; // Override the default value if passed on the command line
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(platform);
-    Host[] hosts = Host.all();
-    new Yielder(hosts[0],"Yielder", new String[] {"10"}).start();
-    new Yielder(hosts[1],"Yielder", new String[] {"15"}).start();
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/async/yield/Yielder.java b/examples/deprecated/java/async/yield/Yielder.java
deleted file mode 100644 (file)
index 702b957..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package async.yield;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-
-public class Yielder extends Process {
-  public Yielder (Host host, String name, String[] args) {
-    super(host, name, args);
-  }
-
-  @Override
-  public void main(String[] args) {
-    int yieldsCount = Integer.parseInt(args[0]);
-    for (int i=0; i<yieldsCount; i++)
-        Process.yield();
-    Msg.info("Yielded "+yieldsCount+". Good bye now!");
-  }
-}
diff --git a/examples/deprecated/java/async/yield/async-yield.tesh b/examples/deprecated/java/async/yield/async-yield.tesh
deleted file mode 100644 (file)
index 3d1df97..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env tesh
-
-! timeout 30
-$ ${javacmd:=java} -classpath ${classpath:=.} async/yield/Main ${srcdir:=.}/../../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:Yielder@Boivin) Yielded 10. Good bye now!
-> [  0.000000] (2:Yielder@Bourassa) Yielded 15. Good bye now!
-> [  0.000000] (0:maestro@) Terminating the simulation...
diff --git a/examples/deprecated/java/cloud/masterworker/Main.java b/examples/deprecated/java/cloud/masterworker/Main.java
deleted file mode 100644 (file)
index 743c949..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.masterworker;
-
-import java.io.File;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-
-class Main {
-  public static final double TASK_COMP_SIZE = 10;
-  public static final double TASK_COMM_SIZE = 10;
-  public static final int NHOSTS = 6;
-  public static final int NSTEPS = 50;
-
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-
-    String platfFile = "../../examples/platforms/small_platform.xml";
-    if (args.length >= 1)
-       platfFile = args[0];
-
-    File f = new File(platfFile);
-    if (!f.exists()) {
-      Msg.error("File " + platfFile + " does not exist in " + System.getProperty("user.dir"));
-      Msg.error("Usage  : Main ../platforms/platform.xml");
-    }
-
-    Msg.createEnvironment(platfFile);
-    Host[] hosts = Host.all();
-    if (hosts.length < NHOSTS+1) {
-      Msg.info("I need at least "+ (NHOSTS+1) +"  hosts in the platform file, but " + args[0] + " contains only "
-               + hosts.length + " hosts");
-      System.exit(42);
-    }
-    new Master(hosts[0],"Master",hosts).start();
-
-    /* Execute the simulation */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/cloud/masterworker/Master.java b/examples/deprecated/java/cloud/masterworker/Master.java
deleted file mode 100644 (file)
index 65b7859..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.masterworker;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.VM;
-
-public class Master extends Process {
-       private Host[] hosts;
-
-       public Master(Host host, String name, Host[] hosts) {
-               super(host,name,null);
-               this.hosts = hosts;
-       }
-
-       public void main(String[] args) throws MsgException {
-               int workersCount = Main.NHOSTS;
-
-               for (int step = 1; step <= Main.NSTEPS ; step++) {
-                       // Create one VM per host and bind a process inside each one.
-                       for (int i = 0; i < workersCount; i++) {
-                               Msg.verb("create VM0-s"+step+"-"+i);
-                               VM vm = new VM(hosts[i+1],"VM0-s"+step+"-"+i);
-                               vm.start();
-                               Worker worker= new Worker(vm,"WK:"+step+":"+ i);
-                               Msg.verb("Put Worker "+worker.getName()+ " on "+vm.getName());
-                               worker.start();
-                       }
-                       VM[] vms = VM.all();
-
-                       Msg.info("Launched " + vms.length + " VMs");
-
-                       Msg.info("Send some work to everyone");
-                       workBatch(workersCount,"WK:"+step+":");
-
-                       Msg.info("Suspend all VMs, wait a while, resume them, migrate them and shut them down.");
-                       for (VM vm : vms) {
-                               Msg.verb("Suspend "+vm.getName());
-                               vm.suspend();
-                       }
-
-                       Msg.verb("Wait a while, and resume all VMs.");
-                       waitFor(2);
-                       for (VM vm : vms)
-                               vm.resume();
-
-
-                       Msg.verb("Sleep long enough for everyone to be done with previous batch of work");
-                       waitFor(1000*step - Msg.getClock());
-
-                       Msg.verb("Migrate everyone to "+hosts[3].getName());
-                       for (VM vm : vms) {
-                               Msg.verb("Migrate "+vm.getName()+" to "+hosts[3].getName());
-                               vm.migrate(hosts[3]);
-                       }
-
-                       Msg.verb("Let's kill everyone.");
-
-                       for (VM vm : vms)
-                               vm.destroy();
-                       Msg.info("XXXXXXXXXXXXXXX Step "+step+" done.");
-               }
-       }
-
-       public void workBatch(int workersCount, String nameRoot) throws MsgException {
-               for (int i = 0; i < workersCount; i++) {
-                       Task task = new Task("Task "+nameRoot + i, Main.TASK_COMP_SIZE, Main.TASK_COMM_SIZE);
-                       Msg.verb("Sending to "+ nameRoot + i);
-                       task.send(nameRoot + i);
-               }
-       }
-}
diff --git a/examples/deprecated/java/cloud/masterworker/Worker.java b/examples/deprecated/java/cloud/masterworker/Worker.java
deleted file mode 100644 (file)
index 9fd472a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.masterworker;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-
-public class Worker extends Process {
-  public Worker(Host host, String name) {
-    super(host, name);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Msg.verb(this.getName() +" is listening on "+ getName());
-    while(true) {
-      Task task = null;
-      try {
-        task = Task.receive(getName());
-      } catch (MsgException e) {
-        Msg.info("Received failed. I'm done. See you!");
-        exit();
-      }
-      Msg.verb("Received '" + task.getName() +  "'. Processing it.");
-      task.execute();
-      Msg.verb("Done executing task '" + task.getName() +"'");
-    }
-  }
-}
diff --git a/examples/deprecated/java/cloud/masterworker/cloud-masterworker.tesh b/examples/deprecated/java/cloud/masterworker/cloud-masterworker.tesh
deleted file mode 100644 (file)
index 2aef8c8..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} cloud/masterworker/Main ${srcdir:=.}/../../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:Master@Boivin) Launched 6 VMs
-> [  0.000000] (1:Master@Boivin) Send some work to everyone
-> [  2.186532] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [1971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 1 done.
-> [1971.662691] (1:Master@Boivin) Launched 6 VMs
-> [1971.662691] (1:Master@Boivin) Send some work to everyone
-> [1973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [2971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 2 done.
-> [2971.662691] (1:Master@Boivin) Launched 6 VMs
-> [2971.662691] (1:Master@Boivin) Send some work to everyone
-> [2973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [3971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 3 done.
-> [3971.662691] (1:Master@Boivin) Launched 6 VMs
-> [3971.662691] (1:Master@Boivin) Send some work to everyone
-> [3973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [4971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 4 done.
-> [4971.662691] (1:Master@Boivin) Launched 6 VMs
-> [4971.662691] (1:Master@Boivin) Send some work to everyone
-> [4973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [5971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 5 done.
-> [5971.662691] (1:Master@Boivin) Launched 6 VMs
-> [5971.662691] (1:Master@Boivin) Send some work to everyone
-> [5973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [6971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 6 done.
-> [6971.662691] (1:Master@Boivin) Launched 6 VMs
-> [6971.662691] (1:Master@Boivin) Send some work to everyone
-> [6973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [7971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 7 done.
-> [7971.662691] (1:Master@Boivin) Launched 6 VMs
-> [7971.662691] (1:Master@Boivin) Send some work to everyone
-> [7973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [8971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 8 done.
-> [8971.662691] (1:Master@Boivin) Launched 6 VMs
-> [8971.662691] (1:Master@Boivin) Send some work to everyone
-> [8973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [9971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 9 done.
-> [9971.662691] (1:Master@Boivin) Launched 6 VMs
-> [9971.662691] (1:Master@Boivin) Send some work to everyone
-> [9973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [10971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 10 done.
-> [10971.662691] (1:Master@Boivin) Launched 6 VMs
-> [10971.662691] (1:Master@Boivin) Send some work to everyone
-> [10973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [11971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 11 done.
-> [11971.662691] (1:Master@Boivin) Launched 6 VMs
-> [11971.662691] (1:Master@Boivin) Send some work to everyone
-> [11973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [12971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 12 done.
-> [12971.662691] (1:Master@Boivin) Launched 6 VMs
-> [12971.662691] (1:Master@Boivin) Send some work to everyone
-> [12973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [13971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 13 done.
-> [13971.662691] (1:Master@Boivin) Launched 6 VMs
-> [13971.662691] (1:Master@Boivin) Send some work to everyone
-> [13973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [14971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 14 done.
-> [14971.662691] (1:Master@Boivin) Launched 6 VMs
-> [14971.662691] (1:Master@Boivin) Send some work to everyone
-> [14973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [15971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 15 done.
-> [15971.662691] (1:Master@Boivin) Launched 6 VMs
-> [15971.662691] (1:Master@Boivin) Send some work to everyone
-> [15973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [16971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 16 done.
-> [16971.662691] (1:Master@Boivin) Launched 6 VMs
-> [16971.662691] (1:Master@Boivin) Send some work to everyone
-> [16973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [17971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 17 done.
-> [17971.662691] (1:Master@Boivin) Launched 6 VMs
-> [17971.662691] (1:Master@Boivin) Send some work to everyone
-> [17973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [18971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 18 done.
-> [18971.662691] (1:Master@Boivin) Launched 6 VMs
-> [18971.662691] (1:Master@Boivin) Send some work to everyone
-> [18973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [19971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 19 done.
-> [19971.662691] (1:Master@Boivin) Launched 6 VMs
-> [19971.662691] (1:Master@Boivin) Send some work to everyone
-> [19973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [20971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 20 done.
-> [20971.662691] (1:Master@Boivin) Launched 6 VMs
-> [20971.662691] (1:Master@Boivin) Send some work to everyone
-> [20973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [21971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 21 done.
-> [21971.662691] (1:Master@Boivin) Launched 6 VMs
-> [21971.662691] (1:Master@Boivin) Send some work to everyone
-> [21973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [22971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 22 done.
-> [22971.662691] (1:Master@Boivin) Launched 6 VMs
-> [22971.662691] (1:Master@Boivin) Send some work to everyone
-> [22973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [23971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 23 done.
-> [23971.662691] (1:Master@Boivin) Launched 6 VMs
-> [23971.662691] (1:Master@Boivin) Send some work to everyone
-> [23973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [24971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 24 done.
-> [24971.662691] (1:Master@Boivin) Launched 6 VMs
-> [24971.662691] (1:Master@Boivin) Send some work to everyone
-> [24973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [25971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 25 done.
-> [25971.662691] (1:Master@Boivin) Launched 6 VMs
-> [25971.662691] (1:Master@Boivin) Send some work to everyone
-> [25973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [26971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 26 done.
-> [26971.662691] (1:Master@Boivin) Launched 6 VMs
-> [26971.662691] (1:Master@Boivin) Send some work to everyone
-> [26973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [27971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 27 done.
-> [27971.662691] (1:Master@Boivin) Launched 6 VMs
-> [27971.662691] (1:Master@Boivin) Send some work to everyone
-> [27973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [28971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 28 done.
-> [28971.662691] (1:Master@Boivin) Launched 6 VMs
-> [28971.662691] (1:Master@Boivin) Send some work to everyone
-> [28973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [29971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 29 done.
-> [29971.662691] (1:Master@Boivin) Launched 6 VMs
-> [29971.662691] (1:Master@Boivin) Send some work to everyone
-> [29973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [30971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 30 done.
-> [30971.662691] (1:Master@Boivin) Launched 6 VMs
-> [30971.662691] (1:Master@Boivin) Send some work to everyone
-> [30973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [31971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 31 done.
-> [31971.662691] (1:Master@Boivin) Launched 6 VMs
-> [31971.662691] (1:Master@Boivin) Send some work to everyone
-> [31973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [32971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 32 done.
-> [32971.662691] (1:Master@Boivin) Launched 6 VMs
-> [32971.662691] (1:Master@Boivin) Send some work to everyone
-> [32973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [33971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 33 done.
-> [33971.662691] (1:Master@Boivin) Launched 6 VMs
-> [33971.662691] (1:Master@Boivin) Send some work to everyone
-> [33973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [34971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 34 done.
-> [34971.662691] (1:Master@Boivin) Launched 6 VMs
-> [34971.662691] (1:Master@Boivin) Send some work to everyone
-> [34973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [35971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 35 done.
-> [35971.662691] (1:Master@Boivin) Launched 6 VMs
-> [35971.662691] (1:Master@Boivin) Send some work to everyone
-> [35973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [36971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 36 done.
-> [36971.662691] (1:Master@Boivin) Launched 6 VMs
-> [36971.662691] (1:Master@Boivin) Send some work to everyone
-> [36973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [37971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 37 done.
-> [37971.662691] (1:Master@Boivin) Launched 6 VMs
-> [37971.662691] (1:Master@Boivin) Send some work to everyone
-> [37973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [38971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 38 done.
-> [38971.662691] (1:Master@Boivin) Launched 6 VMs
-> [38971.662691] (1:Master@Boivin) Send some work to everyone
-> [38973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [39971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 39 done.
-> [39971.662691] (1:Master@Boivin) Launched 6 VMs
-> [39971.662691] (1:Master@Boivin) Send some work to everyone
-> [39973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [40971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 40 done.
-> [40971.662691] (1:Master@Boivin) Launched 6 VMs
-> [40971.662691] (1:Master@Boivin) Send some work to everyone
-> [40973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [41971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 41 done.
-> [41971.662691] (1:Master@Boivin) Launched 6 VMs
-> [41971.662691] (1:Master@Boivin) Send some work to everyone
-> [41973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [42971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 42 done.
-> [42971.662691] (1:Master@Boivin) Launched 6 VMs
-> [42971.662691] (1:Master@Boivin) Send some work to everyone
-> [42973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [43971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 43 done.
-> [43971.662691] (1:Master@Boivin) Launched 6 VMs
-> [43971.662691] (1:Master@Boivin) Send some work to everyone
-> [43973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [44971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 44 done.
-> [44971.662691] (1:Master@Boivin) Launched 6 VMs
-> [44971.662691] (1:Master@Boivin) Send some work to everyone
-> [44973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [45971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 45 done.
-> [45971.662691] (1:Master@Boivin) Launched 6 VMs
-> [45971.662691] (1:Master@Boivin) Send some work to everyone
-> [45973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [46971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 46 done.
-> [46971.662691] (1:Master@Boivin) Launched 6 VMs
-> [46971.662691] (1:Master@Boivin) Send some work to everyone
-> [46973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [47971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 47 done.
-> [47971.662691] (1:Master@Boivin) Launched 6 VMs
-> [47971.662691] (1:Master@Boivin) Send some work to everyone
-> [47973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [48971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 48 done.
-> [48971.662691] (1:Master@Boivin) Launched 6 VMs
-> [48971.662691] (1:Master@Boivin) Send some work to everyone
-> [48973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [49971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 49 done.
-> [49971.662691] (1:Master@Boivin) Launched 6 VMs
-> [49971.662691] (1:Master@Boivin) Send some work to everyone
-> [49973.849223] (1:Master@Boivin) Suspend all VMs, wait a while, resume them, migrate them and shut them down.
-> [50971.662691] (1:Master@Boivin) XXXXXXXXXXXXXXX Step 50 done.
-> [50971.662691] (0:maestro@) Terminating the simulation...
diff --git a/examples/deprecated/java/cloud/migration/Daemon.java b/examples/deprecated/java/cloud/migration/Daemon.java
deleted file mode 100644 (file)
index 5dc73db..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (c) 2014-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.migration;
-
-import org.simgrid.msg.*;
-import org.simgrid.msg.Process;
-
-public class Daemon extends Process {
-  private Task currentTask;
-  public Daemon(VM vm) {
-    super((Host)vm,"Daemon");
-    currentTask = new Task(this.getHost().getName()+"-daemon-0", this.getHost().getSpeed()*100, 0);
-  }
-  public void main(String[] args) throws MsgException {
-    int i = 1;
-    while(!Main.isEndOfTest()) {
-    try {
-      currentTask.execute();
-    } catch (HostFailureException e) {
-      e.printStackTrace();
-    } catch (TaskCancelledException e) {
-      Msg.info("task cancelled");
-      suspend(); // Suspend the process
-    }
-    currentTask = new Task(this.getHost().getName()+"-daemon-"+(i++), this.getHost().getSpeed()*100, 0);
-  }
-}
-
-  public double getRemaining(){
-    return this.currentTask.getFlopsAmount();
-  }
-}
diff --git a/examples/deprecated/java/cloud/migration/Main.java b/examples/deprecated/java/cloud/migration/Main.java
deleted file mode 100644 (file)
index 18f6612..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (c) 2014-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.migration;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-
-public class Main {
-  private static boolean endOfTest = false;
-
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void setEndOfTest(){
-    endOfTest=true;
-  }
-
-  public static boolean isEndOfTest(){
-    return endOfTest;
-  }
-
-  public static void main(String[] args) throws MsgException {
-    Msg.init(args);
-    if (args.length < 1) {
-      Msg.info("Usage  : Main platform_file.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    new cloud.migration.Test("PM0","Test").start();
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/cloud/migration/README b/examples/deprecated/java/cloud/migration/README
deleted file mode 100644 (file)
index b346b59..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-There are two tests:
-- The first one aims at validating the migration in presence of consolidated VMs
-- The second one aims at validating the robustness of the migration process (the SRC node or the DST node are turned off during the migration process)
-
-To switch between the first and the second tests, you should instrument Main.java (sorry for that :( )
-Adsein - Thu Oct  9 18:25:39 CEST 2014
-
-UPDATE: the second test was never used (dit it ever work?), and was removed 4 years later
diff --git a/examples/deprecated/java/cloud/migration/Test.java b/examples/deprecated/java/cloud/migration/Test.java
deleted file mode 100644 (file)
index 730438d..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Copyright (c) 2014-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.migration;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.VM;
-
-public class Test extends Process{
-
-  Test(String hostname, String name) throws HostNotFoundException {
-    super(hostname, name);
-  }
-
-  public void doMigration(VM vm, Host src, Host dst) throws HostFailureException{
-    Msg.info("     - Launch migration from "+ src.getName() +" to " + dst.getName());
-    double startTime = Msg.getClock();
-    vm.migrate(dst);
-    double endTime = Msg.getClock();
-    Msg.info("     - End of Migration from "+ src.getName() +" to " + dst.getName()+ " (duration:" +
-             String.format(java.util.Locale.ROOT, "%.9f", (endTime-startTime))+")");
-  }
-
-  public void main(String[] strings) throws MsgException {
-    Host host0 = Host.getByName("PM0");
-    Host host1 = Host.getByName("PM1");
-
-    List<VM> vms = new ArrayList<>();
-
-    /* Create VM1 */
-    int dpRate = 70;
-    int load1 = 90;
-    int load2 = 80;
-
-    Msg.info("This example evaluates the migration time of a VM in presence of collocated VMs on the source and "
-             + "the dest nodes");
-    Msg.info("The migrated VM has a memory intensity rate of 70% of the network BW and a cpu load of 90% \" "
-             +"(see cloudcom 2013 paper \"Adding a Live Migration Model Into SimGrid\" for further information)");
-
-    Msg.info("Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see "
-             + "whether it impacts or not the migration time");
-    XVM vm1 = new XVM(host0, "vm0",
-        2048, // Ramsize,
-        125, // Net bandwidth,
-        dpRate // Memory intensity
-        );
-    vms.add(vm1);
-    vm1.start();
-
-    /* Collocated VMs */
-    int[] vmSrcLoad = {
-        80,
-        0,
-        90,
-        40,
-        30,
-        90,
-    };
-
-    XVM tmp;
-    for (int i=1 ; i<= vmSrcLoad.length ; i++){
-      tmp = new XVM(host0, "vm"+i,
-          2048, // Ramsize,
-          125, // Net bandwidth,
-          dpRate // Memory intensity
-          );
-      vms.add(tmp);
-      tmp.start();
-      tmp.setLoad(vmSrcLoad[i-1]);
-    }
-
-    int[] vmDstLoad = {
-        0,
-        40,
-        90,
-        100,
-        0,
-        80,
-    };
-
-    for (int i=1 ; i <= vmDstLoad.length ; i++){
-      tmp = new XVM(host1, "vm"+(i+vmSrcLoad.length),
-          2048, // Ramsize,
-          125, // Net bandwidth,
-          dpRate // Memory intensity
-          );
-      vms.add(tmp);
-      tmp.start();
-      tmp.setLoad(vmDstLoad[i-1]);
-    }
-
-    Msg.info("Round trip of VM1 (load "+load1+"%)");
-    vm1.setLoad(load1);
-    doMigration(vm1, host0, host1);
-    doMigration(vm1, host1, host0);
-    Msg.info(".");
-    Msg.info("Round trip of VM1 (load "+load2+"%)");
-    vm1.setLoad(load2);
-    doMigration(vm1, host0, host1);
-    doMigration(vm1, host1, host0);
-
-    Main.setEndOfTest();
-    Msg.info("Forcefully destroy VMs");
-    for (VM vm: vms)
-      vm.destroy();
-  }
-}
diff --git a/examples/deprecated/java/cloud/migration/XVM.java b/examples/deprecated/java/cloud/migration/XVM.java
deleted file mode 100644 (file)
index a2236a6..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright (c) 2014-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud.migration;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.VM;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostFailureException;
-
-public class XVM extends VM {
-  private int dpIntensity;
-  private int ramsize;
-  private int currentLoad = 0;
-
-  private Daemon daemon;
-
-  public XVM(Host host, String name, int ramsize, int migNetBW, int dpIntensity){
-    super(host, name, ramsize, (int)(migNetBW*0.9), dpIntensity);
-    this.dpIntensity = dpIntensity ;
-    this.ramsize= ramsize;
-    this.daemon = new Daemon(this);
-  }
-
-  public void setLoad(int load){
-    if (load >0) {
-      this.setBound(this.getSpeed()*load/100);
-      daemon.resume();
-    } else{
-      daemon.suspend();
-    }
-    currentLoad = load ;
-  }
-
-  @Override
-  public void start() {
-    super.start();
-    daemon.start();
-    this.setLoad(0);
-  }
-
-  public Daemon getDaemon(){
-    return this.daemon;
-  }
-
-  @Override
-  public void migrate(Host host) throws HostFailureException {
-    Msg.info("Start migration of VM " + this.getName() + " to " + host.getName());
-    Msg.info("    currentLoad:" + this.currentLoad + "/ramSize:" + this.ramsize + "/dpIntensity:" + this.dpIntensity
-        + "/remaining:" + String.format(java.util.Locale.ROOT, "%.2E",this.daemon.getRemaining()));
-    try{
-      super.migrate(host);
-    } catch (Exception e){
-      Msg.info("Something wrong during the live migration of VM "+this.getName());
-      throw new HostFailureException();
-    }
-    this.setLoad(this.currentLoad); //Fixed the fact that setBound is not propagated to the new node.
-    Msg.info("End of migration of VM " + this.getName() + " to node " + host.getName());
-  }
-}
diff --git a/examples/deprecated/java/cloud/migration/cloud-migration.tesh b/examples/deprecated/java/cloud/migration/cloud-migration.tesh
deleted file mode 100644 (file)
index 01feec9..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/../../platforms/three_multicore_hosts.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [PM0:Test:(1) 0.000000] [java/INFO] This example evaluates the migration time of a VM in presence of collocated VMs on the source and the dest nodes
-> [PM0:Test:(1) 0.000000] [java/INFO] The migrated VM has a memory intensity rate of 70% of the network BW and a cpu load of 90% " (see cloudcom 2013 paper "Adding a Live Migration Model Into SimGrid" for further information)
-> [PM0:Test:(1) 0.000000] [java/INFO] Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see whether it impacts or not the migration time
-> [PM0:Test:(1) 0.000000] [java/INFO] Round trip of VM1 (load 90%)
-> [PM0:Test:(1) 0.000000] [java/INFO]      - Launch migration from PM0 to PM1
-> [PM0:Test:(1) 0.000000] [java/INFO] Start migration of VM vm0 to PM1
-> [PM0:Test:(1) 0.000000] [java/INFO]     currentLoad:90/ramSize:2048/dpIntensity:70/remaining:8.10E+11
-> [PM0:Test:(1) 45.731913] [java/INFO] End of migration of VM vm0 to node PM1
-> [PM0:Test:(1) 45.731913] [java/INFO]      - End of Migration from PM0 to PM1 (duration:45.731912657)
-> [PM0:Test:(1) 45.731913] [java/INFO]      - Launch migration from PM1 to PM0
-> [PM0:Test:(1) 45.731913] [java/INFO] Start migration of VM vm0 to PM0
-> [PM0:Test:(1) 45.731913] [java/INFO]     currentLoad:90/ramSize:2048/dpIntensity:70/remaining:5.01E+11
-> [PM0:Test:(1) 97.502375] [java/INFO] End of migration of VM vm0 to node PM0
-> [PM0:Test:(1) 97.502375] [java/INFO]      - End of Migration from PM1 to PM0 (duration:51.770462809)
-> [PM0:Test:(1) 97.502375] [java/INFO] .
-> [PM0:Test:(1) 97.502375] [java/INFO] Round trip of VM1 (load 80%)
-> [PM0:Test:(1) 97.502375] [java/INFO]      - Launch migration from PM0 to PM1
-> [PM0:Test:(1) 97.502375] [java/INFO] Start migration of VM vm0 to PM1
-> [PM0:Test:(1) 97.502375] [java/INFO]     currentLoad:80/ramSize:2048/dpIntensity:70/remaining:1.24E+11
-> [PM0:Test:(1) 140.710983] [java/INFO] End of migration of VM vm0 to node PM1
-> [PM0:Test:(1) 140.710983] [java/INFO]      - End of Migration from PM0 to PM1 (duration:43.208607114)
-> [PM0:Test:(1) 140.710983] [java/INFO]      - Launch migration from PM1 to PM0
-> [PM0:Test:(1) 140.710983] [java/INFO] Start migration of VM vm0 to PM0
-> [PM0:Test:(1) 140.710983] [java/INFO]     currentLoad:80/ramSize:2048/dpIntensity:70/remaining:6.54E+11
-> [PM0:Test:(1) 183.918289] [java/INFO] End of migration of VM vm0 to node PM0
-> [PM0:Test:(1) 183.918289] [java/INFO]      - End of Migration from PM1 to PM0 (duration:43.207306114)
-> [PM0:Test:(1) 183.918289] [java/INFO] Forcefully destroy VMs
-> [183.918289] [java/INFO] Terminating the simulation...
diff --git a/examples/deprecated/java/dht/chord/ChordTask.java b/examples/deprecated/java/dht/chord/ChordTask.java
deleted file mode 100644 (file)
index 17ce34d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-import org.simgrid.msg.Task;
-
-public class ChordTask extends Task {
-  private String issuerHostName;
-  private String answerTo;
-  public ChordTask() {
-    this(null,null);
-  }
-
-  public ChordTask(String issuerHostName, String answerTo) {
-         super(null, Common.COMP_SIZE, Common.COMM_SIZE);
-         this.issuerHostName = issuerHostName;
-         this.answerTo = answerTo;
-  }
-
-  public String getIssuerHostName(){
-    return this.issuerHostName;
-  }
-
-  public String getAnswerTo(){
-    return this.answerTo;
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/Common.java b/examples/deprecated/java/dht/chord/Common.java
deleted file mode 100644 (file)
index 5812fc6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-public class Common {
-  public static final int COMM_SIZE = 10;
-  public static final int COMP_SIZE = 0;
-
-  public static final int NB_BITS = 24;
-  public static final int NB_KEYS = 16777216;
-  public static final int TIMEOUT = 50;
-  public static final int MAX_SIMULATION_TIME = 1000;
-  public static final int PERIODIC_STABILIZE_DELAY = 20;
-  public static final int PERIODIC_FIX_FINGERS_DELAY = 120;
-  public static final int PERIODIC_CHECK_PREDECESSOR_DELAY = 120;
-  public static final int PERIODIC_LOOKUP_DELAY = 10;
-  private Common() {
-    throw new IllegalAccessError("Utility class");
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/FindSuccessorAnswerTask.java b/examples/deprecated/java/dht/chord/FindSuccessorAnswerTask.java
deleted file mode 100644 (file)
index d0530b6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-public class FindSuccessorAnswerTask extends ChordTask {
-  private int answerId;
-
-  public FindSuccessorAnswerTask(String issuerHostname, String answerTo, int answerId) {
-    super(issuerHostname,answerTo);
-    this.answerId = answerId;
-  }
-
-  public int getAnswerId(){
-    return this.answerId;
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/FindSuccessorTask.java b/examples/deprecated/java/dht/chord/FindSuccessorTask.java
deleted file mode 100644 (file)
index 04022ea..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-public class FindSuccessorTask extends ChordTask {
-  private int requestId;
-
-  public FindSuccessorTask(String issuerHostname, String answerTo,  int requestId) {
-    super(issuerHostname, answerTo);
-    this.requestId = requestId;
-  }
-
-  public int getRequestId(){
-    return this.requestId;
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/GetPredecessorAnswerTask.java b/examples/deprecated/java/dht/chord/GetPredecessorAnswerTask.java
deleted file mode 100644 (file)
index 514d33f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-public class GetPredecessorAnswerTask extends ChordTask {
-  private int answerId;
-
-  public GetPredecessorAnswerTask(String issuerHostname, String answerTo, int answerId) {
-    super(issuerHostname,answerTo);
-    this.answerId = answerId;
-  }
-
-  public int getAnswerId(){
-    return this.answerId;
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/GetPredecessorTask.java b/examples/deprecated/java/dht/chord/GetPredecessorTask.java
deleted file mode 100644 (file)
index aae8184..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-public class GetPredecessorTask extends ChordTask {
-  public GetPredecessorTask(String issuerHostName, String answerTo) {
-    super(issuerHostName, answerTo);
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/Main.java b/examples/deprecated/java/dht/chord/Main.java
deleted file mode 100644 (file)
index c49bcc2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 2) {
-      Msg.info("Usage   : Chord platform_file deployment_file");
-      Msg.info("example : Chord ../platforms/platform.xml chord.xml");
-      System.exit(1);
-    }
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    Msg.deployApplication(args[1]);
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/Node.java b/examples/deprecated/java/dht/chord/Node.java
deleted file mode 100644 (file)
index b2877d6..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Comm;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.TimeoutException;
-public class Node extends Process {
-  protected int id;
-  protected String mailbox;
-  protected int predId;
-  protected String predMailbox;
-  protected int nextFingerToFix;
-  protected Comm commReceive;
-  ///Last time I changed a finger or my predecessor
-  protected double lastChangeDate;
-  private int[] fingers;
-
-  public Node(Host host, String name, String[] args) {
-    super(host,name,args);
-  }
-
-  @Override
-  public void main(String[] args) throws MsgException {
-    if (args.length != 2 && args.length != 4) {
-      Msg.info("You need to provide 2 or 4 arguments.");
-      return;
-    }
-    double initTime = Msg.getClock();
-    int i;
-    boolean joinSuccess;
-    double deadline;
-
-    double nextStabilizeDate = initTime + Common.PERIODIC_STABILIZE_DELAY;
-    double nextFixFingersDate = initTime + Common.PERIODIC_FIX_FINGERS_DELAY;
-    double nextCheckPredecessorDate = initTime + Common.PERIODIC_CHECK_PREDECESSOR_DELAY;
-    double nextLookupDate = initTime + Common.PERIODIC_LOOKUP_DELAY;
-
-    mailbox = args[0];
-    id = Integer.parseInt(args[0]);
-
-    fingers = new int[Common.NB_BITS];
-    for (i = 0; i < Common.NB_BITS; i++) {
-      fingers[i] = -1;
-      setFinger(i,this.id);
-    }
-
-    //First node
-    if (args.length == 2) {
-      deadline = Integer.parseInt(args[1]);
-      create();
-      joinSuccess = true;
-    } else {
-      int knownId = Integer.parseInt(args[1]);
-      deadline = Integer.parseInt(args[3]);
-      Msg.debug("Hey! Let's join the system with the id " + id + ".");
-
-      joinSuccess = join(knownId);
-    }
-
-    if (!joinSuccess) {
-      Msg.info("I couldn't join the ring");
-      return;
-    }
-
-    double currentClock = Msg.getClock();
-    while (currentClock < (initTime + deadline) && currentClock < Common.MAX_SIMULATION_TIME) {
-      if (commReceive == null) {
-        commReceive = Task.irecv(this.mailbox);
-      }
-      try {
-        if (!commReceive.test()) {
-          if (currentClock >= nextStabilizeDate) {
-            stabilize();
-            nextStabilizeDate = Msg.getClock() + Common.PERIODIC_STABILIZE_DELAY;
-          } else if (currentClock >= nextFixFingersDate) {
-            fixFingers();
-            nextFixFingersDate = Msg.getClock() + Common.PERIODIC_FIX_FINGERS_DELAY;
-          } else if (currentClock >= nextCheckPredecessorDate) {
-            this.checkPredecessor();
-            nextCheckPredecessorDate = Msg.getClock() + Common.PERIODIC_CHECK_PREDECESSOR_DELAY;
-          } else if (currentClock >= nextLookupDate) {
-            this.randomLookup();
-            nextLookupDate = Msg.getClock() + Common.PERIODIC_LOOKUP_DELAY;
-          } else {
-            waitFor(5);
-          }
-          currentClock = Msg.getClock();
-        } else {
-          handleTask(commReceive.getTask());
-          currentClock = Msg.getClock();
-          commReceive = null;
-        }
-      }
-      catch (Exception e) {
-        currentClock = Msg.getClock();
-        commReceive = null;
-      }
-    }
-    leave();
-    if (commReceive != null) {
-      commReceive = null;
-    }
-  }
-
-  private void handleTask(Task task) {
-    if (task instanceof FindSuccessorTask) {
-      FindSuccessorTask fTask = (FindSuccessorTask)task;
-      Msg.debug("Receiving a 'Find Successor' request from " + fTask.getIssuerHostName() + " for id " +
-                fTask.getRequestId());
-      // is my successor the successor?
-      if (isInInterval(fTask.getRequestId(), this.id + 1, fingers[0])) {
-        Msg.debug("Send the request to " + fTask.getAnswerTo() + " with answer " + fingers[0]);
-        FindSuccessorAnswerTask answer = new FindSuccessorAnswerTask(getHost().getName(), mailbox, fingers[0]);
-        answer.dsend(fTask.getAnswerTo());
-      } else {
-        // otherwise, forward the request to the closest preceding finger in my table
-        int closest = closestPrecedingNode(fTask.getRequestId());
-        Msg.debug("Forward the request to " + closest);
-        fTask.dsend(Integer.toString(closest));
-      }
-    } else if (task instanceof GetPredecessorTask) {
-      GetPredecessorTask gTask = (GetPredecessorTask)(task);
-      Msg.debug("Receiving a 'Get Predecessor' request from " + gTask.getIssuerHostName());
-      GetPredecessorAnswerTask answer = new GetPredecessorAnswerTask(getHost().getName(), mailbox, predId);
-      answer.dsend(gTask.getAnswerTo());
-    } else if (task instanceof NotifyTask) {
-      NotifyTask nTask = (NotifyTask)task;
-      notify(nTask.getRequestId());
-    } else {
-      Msg.debug("Ignoring unexpected task of type:" + task);
-    }
-  }
-
-  private void leave() {
-    Msg.debug("Well Guys! I Think it's time for me to quit ;)");
-    // TODO: Notify my successor and predecessor.
-  }
-
-  /** @brief Initializes the current node as the first one of the system  */
-  private void create() {
-    Msg.debug("Create a new Chord ring...");
-    setPredecessor(-1);
-  }
-
-  // Makes the current node join the ring, knowing the id of a node already in the ring
-  private boolean join(int knownId) {
-    Msg.info("Joining the ring with id " + this.id + " knowing node " + knownId);
-    setPredecessor(-1);
-    int successorId = remoteFindSuccessor(knownId, this.id);
-    if (successorId == -1) {
-      Msg.info("Cannot join the ring.");
-    } else {
-      setFinger(0, successorId);
-    }
-    return successorId != -1;
-  }
-
-  private void setPredecessor(int predecessorId) {
-    if (predecessorId != predId) {
-      predId = predecessorId;
-      if (predecessorId != -1) {
-        predMailbox = Integer.toString(predId);
-      }
-      lastChangeDate = Msg.getClock();
-    }
-  }
-
-  /**
-   * @brief Asks another node its predecessor.
-   * @param askTo the node to ask to
-   * @return the id of its predecessor node, or -1 if the request failed(or if the node does not know its predecessor)
-   */
-  private int remoteGetPredecessor(int askTo) {
-    int predecessorId = -1;
-    boolean stop = false;
-    Msg.debug("Sending a 'Get Predecessor' request to " + askTo);
-    String mailboxTo = Integer.toString(askTo);
-    GetPredecessorTask sendTask = new GetPredecessorTask(getHost().getName(), this.mailbox);
-    try {
-      sendTask.send(mailboxTo, Common.TIMEOUT);
-      do {
-        if (commReceive == null) {
-          commReceive = Task.irecv(this.mailbox);
-        }
-        commReceive.waitCompletion(Common.TIMEOUT);
-        Task taskReceived = commReceive.getTask();
-        if (taskReceived instanceof GetPredecessorAnswerTask) {
-          predecessorId = ((GetPredecessorAnswerTask) taskReceived).getAnswerId();
-          stop = true;
-        } else {
-          handleTask(taskReceived);
-        }
-        commReceive = null;
-      } while (!stop);
-    }
-    catch (MsgException e) {
-      Msg.debug("Failed to send the Get Predecessor request");
-    }
-    commReceive = null;
-
-    return predecessorId;
-  }
-
-  /**
-   * @brief Makes the current node find the successor node of an id.
-   * @param node the current node
-   * @param id the id to find
-   * @return the id of the successor node, or -1 if the request failed
-   */
-  private int findSuccessor(int id) {
-    if (isInInterval(id, this.id + 1, fingers[0])) {
-      return fingers[0];
-    }
-
-    int closest = this.closestPrecedingNode(id);
-    return remoteFindSuccessor(closest, id);
-  }
-
-  // Asks another node the successor node of an id.
-  private int remoteFindSuccessor(int askTo, int id) {
-    int successor = -1;
-    boolean stop = false;
-    String askToMailbox = Integer.toString(askTo);
-    Task sendTask = new FindSuccessorTask(getHost().getName(), this.mailbox, id);
-    Msg.debug("Sending a 'Find Successor' request to " + askToMailbox + " for id " + id);
-    try {
-      sendTask.send(askToMailbox, Common.TIMEOUT);
-      do {
-        if (commReceive == null) {
-          commReceive = Task.irecv(this.mailbox);
-        }
-        commReceive.waitCompletion(Common.TIMEOUT);
-        Task task = commReceive.getTask();
-        if (task instanceof FindSuccessorAnswerTask) {
-          //TODO: Check if this this our answer.
-          FindSuccessorAnswerTask fTask = (FindSuccessorAnswerTask) task;
-          stop = true;
-          successor = fTask.getAnswerId();
-        } else {
-          handleTask(task);
-        }
-        commReceive = null;
-      } while (!stop);
-    }
-    catch (TimeoutException e) {
-      Msg.debug("Failed to send the 'Find Successor' request");
-    }
-    catch (MsgException e) {
-      Msg.debug("Failed to receive Find Successor");
-    }
-    commReceive = null;
-
-    return successor;
-  }
-
-  // This function is called periodically. It checks the immediate successor of the current node.
-  private void stabilize() {
-    Msg.debug("Stabilizing node");
-    int candidateId;
-    int successorId = fingers[0];
-    if (successorId != this.id){
-      candidateId = remoteGetPredecessor(successorId);
-    } else {
-      candidateId = predId;
-    }
-    //This node is a candidate to become my new successor
-    if (candidateId != -1 && isInInterval(candidateId, this.id + 1, successorId - 1)) {
-      setFinger(0, candidateId);
-    }
-    if (successorId != this.id) {
-      remoteNotify(successorId, this.id);
-    }
-  }
-
-  /**
-   * @brief Notifies the current node that its predecessor may have changed.
-   * @param candidate_id the possible new predecessor
-   */
-  private void notify(int predecessorCandidateId) {
-    if (predId == -1 || isInInterval(predecessorCandidateId, predId + 1, this.id - 1 )) {
-      setPredecessor(predecessorCandidateId);
-    }
-  }
-
-  /**
-   * @brief Notifies a remote node that its predecessor may have changed.
-   * @param notify_id id of the node to notify
-   * @param candidate_id the possible new predecessor
-   */
-  private void remoteNotify(int notifyId, int predecessorCandidateId) {
-    Msg.debug("Sending a 'Notify' request to " + notifyId);
-    Task sentTask = new NotifyTask(getHost().getName(), this.mailbox, predecessorCandidateId);
-    sentTask.dsend(Integer.toString(notifyId));
-  }
-
-  // This function is called periodically.
-  // It refreshes the finger table of the current node.
-  private void fixFingers() {
-    Msg.debug("Fixing fingers");
-    int successorId = findSuccessor(id + (1 << nextFingerToFix));
-    if (successorId != -1) {
-      if (successorId != fingers[nextFingerToFix]) {
-        setFinger(nextFingerToFix, successorId);
-      }
-      nextFingerToFix = (nextFingerToFix + 1) % Common.NB_BITS;
-    }
-  }
-
-  // This function is called periodically.
-  // It checks whether the predecessor has failed
-  private void checkPredecessor() {
-    //TODO
-  }
-
-  // Performs a find successor request to a random id.
-  private void randomLookup() {
-    int dest = 1337;
-    findSuccessor(dest);
-  }
-
-  /**
-   * @brief Returns the closest preceding finger of an id with respect to the finger table of the current node.
-   * @param id the id to find
-   * @return the closest preceding finger of that id
-   */
-  private int closestPrecedingNode(int id) {
-    for (int i = Common.NB_BITS - 1; i >= 0; i--) {
-      if (isInInterval(fingers[i], this.id + 1, id - 1)) {
-        return fingers[i];
-      }
-    }
-    return this.id;
-  }
-
-  /**
-   * @brief Returns whether an id belongs to the interval [start, end].
-   *
-   * The parameters are noramlized to make sure they are between 0 and nb_keys - 1).
-   * 1 belongs to [62, 3]
-   * 1 does not belong to [3, 62]
-   * 63 belongs to [62, 3]
-   * 63 does not belong to [3, 62]
-   * 24 belongs to [21, 29]
-   * 24 does not belong to [29, 21]
-   *
-   * @param id id to check
-   * @param start lower bound
-   * @param end upper bound
-   * @return a non-zero value if id in in [start, end]
-   */
-  private static boolean isInInterval(int id, int start, int end) {
-    int normId = normalize(id);
-    int normStart = normalize(start);
-    int normEnd = normalize(end);
-
-    // make sure end >= start and id >= start
-    if (normEnd < normStart) {
-      normEnd += Common.NB_KEYS;
-    }
-    if (normId < normStart) {
-      normId += Common.NB_KEYS;
-    }
-    return (normId <= normEnd);
-  }
-
-  /**
-   * @brief Turns an id into an equivalent id in [0, nb_keys).
-   * @param id an id
-   * @return the corresponding normalized id
-   */
-  private static int normalize(int id) {
-    return id & (Common.NB_KEYS - 1);
-  }
-
-  /**
-   * @brief Sets a finger of the current node.
-   * @param finger_index index of the finger to set (0 to nb_bits - 1)
-   * @param id the id to set for this finger
-   */
-  private void setFinger(int fingerIndex, int id) {
-    if (id != fingers[fingerIndex]) {
-      fingers[fingerIndex] = id;
-      lastChangeDate = Msg.getClock();
-    }
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/NotifyTask.java b/examples/deprecated/java/dht/chord/NotifyTask.java
deleted file mode 100644 (file)
index e304629..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.chord;
-
-public class NotifyTask extends ChordTask {
-  private int requestId;
-
-  public NotifyTask(String issuerHostname, String answerTo, int requestId) {
-    super(issuerHostname, answerTo);
-    this.requestId = requestId;
-  }
-
-  public int getRequestId(){
-    return this.requestId;
-  }
-}
diff --git a/examples/deprecated/java/dht/chord/chord.xml b/examples/deprecated/java/dht/chord/chord.xml
deleted file mode 100644 (file)
index bd76a59..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <actor host="node-0.simgrid.org" function="dht.chord.Node">
-    <argument value="42"/>
-    <argument value="6000000"/>
-  </actor>
-  <actor host="node-1.simgrid.org" function="dht.chord.Node">
-    <argument value="366680" />
-    <argument value="42" />
-    <argument value="10" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-2.simgrid.org" function="dht.chord.Node">
-    <argument value="533744" />
-    <argument value="366680" />
-    <argument value="20" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-3.simgrid.org" function="dht.chord.Node">
-    <argument value="1319738" />
-    <argument value="42" />
-    <argument value="30" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-4.simgrid.org" function="dht.chord.Node">
-    <argument value="16509405" />
-    <argument value="366680" />
-    <argument value="40" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-5.simgrid.org" function="dht.chord.Node">
-    <argument value="10874876" />
-    <argument value="533744" />
-    <argument value="50" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-6.simgrid.org" function="dht.chord.Node">
-    <argument value="16728096" />
-    <argument value="1319738" />
-    <argument value="60" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-7.simgrid.org" function="dht.chord.Node">
-    <argument value="10004760" />
-    <argument value="16509405" />
-    <argument value="70" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-8.simgrid.org" function="dht.chord.Node">
-    <argument value="6518808" />
-    <argument value="42" />
-    <argument value="80" />
-    <argument value="6000000" />
-  </actor>
-  <actor host="node-9.simgrid.org" function="dht.chord.Node">
-    <argument value="2015253" />
-    <argument value="1319738" />
-    <argument value="90" />
-    <argument value="6000000" />
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/dht/chord/dht-chord.tesh b/examples/deprecated/java/dht/chord/dht-chord.tesh
deleted file mode 100644 (file)
index e85a815..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-
-$ ${javacmd:=java} -classpath ${classpath:=.} dht/chord/Main ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/dht/chord/chord.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [1046.803210] [java/INFO] Terminating the simulation...
-> [node-1.simgrid.org:dht.chord.Node:(2) 0.000000] [java/INFO] Joining the ring with id 366680 knowing node 42
-> [node-2.simgrid.org:dht.chord.Node:(3) 0.000000] [java/INFO] Joining the ring with id 533744 knowing node 366680
-> [node-3.simgrid.org:dht.chord.Node:(4) 0.000000] [java/INFO] Joining the ring with id 1319738 knowing node 42
-> [node-4.simgrid.org:dht.chord.Node:(5) 0.000000] [java/INFO] Joining the ring with id 16509405 knowing node 366680
-> [node-5.simgrid.org:dht.chord.Node:(6) 0.000000] [java/INFO] Joining the ring with id 10874876 knowing node 533744
-> [node-6.simgrid.org:dht.chord.Node:(7) 0.000000] [java/INFO] Joining the ring with id 16728096 knowing node 1319738
-> [node-7.simgrid.org:dht.chord.Node:(8) 0.000000] [java/INFO] Joining the ring with id 10004760 knowing node 16509405
-> [node-8.simgrid.org:dht.chord.Node:(9) 0.000000] [java/INFO] Joining the ring with id 6518808 knowing node 42
-> [node-9.simgrid.org:dht.chord.Node:(10) 0.000000] [java/INFO] Joining the ring with id 2015253 knowing node 1319738
diff --git a/examples/deprecated/java/dht/kademlia/Answer.java b/examples/deprecated/java/dht/kademlia/Answer.java
deleted file mode 100644 (file)
index 2b82371..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-import java.util.ArrayList;
-import java.util.Collections;
-
-/* Answer to a "FIND_NODE" query. Contains the nodes closest to an id given */
-public class Answer {
-  private int destinationId;
-  /* Closest nodes in the answer. */
-  private ArrayList<Contact> nodes;
-
-  public Answer(int destinationId) {
-    this.destinationId = destinationId;
-    nodes = new ArrayList<>();
-  }
-
-  protected int getDestinationId() {
-    return destinationId;
-  }
-
-  protected ArrayList<Contact> getNodes() {
-    return nodes;
-  }
-
-  protected int size() {
-    return nodes.size();
-  }
-
-  public void trim() {
-    if (nodes.size() > Common.BUCKET_SIZE)
-      nodes.subList(nodes.size() - Common.BUCKET_SIZE, nodes.size()).clear();
-  }
-
-  public void add(Contact contact) {
-    nodes.add(contact);
-  }
-
-  /* Merge the contents of this answer with another answer */
-  public int merge(Answer answer) {
-    int nbAdded = 0;
-
-    for (Contact c: answer.getNodes()) {
-      if (!nodes.contains(c)) {
-        nbAdded++;
-        nodes.add(c);
-      }
-    }
-    Collections.sort(nodes);
-    //Trim the list
-    answer.trim();
-
-    return nbAdded;
-  }
-
-  /* Returns if the destination has been found */
-  public boolean destinationFound() {
-    if (nodes.isEmpty()) {
-      return false;
-    }
-    Contact tail = nodes.get(0);
-    return tail.getDistance() == 0;
-  }
-
-  @Override
-  public String toString() {
-    return "Answer [destinationId=" + destinationId + ", nodes=" + nodes + "]";
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/Bucket.java b/examples/deprecated/java/dht/kademlia/Bucket.java
deleted file mode 100644 (file)
index 8422ab3..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-import java.util.ArrayList;
-
-public class Bucket {
-  private ArrayList<Integer> nodes;
-  private int id;
-
-  public Bucket(int id) {
-    this.nodes = new ArrayList<>();
-    this.id = id;
-  }
-
-  public int getId() {
-    return this.id;
-  }
-
-  public int size() {
-    return nodes.size();
-  }
-
-  public boolean contains(int id) {
-    return nodes.contains(id);
-  }
-
-  /* Add a node to the front of the bucket */
-  public void add(int id) {
-    nodes.add(0,id);
-  }
-
-  /* Push a node to the front of a bucket */
-  public void pushToFront(int id) {
-    int i = nodes.indexOf(id);
-    nodes.remove(i);
-    nodes.add(0, id);
-  }
-
-  public int getNode(int id) {
-    return nodes.get(id);
-  }
-
-  /* Add the content of the bucket into an answer object. */
-  public void addToAnswer(Answer answer, int destination) {
-    for (int nodeId : this.nodes) {
-      answer.getNodes().add(new Contact(nodeId,nodeId ^ destination));
-    }
-  }
-
-  @Override
-  public String toString() {
-    return "Bucket [id= " + id + " nodes=" + nodes + "]";
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/Common.java b/examples/deprecated/java/dht/kademlia/Common.java
deleted file mode 100644 (file)
index 64d0730..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-
-public class Common {
-  /* Common constants used all over the simulation */
-  public static final int COMM_SIZE = 1;
-  public static final int COMP_SIZE = 0;
-
-  public static final int RANDOM_LOOKUP_INTERVAL = 100;
-
-  public static final int ALPHA = 3;
-
-  public static final int IDENTIFIER_SIZE = 32;
-  /* Maximum size of the buckets */
-  public static final int BUCKET_SIZE = 20;
-  /* Maximum number of trials for the "JOIN" request */
-  public static final int MAX_JOIN_TRIALS = 4;
-  /* Timeout for a "FIND_NODE" request to a node */
-  public static final int FIND_NODE_TIMEOUT = 10;
-  /* Global timeout for a FIND_NODE request */
-  public static final int FIND_NODE_GLOBAL_TIMEOUT = 50;
-
-  public static final int MAX_STEPS = 10;
-  public static final int JOIN_BUCKETS_QUERIES = 1;
-  private Common() {
-    throw new IllegalAccessError("Utility class");
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/Contact.java b/examples/deprecated/java/dht/kademlia/Contact.java
deleted file mode 100644 (file)
index 4a9c89a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-
-public class Contact implements Comparable<Object> {
-  private int id;
-  private int distance;
-
-  public Contact(int id, int distance) {
-    this.id = id;
-    this.distance = distance;
-  }
-
-  public int getId() {
-    return id;
-  }
-
-  public int getDistance() {
-    return distance;
-  }
-
-  @Override
-  public boolean equals(Object x) {
-    return x != null && x.equals(id);
-  }
-
-  @Override
-  public int hashCode() {
-    int hash = 1;
-    hash = hash * 17 + id;
-    hash = hash * 31 + distance;
-    return hash;
-  }
-
-  @Override
-  public int compareTo(Object o) {
-    Contact c = (Contact)o;
-    if (distance < c.distance) {
-      return -1;
-    }
-    else if (distance == c.distance) {
-      return 0;
-    }
-    else {
-      return 1;
-    }
-  }
-
-  @Override
-  public String toString() {
-    return "Contact [id=" + id + ", distance=" + distance + "]";
-  }
-
-}
diff --git a/examples/deprecated/java/dht/kademlia/FindNodeAnswerTask.java b/examples/deprecated/java/dht/kademlia/FindNodeAnswerTask.java
deleted file mode 100644 (file)
index b451e74..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-
-public class FindNodeAnswerTask extends KademliaTask {
-  protected int destinationId;
-  protected Answer answer;
-
-  public FindNodeAnswerTask(int senderId, int destinationId, Answer answer) {
-    super(senderId);
-    this.destinationId = destinationId;
-    this.answer = answer;
-  }
-  public int getDestinationId() {
-    return destinationId;
-  }
-  public Answer getAnswer() {
-    return answer;
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/FindNodeTask.java b/examples/deprecated/java/dht/kademlia/FindNodeTask.java
deleted file mode 100644 (file)
index b2ceb35..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-
-/**
- * @brief Find node tasks sent by a node to another "Find Node" task sent by a node to another. Ask him for its closest
- * nodes from a destination.
- */
-public class FindNodeTask extends KademliaTask {
-  /* Id of the node we are trying to find: the destination */
-  private int destination;
-
-  public FindNodeTask(int senderId, int destination) {
-    super(senderId);
-    this.destination = destination;
-  }
-
-  public int getDestination() {
-    return destination;
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/KademliaTask.java b/examples/deprecated/java/dht/kademlia/KademliaTask.java
deleted file mode 100644 (file)
index 9557c93..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-
-import org.simgrid.msg.Task;
-
-public class KademliaTask extends Task {
-  protected int senderId;
-
-  public KademliaTask(int senderId) {
-    super("kademliatask",Common.COMP_SIZE,Common.COMM_SIZE);
-    this.senderId = senderId;
-  }
-
-  public int getSenderId() {
-    return senderId;
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/Main.java b/examples/deprecated/java/dht/kademlia/Main.java
deleted file mode 100644 (file)
index 552d339..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 2) {
-      Msg.info("Usage   : Kademlia platform_file deployment_file");
-      Msg.info("example : Kademlia ../platforms/platform.xml kademlia.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    Msg.deployApplication(args[1]);
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/Node.java b/examples/deprecated/java/dht/kademlia/Node.java
deleted file mode 100644 (file)
index a214746..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-
-import org.simgrid.msg.Host;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Comm;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Node extends Process {
-  protected int id;
-  protected RoutingTable table;
-  protected int deadline;
-  protected int findNodeSuccedded = 0;
-  protected int findNodeFailed = 0;
-  protected Comm comm;
-
-  public Node(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  @Override
-  public void main(String[] args) throws MsgException {
-    //Check the number of arguments.
-    if (args.length != 2 && args.length != 3) {
-      Msg.info("Wrong argument count.");
-      return;
-    }
-    this.id = Integer.parseInt(args[0]);
-    this.table = new RoutingTable(this.id);
-
-    if (args.length == 3) {
-      this.deadline = Integer.parseInt(args[2]);
-      Msg.info("Hi, I'm going to join the network with the id " + id + "!");
-      if (joinNetwork(Integer.parseInt(args[1]))) {
-        this.mainLoop();
-      }
-      else {
-        Msg.info("I couldn't join the network :(");
-      }
-    }
-    else {
-      this.deadline = Integer.parseInt(args[1]);
-      Msg.info("Hi, I'm going to create the network with the id " + id + "!");
-      table.update(this.id);
-      this.mainLoop();
-    }
-    Msg.debug("I'm leaving the network");
-    Msg.debug("Here is my routing table:" + table);
-  }
-
-  public void mainLoop() {
-    double nextLookupTime = Msg.getClock() + Common.RANDOM_LOOKUP_INTERVAL;
-    while (Msg.getClock() < this.deadline) {
-      try {
-        if (comm == null) {
-          comm = Task.irecv(Integer.toString(id));
-        }
-        if (!comm.test()) {
-          if (Msg.getClock() >= nextLookupTime) {
-            randomLookup();
-            nextLookupTime += Common.RANDOM_LOOKUP_INTERVAL;
-          } else {
-            waitFor(1);
-          }
-        } else {
-          Task task = comm.getTask();
-          handleTask(task);
-          comm = null;
-        }
-      }
-      catch (Exception e) {
-        Msg.debug("Caught exception: " + e);
-      }
-    }
-    Msg.info(findNodeSuccedded + "/"  + (findNodeSuccedded + findNodeFailed) + " FIND_NODE have succeeded.");
-  }
-
-  /**
-   * @brief Try to make the node join the network
-   * @param idKnown Id of someone we know in the system
-   */
-  public boolean joinNetwork(int idKnown) {
-    boolean answerGot = false;
-    double timeBegin = Msg.getClock();
-    Msg.debug("Joining the network knowing " + idKnown);
-    //Add ourselves and the node we know to our routing table
-    table.update(this.id);
-    table.update(idKnown);
-    //Send a "FIND_NODE" to the node we know.
-    sendFindNode(idKnown,this.id);
-    //Wait for the answer.
-    int trials = 0;
-
-    do {
-      try {
-        if (comm == null) {
-          comm = Task.irecv(Integer.toString(id));
-        }
-        if (comm != null) {
-          if (!comm.test()) {
-            waitFor(1);
-          } else {
-            Task task = comm.getTask();
-            if (task instanceof FindNodeAnswerTask) {
-              //Retrieve the node list and ping them
-              FindNodeAnswerTask answerTask = (FindNodeAnswerTask)task;
-              Answer answer = answerTask.getAnswer();
-              answerGot = true;
-              if (answer.getDestinationId() == this.id) {
-                //Ping everyone in the list
-                for (Contact c : answer.getNodes()) {
-                  table.update(c.getId());
-                }
-              }
-            } else {
-              handleTask(task);
-            }
-            comm = null;
-          }
-        }
-      }
-      catch (Exception ex) {
-        trials++;
-        Msg.info("FIND_NODE failed");
-      }
-    } while (!answerGot && trials < Common.MAX_JOIN_TRIALS);
-    /* Second step: Send a FIND_NODE in a node in each bucket */
-    int bucketId = table.findBucket(idKnown).getId();
-    for (int i = 0; ((bucketId - i) > 0 ||
-       (bucketId + i) <= Common.IDENTIFIER_SIZE) &&
-       i < Common.JOIN_BUCKETS_QUERIES; i++) {
-      if (bucketId - i > 0) {
-        int idInBucket = table.getIdInPrefix(this.id,bucketId - i);
-        this.findNode(idInBucket,false);
-      }
-      if (bucketId + i <= Common.IDENTIFIER_SIZE) {
-        int idInBucket = table.getIdInPrefix(this.id,bucketId + i);
-        findNode(idInBucket,false);
-      }
-    }
-    Msg.debug("Time spent:" + (Msg.getClock() - timeBegin));
-    return answerGot;
-  }
-
-  /* Send a request to find a node in the node's routing table. */
-  public boolean findNode(int destination, boolean counts) {
-    int queries;
-    int answers;
-    int nodesAdded;
-    boolean destinationFound;
-    int steps = 0;
-    double timeBeginReceive;
-    double timeout;
-    double globalTimeout = Msg.getClock() + Common.FIND_NODE_GLOBAL_TIMEOUT;
-    //Build a list of the closest nodes we already know.
-    Answer nodeList = table.findClosest(destination);
-    Msg.verb("Doing a FIND_NODE on " + destination);
-    do {
-      timeBeginReceive = Msg.getClock();
-      answers = 0;
-      queries = this.sendFindNodeToBest(nodeList);
-      nodesAdded = 0;
-      timeout = Msg.getClock() + Common.FIND_NODE_TIMEOUT;
-      steps++;
-      do {
-        try {
-          if (comm == null) {
-            comm = Task.irecv(Integer.toString(id));
-          }
-          if (!comm.test()) {
-            waitFor(1);
-          } else {
-            Task task = comm.getTask();
-            if (task instanceof FindNodeAnswerTask) {
-              FindNodeAnswerTask answerTask = (FindNodeAnswerTask)task;
-              //Check if we received what we are looking for.
-              if (answerTask.getDestinationId() == destination) {
-                table.update(answerTask.getSenderId());
-                //Add the answer to our routing table
-                for (Contact c: answerTask.getAnswer().getNodes()) {
-                  table.update(c.getId());
-                }
-                answers++;
-
-                nodesAdded = nodeList.merge(answerTask.getAnswer());
-              } else {
-              /* If it's not our answer, we answer to the node that has queried us anyway */
-                handleTask(task);
-                //Update the timeout if it's not our answer.
-                timeout += Msg.getClock() - timeBeginReceive;
-                timeBeginReceive = Msg.getClock();
-              }
-            } else {
-              handleTask(task);
-              timeout += Msg.getClock() - timeBeginReceive;
-              timeBeginReceive = Msg.getClock();
-            }
-            comm = null;
-          }
-        }
-        catch (Exception e) {
-          comm = null;
-        }
-      } while (answers < queries && Msg.getClock() < timeout);
-      destinationFound = nodeList.destinationFound();
-    } while (!destinationFound && (nodesAdded > 0 || answers == 0) && Msg.getClock() < globalTimeout
-             && steps < Common.MAX_STEPS);
-
-    if (destinationFound) {
-      if (counts) {
-        findNodeSuccedded++;
-      }
-      Msg.debug("Find node on " + destination + " succeeded");
-    } else {
-      Msg.debug("Find node on " + destination + " failed");
-      Msg.debug("Queried " + queries + " nodes to find "  + destination);
-      Msg.debug(nodeList.toString());
-      if (counts) {
-        findNodeFailed++;
-      }
-    }
-    return destinationFound;
-  }
-
-  /**
-   * @brief Sends a "FIND_NODE" request (task) to a node we know.
-   * @param id Id of the node we are querying
-   * @param destination id of the node we are trying to find.
-   */
-  public void sendFindNode(int id, int destination) {
-    Msg.debug("Sending a FIND_NODE to " + Integer.toString(id) + " to find " + destination  );
-    FindNodeTask task = new FindNodeTask(this.id,destination);
-    task.dsend(Integer.toString(id));
-  }
-
-  /** Sends a "FIND_NODE" request to the best "alpha" nodes in a node list */
-  public int sendFindNodeToBest(Answer nodeList) {
-    int destination = nodeList.getDestinationId();
-    int i;
-    for (i = 0; i < Common.ALPHA && i < nodeList.size(); i++) {
-      Contact node = nodeList.getNodes().get(i);
-      if (node.getId() != this.id) {
-        this.sendFindNode(node.getId(),destination);
-      }
-    }
-    return i;
-  }
-
-  public void randomLookup() {
-    findNode(0,true);
-  }
-
-  /**
-   * @brief Handles an incoming task
-   * @param task The task we need to handle
-   */
-  public void handleTask(Task task) {
-    if (task instanceof KademliaTask) {
-      table.update(((KademliaTask) task).getSenderId());
-      if (task instanceof FindNodeTask) {
-        handleFindNode((FindNodeTask)task);
-      }
-    }
-  }
-
-  public void handleFindNode(FindNodeTask task) {
-    Msg.debug("Received a FIND_NODE from " + task.getSenderId());
-    Answer answer = table.findClosest(task.getDestination());
-    FindNodeAnswerTask taskToSend = new FindNodeAnswerTask(this.id,task.getDestination(),answer);
-    taskToSend.dsend(Integer.toString(task.getSenderId()));
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/RoutingTable.java b/examples/deprecated/java/dht/kademlia/RoutingTable.java
deleted file mode 100644 (file)
index 7978dc3..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package dht.kademlia;
-import java.util.ArrayList;
-import java.util.Collections;
-
-import org.simgrid.msg.Msg;
-
-public class RoutingTable {
-  /* Bucket list */
-  private ArrayList<Bucket> buckets;
-  /* Id of the routing table owner */
-  private int id;
-
-  public RoutingTable(int id) {
-    this.id = id;
-    buckets = new ArrayList<>();
-    for (int i = 0; i < Common.IDENTIFIER_SIZE + 1; i++) {
-      buckets.add(new Bucket(i));
-    }
-  }
-
-  /**
-   * @brief Returns an identifier which is in a specific bucket of a routing table
-   * @param id id of the routing table owner
-   * @param prefix id of the bucket where we want that identifier to be
-   */
-  public int getIdInPrefix(int id, int prefix) {
-    if (prefix == 0) {
-      return 0;
-    }
-    int identifier = 1;
-    identifier = identifier << (prefix - 1);
-    identifier = identifier ^ id;
-    return identifier;
-  }
-
-  /* Returns the corresponding node prefix for a given id */
-  public int getNodePrefix(int id) {
-    for (int j = 0; j < 32; j++) {
-      if ((id >> (32 - 1 - j) & 0x1) != 0) {
-        return 32 - j;
-      }
-    }
-    return 0;
-  }
-
-  /* Finds the corresponding bucket in a routing table for a given identifier */
-  public Bucket findBucket(int id) {
-    int xorNumber = id ^ this.id;
-    int prefix = this.getNodePrefix(xorNumber);
-    return buckets.get(prefix);
-  }
-
-  /* Updates the routing table with a new value. */
-  public void update(int id) {
-    Bucket bucket = this.findBucket(id);
-    if (bucket.contains(id)) {
-      Msg.debug("Updating " + Integer.toString(id) + " in my routing table");
-      //If the element is already in the bucket, we update it.
-      bucket.pushToFront(id);
-    } else {
-      Msg.debug("Adding " + id + " to my routing table");
-      bucket.add(id);
-      if (bucket.size() > Common.BUCKET_SIZE)  {
-        // TODO
-        Msg.debug("Should ping the least seen guy and remove him if he is offline.");
-      }
-    }
-  }
-
-  /* Returns the closest notes we know to a given id */
-  public Answer findClosest(int destinationId) {
-    Answer answer = new Answer(destinationId);
-    Bucket bucket = this.findBucket(destinationId);
-    bucket.addToAnswer(answer,destinationId);
-
-    for (int i = 1; answer.size() < Common.BUCKET_SIZE && ((bucket.getId() - i) >= 0 ||
-                                    (bucket.getId() + i) <= Common.IDENTIFIER_SIZE); i++) {
-      //Check the previous buckets
-      if (bucket.getId() - i >= 0) {
-        Bucket bucketP = this.buckets.get(bucket.getId() - i);
-        bucketP.addToAnswer(answer,destinationId);
-      }
-      //Check the next buckets
-      if (bucket.getId() + i <= Common.IDENTIFIER_SIZE) {
-        Bucket bucketN = this.buckets.get(bucket.getId() + i);
-        bucketN.addToAnswer(answer, destinationId);
-      }
-    }
-    //We sort the list
-    Collections.sort(answer.getNodes());
-    //We trim the list
-    answer.trim();
-
-    return answer;
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder string = new StringBuilder("RoutingTable [ id=" + id + " ");
-    for (int i = 0; i < buckets.size(); i++) {
-      if (buckets.get(i).size() > 0) {
-        string.append(buckets.get(i) + " ");
-      }
-    }
-    return string.toString();
-  }
-}
diff --git a/examples/deprecated/java/dht/kademlia/dht-kademlia.tesh b/examples/deprecated/java/dht/kademlia/dht-kademlia.tesh
deleted file mode 100644 (file)
index 8623d4b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-
-$ ${javacmd:=java} -classpath ${classpath:=.} dht/kademlia/Main ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/dht/kademlia/kademlia.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [900.000000] [java/INFO] Terminating the simulation...
-> [node-0.simgrid.org:dht.kademlia.Node:(1) 0.000000] [java/INFO] Hi, I'm going to create the network with the id 0!
-> [node-0.simgrid.org:dht.kademlia.Node:(1) 900.000000] [java/INFO] 8/8 FIND_NODE have succeeded.
-> [node-1.simgrid.org:dht.kademlia.Node:(2) 0.000000] [java/INFO] Hi, I'm going to join the network with the id 1!
-> [node-1.simgrid.org:dht.kademlia.Node:(2) 900.000000] [java/INFO] 8/8 FIND_NODE have succeeded.
-> [node-2.simgrid.org:dht.kademlia.Node:(3) 0.000000] [java/INFO] Hi, I'm going to join the network with the id 2!
-> [node-2.simgrid.org:dht.kademlia.Node:(3) 900.000000] [java/INFO] 8/8 FIND_NODE have succeeded.
-> [node-3.simgrid.org:dht.kademlia.Node:(4) 0.000000] [java/INFO] Hi, I'm going to join the network with the id 4!
-> [node-3.simgrid.org:dht.kademlia.Node:(4) 900.000000] [java/INFO] 8/8 FIND_NODE have succeeded.
diff --git a/examples/deprecated/java/dht/kademlia/kademlia.xml b/examples/deprecated/java/dht/kademlia/kademlia.xml
deleted file mode 100644 (file)
index 537afcb..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-
-  <actor host="node-0.simgrid.org" function="dht.kademlia.Node">
-    <argument value="0"/>        <!-- my id -->
-    <argument value ="900"/>     <!-- deadline -->
-  </actor>
-
-  <actor host="node-1.simgrid.org" function="dht.kademlia.Node">
-    <argument value="1"/>        <!-- my id -->
-    <argument value="0"/>        <!-- known id -->
-    <argument value ="900"/>     <!-- deadline -->
-  </actor>
-
-  <actor host="node-2.simgrid.org" function="dht.kademlia.Node">
-    <argument value="2"/>        <!-- my id -->
-    <argument value="0"/>        <!-- known id -->
-    <argument value ="900"/>     <!-- deadline -->
-  </actor>
-
-  <actor host="node-3.simgrid.org" function="dht.kademlia.Node">
-    <argument value="4"/>        <!-- my id -->
-    <argument value="0"/>        <!-- known id -->
-    <argument value ="900"/>     <!-- deadline -->
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/energy/consumption/EnergyConsumer.java b/examples/deprecated/java/energy/consumption/EnergyConsumer.java
deleted file mode 100644 (file)
index 0831816..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package energy.consumption;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.HostNotFoundException;
-
-public class EnergyConsumer extends Process {
-  public EnergyConsumer(String hostname, String name) throws HostNotFoundException {
-    super(hostname,name);
-  }
-
-  public void main(String[] args) throws MsgException {
-     Msg.info("Energetic profile: " + getHost().getProperty("wattage_per_state"));
-     Msg.info("Initial peak speed= " + getHost().getSpeed() + " flop/s; Energy dissipated = "
-              + getHost().getConsumedEnergy() + " J");
-
-     this.waitFor(10);
-     Msg.info("Currently consumed energy after sleeping 10 sec: "+getHost().getConsumedEnergy());
-     new Task(null, 1E9, 0).execute();
-     Msg.info("Currently consumed energy after executing 1E9 flops: "+getHost().getConsumedEnergy());
-  }
-}
diff --git a/examples/deprecated/java/energy/consumption/Main.java b/examples/deprecated/java/energy/consumption/Main.java
deleted file mode 100644 (file)
index cb6896a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package energy.consumption;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-
-public class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) throws MsgException {
-    Msg.energyInit();
-    Msg.init(args);
-
-    if (args.length < 1) {
-      Msg.info("Usage   : Energy platform_file");
-      Msg.info("Usage  : Energy ../platforms/energy_platform.xml");
-      System.exit(1);
-    }
-    /* Construct the platform */
-    Msg.createEnvironment(args[0]);
-    /* Instantiate a process */
-    new EnergyConsumer("MyHost1","energyConsumer").start();
-    /* Execute the simulation */
-    Msg.run();
-    Msg.info("Total simulation time: " + Msg.getClock());
-  }
-}
diff --git a/examples/deprecated/java/energy/consumption/energy-consumption.tesh b/examples/deprecated/java/energy/consumption/energy-consumption.tesh
deleted file mode 100644 (file)
index 8a28d5c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env tesh
-
-! timeout 15
-
-$ ${javacmd:=java} -classpath ${classpath:=.} energy/consumption/Main ${srcdir:=.}/../../platforms/energy_platform.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [MyHost1:energyConsumer:(1) 0.000000] [java/INFO] Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
-> [MyHost1:energyConsumer:(1) 0.000000] [java/INFO] Initial peak speed= 1.0E8 flop/s; Energy dissipated = 0.0 J
-> [MyHost1:energyConsumer:(1) 10.000000] [java/INFO] Currently consumed energy after sleeping 10 sec: 1000.0
-> [MyHost1:energyConsumer:(1) 20.000000] [java/INFO] Currently consumed energy after executing 1E9 flops: 2200.0
-> [20.000000] [host_energy/INFO] Total energy consumption: 6200.000000 Joules (used hosts: 2200.000000 Joules; unused/idle hosts: 4000.000000)
-> [20.000000] [java/INFO] Terminating the simulation...
-> [20.000000] [java/INFO] Total simulation time: 20.0
-> [20.000000] [host_energy/INFO] Energy consumption of host MyHost1: 2200.000000 Joules
-> [20.000000] [host_energy/INFO] Energy consumption of host MyHost2: 2000.000000 Joules
-> [20.000000] [host_energy/INFO] Energy consumption of host MyHost3: 2000.000000 Joules
-
diff --git a/examples/deprecated/java/energy/pstate/Main.java b/examples/deprecated/java/energy/pstate/Main.java
deleted file mode 100644 (file)
index 2f7e9ec..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package energy.pstate;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.energyInit();
-    Msg.init(args);
-
-    if (args.length < 1) {
-      Msg.info("Usage: Main ../platforms/energy_platform_file.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform */
-    Msg.createEnvironment(args[0]);
-
-    /* Create and start a runner for the experiment */
-    new PstateRunner(Host.all()[0],"pstate runner",null).start();
-
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/energy/pstate/PstateRunner.java b/examples/deprecated/java/energy/pstate/PstateRunner.java
deleted file mode 100644 (file)
index 13660e0..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package energy.pstate;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.TaskCancelledException;
-
-/* This class is a process in charge of running the test. It creates and starts the VMs, and fork processes within VMs */
-public class PstateRunner extends Process {
-
-       public class DVFS extends Process {
-               public  DVFS (Host host, String name) {
-                       super(host, name);
-               }
-
-               @Override
-               public void main(String[] strings) throws HostNotFoundException, HostFailureException, TaskCancelledException {
-                       double workload = 100E6;
-                       int newPstate = 2;
-                       Host host = getHost();
-
-                       int nb = host.getPstatesCount();
-                       Msg.info("Count of Processor states="+ nb);
-
-                       double currentPeak = host.getCurrentPowerPeak();
-                       Msg.info("Current power peak=" + currentPeak);
-
-                       // Run a task
-                       Task task1 = new Task("t1", workload, 0);
-                       task1.execute();
-
-                       double taskTime = Msg.getClock();
-                       Msg.info("Task1 simulation time: "+ taskTime);
-
-                       // Change power peak
-                       if ((newPstate >= nb) || (newPstate < 0)){
-                               Msg.info("Cannot set pstate "+newPstate+"%d, host supports only "+nb+" pstates.");
-                               return;
-                       }
-
-                       double peakAt = host.getPowerPeakAt(newPstate);
-                       Msg.info("Changing power peak value to "+peakAt+" (at index "+newPstate+")");
-
-                       host.setPstate(newPstate);
-
-                       currentPeak = host.getCurrentPowerPeak();
-                       Msg.info("Current power peak="+ currentPeak);
-
-                       // Run a second task
-                       new Task("t1", workload, 0).execute();
-
-                       taskTime = Msg.getClock() - taskTime;
-                       Msg.info("Task2 simulation time: "+ taskTime);
-
-                       // Verify the default pstate is set to 0
-                       host = Host.getByName("MyHost2");
-                       int nb2 = host.getPstatesCount();
-                       Msg.info("Count of Processor states="+ nb2);
-
-                       double currentPeak2 = host.getCurrentPowerPeak();
-                       Msg.info("Current power peak=" + currentPeak2);
-               }
-       }
-
-       PstateRunner(Host host, String name, String[] args) {
-               super(host, name, args);
-       }
-
-       @Override
-       public void main(String[] strings) throws HostNotFoundException, HostFailureException {
-
-           new DVFS (Host.getByName("MyHost1"), "dvfs_test").start();
-           new DVFS (Host.getByName("MyHost2"), "dvfs_test").start();
-
-       }
-}
diff --git a/examples/deprecated/java/energy/pstate/energy-pstate.tesh b/examples/deprecated/java/energy/pstate/energy-pstate.tesh
deleted file mode 100644 (file)
index 030984b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} energy/pstate/Main ${srcdir:=.}/../../platforms/energy_platform.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [MyHost1:dvfs_test:(2) 0.000000] [java/INFO] Count of Processor states=3
-> [MyHost1:dvfs_test:(2) 0.000000] [java/INFO] Current power peak=1.0E8
-> [MyHost2:dvfs_test:(3) 0.000000] [java/INFO] Count of Processor states=3
-> [MyHost2:dvfs_test:(3) 0.000000] [java/INFO] Current power peak=1.0E8
-> [MyHost1:dvfs_test:(2) 1.000000] [java/INFO] Task1 simulation time: 1.0
-> [MyHost1:dvfs_test:(2) 1.000000] [java/INFO] Changing power peak value to 2.0E7 (at index 2)
-> [MyHost1:dvfs_test:(2) 1.000000] [java/INFO] Current power peak=2.0E7
-> [MyHost2:dvfs_test:(3) 1.000000] [java/INFO] Task1 simulation time: 1.0
-> [MyHost2:dvfs_test:(3) 1.000000] [java/INFO] Changing power peak value to 2.0E7 (at index 2)
-> [MyHost2:dvfs_test:(3) 1.000000] [java/INFO] Current power peak=2.0E7
-> [MyHost1:dvfs_test:(2) 6.000000] [java/INFO] Task2 simulation time: 5.0
-> [MyHost1:dvfs_test:(2) 6.000000] [java/INFO] Count of Processor states=3
-> [MyHost1:dvfs_test:(2) 6.000000] [java/INFO] Current power peak=2.0E7
-> [MyHost2:dvfs_test:(3) 6.000000] [java/INFO] Task2 simulation time: 5.0
-> [MyHost2:dvfs_test:(3) 6.000000] [java/INFO] Count of Processor states=3
-> [MyHost2:dvfs_test:(3) 6.000000] [java/INFO] Current power peak=2.0E7
-> [6.000000] [host_energy/INFO] Total energy consumption: 2195.000000 Joules (used hosts: 1595.000000 Joules; unused/idle hosts: 600.000000)
-> [6.000000] [java/INFO] Terminating the simulation...
-> [6.000000] [host_energy/INFO] Energy consumption of host MyHost1: 645.000000 Joules
-> [6.000000] [host_energy/INFO] Energy consumption of host MyHost2: 950.000000 Joules
-> [6.000000] [host_energy/INFO] Energy consumption of host MyHost3: 600.000000 Joules
diff --git a/examples/deprecated/java/energy/vm/EnergyVMRunner.java b/examples/deprecated/java/energy/vm/EnergyVMRunner.java
deleted file mode 100644 (file)
index 9372f9b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package energy.vm;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.TaskCancelledException;
-import org.simgrid.msg.VM;
-
-/* This class is a process in charge of running the test. It creates and starts the VMs, and fork processes within VMs */
-public class EnergyVMRunner extends Process {
-
-  public class DummyProcess extends Process {
-    public  DummyProcess (Host host, String name) {
-      super(host, name);
-    }
-
-    @Override
-    public void main(String[] strings) {
-      Task  task = new Task(this.getHost().getName()+"-task", 300E6 , 0);
-      try {
-        task.execute();
-      } catch (HostFailureException | TaskCancelledException e) {
-        Msg.error(e.getMessage());
-        e.printStackTrace();
-      }
-      Msg.info("This worker is done.");
-    }
-  }
-
-  EnergyVMRunner(Host host, String name, String[] args) {
-    super(host, name, args);
-  }
-
-  @Override
-  public void main(String[] strings) throws HostNotFoundException, HostFailureException {
-    /* get hosts */
-    Host host1 = Host.getByName("MyHost1");
-    Host host2 = Host.getByName("MyHost2");
-    Host host3 = Host.getByName("MyHost3");
-
-    Msg.info("Creating and starting two VMs");
-    VM vmHost1 = new VM(host1, "vmHost1");
-    vmHost1.start();
-
-    VM vmHost2 = new VM(host2, "vmHost3");
-    vmHost2.start();
-
-    Msg.info("Create two tasks on Host1: one inside a VM, the other directly on the host");
-    new DummyProcess (vmHost1, "p11").start();
-    new DummyProcess (vmHost1, "p12").start();
-
-    Msg.info("Create two tasks on Host2: both directly on the host");
-    new DummyProcess (vmHost2, "p21").start();
-    new DummyProcess (host2, "p22").start();
-
-    Msg.info("Create two tasks on Host3: both inside a VM");
-    new DummyProcess (host3, "p31").start();
-    new DummyProcess (host3, "p312").start();
-
-    Msg.info("Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, "
-             + "so they run for 6 seconds)");
-    waitFor(5);
-    Msg.info("Wait another 5 seconds. The tasks stop at some point in between");
-    waitFor(5);
-
-    vmHost1.destroy();
-    vmHost2.destroy();
-  }
-}
diff --git a/examples/deprecated/java/energy/vm/Main.java b/examples/deprecated/java/energy/vm/Main.java
deleted file mode 100644 (file)
index 017f7bd..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package energy.vm;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-
-class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.energyInit();
-    Msg.init(args);
-
-    if (args.length < 1) {
-      Msg.info("Usage: Main ../platforms/energy_platform_file.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform */
-    Msg.createEnvironment(args[0]);
-
-    /* Create and start a runner for the experiment */
-    new EnergyVMRunner(Host.all()[0],"energy VM runner",null).start();
-
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/energy/vm/energy-vm.tesh b/examples/deprecated/java/energy/vm/energy-vm.tesh
deleted file mode 100644 (file)
index 205d380..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} energy/vm/Main ${srcdir:=.}/../../platforms/energy_platform.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Creating and starting two VMs
-> [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Create two tasks on Host1: one inside a VM, the other directly on the host
-> [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Create two tasks on Host2: both directly on the host
-> [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Create two tasks on Host3: both inside a VM
-> [MyHost1:energy VM runner:(1) 0.000000] [java/INFO] Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, so they run for 6 seconds)
-> [MyHost1:energy VM runner:(1) 5.000000] [java/INFO] Wait another 5 seconds. The tasks stop at some point in between
-> [MyHost2:p22:(5) 6.000000] [java/INFO] This worker is done.
-> [MyHost3:p312:(7) 6.000000] [java/INFO] This worker is done.
-> [MyHost3:p31:(6) 6.000000] [java/INFO] This worker is done.
-> [vmHost1:p12:(3) 6.000000] [java/INFO] This worker is done.
-> [vmHost1:p11:(2) 6.000000] [java/INFO] This worker is done.
-> [vmHost3:p21:(4) 6.000000] [java/INFO] This worker is done.
-> [10.000000] [host_energy/INFO] Total energy consumption: 4320.000000 Joules (used hosts: 4320.000000 Joules; unused/idle hosts: 0.000000)
-> [10.000000] [java/INFO] Terminating the simulation...
-> [10.000000] [host_energy/INFO] Energy consumption of host MyHost1: 1120.000000 Joules
-> [10.000000] [host_energy/INFO] Energy consumption of host MyHost2: 1600.000000 Joules
-> [10.000000] [host_energy/INFO] Energy consumption of host MyHost3: 1600.000000 Joules
diff --git a/examples/deprecated/java/hostload/LoadRunner.java b/examples/deprecated/java/hostload/LoadRunner.java
deleted file mode 100644 (file)
index 6331281..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package hostload;
-
-import org.simgrid.msg.*;
-import org.simgrid.msg.Process;
-
-
-public class LoadRunner extends Process {
-
-    public LoadRunner(Host host, String s) {
-        super(host, s);
-    }
-
-    public void display(){
-        Msg.info("Speed="+getHost().getSpeed()+" flop/s");
-        Msg.info("Computed Flops "+            getHost().getComputedFlops());
-        Msg.info("AvgLoad "+           getHost().getAvgLoad());
-    }
-    @Override
-    public void main(String[] strings) throws MsgException {
-        display();
-        Msg.info("Sleep for 10 seconds");
-        waitFor(10);
-        display();
-
-        // Run a task
-        Task task1 = new Task("t1", 200E6, 0);
-        task1.execute();
-        display();
-        double taskTime = Msg.getClock();
-        Msg.info("Task1 simulation time: "+ taskTime);
-
-        // Run a second task
-        new Task("t1", 200E6, 0).execute();
-
-        taskTime = Msg.getClock() - taskTime;
-        Msg.info("Task2 simulation time: "+ taskTime);
-        display();
-
-    }
-
-
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/hostload/Main.java b/examples/deprecated/java/hostload/Main.java
deleted file mode 100644 (file)
index 0991ccc..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package hostload;
-
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-
-public class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.loadInit();
-    Msg.init(args);
-
-    if (args.length < 1) {
-      Msg.info("Usage   : Load platform_file");
-      Msg.info("Usage  : Load ../platforms/small_platform.xml");
-      System.exit(1);
-    }
-    /* Construct the platform */
-    Msg.createEnvironment(args[0]);
-    new LoadRunner(Host.all()[0], "").start();
-
-    Msg.run();
-
-  }
-}
diff --git a/examples/deprecated/java/hostload/hostload.tesh b/examples/deprecated/java/hostload/hostload.tesh
deleted file mode 100644 (file)
index 35d98dc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} hostload/Main ${srcdir:=.}/../../platforms/small_platform.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [Boivin::(1) 0.000000] [java/INFO] Speed=9.8095E7 flop/s
-> [Boivin::(1) 0.000000] [java/INFO] Computed Flops 0.0
-> [Boivin::(1) 0.000000] [java/INFO] AvgLoad 0.0
-> [Boivin::(1) 0.000000] [java/INFO] Sleep for 10 seconds
-> [Boivin::(1) 10.000000] [java/INFO] Speed=9.8095E7 flop/s
-> [Boivin::(1) 10.000000] [java/INFO] Computed Flops 0.0
-> [Boivin::(1) 10.000000] [java/INFO] AvgLoad 0.0
-> [Boivin::(1) 12.038840] [java/INFO] Speed=9.8095E7 flop/s
-> [Boivin::(1) 12.038840] [java/INFO] Computed Flops 2.0E8
-> [Boivin::(1) 12.038840] [java/INFO] AvgLoad 0.1693551801515729
-> [Boivin::(1) 12.038840] [java/INFO] Task1 simulation time: 12.038839900096844
-> [Boivin::(1) 14.077680] [java/INFO] Task2 simulation time: 2.0388399000968445
-> [Boivin::(1) 14.077680] [java/INFO] Speed=9.8095E7 flop/s
-> [Boivin::(1) 14.077680] [java/INFO] Computed Flops 4.0E8
-> [Boivin::(1) 14.077680] [java/INFO] AvgLoad 0.2896556718201238
-> [14.077680] [java/INFO] Terminating the simulation...
\ No newline at end of file
diff --git a/examples/deprecated/java/process/kill/Killer.java b/examples/deprecated/java/process/kill/Killer.java
deleted file mode 100644 (file)
index e0a7b8a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.kill;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.HostNotFoundException;
-
-public class Killer extends Process {
-  public Killer(String hostname, String name) throws HostNotFoundException {
-    super(hostname, name);
-  }
-  public void main(String[] args) throws MsgException {
-    Victim poorVictim = null;
-    Msg.info("Hello!");
-    try {
-      poorVictim = new Victim("Boivin","victim");
-      poorVictim.start();
-    } catch (MsgException e){
-      e.printStackTrace();
-      Msg.error("Cannot create the victim process!");
-      return;
-    }
-    sleep(10000);
-    Msg.info("Resume Process");
-    poorVictim.resume();
-    sleep(1000);
-    Msg.info("Kill Process");
-    poorVictim.kill();
-
-    Msg.info("Ok, goodbye now.");
-    // The actor can also commit a suicide with the following command
-    exit(); // This will forcefully stop the current actor
-    // Of course, it's not useful here at the end of the main function, but that's for the example (and to check that this still works in the automated tests)
-  }
-}
diff --git a/examples/deprecated/java/process/kill/Main.java b/examples/deprecated/java/process/kill/Main.java
deleted file mode 100644 (file)
index fcdc6f1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.kill;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-
-public class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    /* initialize the MSG simulation. Must be done before anything else (even logging). */
-    Msg.init(args);
-    Msg.createEnvironment(args[0]);
-
-    /* bypass deploymemt */
-    try {
-      Killer killer = new Killer("Jacquelin","killer");
-      killer.start();
-    } catch (MsgException e){
-      Msg.error("Create processes failed!");
-    }
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/process/kill/Victim.java b/examples/deprecated/java/process/kill/Victim.java
deleted file mode 100644 (file)
index 3a56744..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.kill;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.HostNotFoundException;
-
-public class Victim extends Process {
-  public Victim(String hostname, String name) throws HostNotFoundException {
-    super(hostname, name);
-  }
-  public void main(String[] args) throws MsgException{
-    Msg.info("Hello!");
-    Msg.info("Suspending myself");
-    suspend();
-    Msg.info("OK, OK. Let's work");
-    Task task = new Task("work", 1e9, 0);
-    task.execute();
-    Msg.info("Bye");
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/process/kill/process-kill.tesh b/examples/deprecated/java/process/kill/process-kill.tesh
deleted file mode 100644 (file)
index 3dfabcc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${javacmd:=java} -classpath ${classpath:=.} process/kill/Main ${srcdir:=.}/../../platforms/small_platform.xml --lof=no_loc
-> [0.000000] [java/INFO] Using regular java threads.
-> [Jacquelin:killer:(1) 0.000000] [java/INFO] Hello!
-> [Boivin:victim:(2) 0.000000] [java/INFO] Hello!
-> [Boivin:victim:(2) 0.000000] [java/INFO] Suspending myself
-> [Jacquelin:killer:(1) 10.000000] [java/INFO] Resume Process
-> [Boivin:victim:(2) 10.000000] [java/INFO] OK, OK. Let's work
-> [Jacquelin:killer:(1) 11.000000] [java/INFO] Kill Process
-> [Jacquelin:killer:(1) 11.000000] [java/INFO] Ok, goodbye now.
-> [11.000000] [java/INFO] Terminating the simulation...
diff --git a/examples/deprecated/java/process/migration/Emigrant.java b/examples/deprecated/java/process/migration/Emigrant.java
deleted file mode 100644 (file)
index 80e3733..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.migration;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.HostNotFoundException;
-
-public class Emigrant extends Process {
-  public Emigrant(String hostname, String name) throws HostNotFoundException {
-    super(hostname, name);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Main.mutex.acquire();
-
-    Msg.info("I'll look for a new job on another machine where the grass is greener.");
-    migrate(Host.getByName("Boivin"));
-
-    Msg.info("Yeah, found something to do");
-    Task task = new Task("job", 98095000, 0);
-    task.execute();
-    waitFor(2);
-
-    Msg.info("Moving back to home after work");
-    migrate(Host.getByName("Jacquelin"));
-    migrate(Host.getByName("Boivin"));
-    waitFor(4);
-
-    Main.mutex.release();
-    suspend();
-
-    Msg.info("I've been moved on this new host:" + getHost().getName());
-    Msg.info("Uh, nothing to do here. Stopping now");
-  }
-}
diff --git a/examples/deprecated/java/process/migration/Main.java b/examples/deprecated/java/process/migration/Main.java
deleted file mode 100644 (file)
index d8d202b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.migration;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Mutex;
-import org.simgrid.msg.Process;
-
-class Main {
-  protected static Mutex mutex;
-  protected static Process processToMigrate = null;
-
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 1) {
-      Msg.info("Usage   : Migration platform_file");
-      Msg.info("example : Migration ../platforms/platform.xml");
-      System.exit(1);
-    }
-    /* Create the mutex */
-    mutex = new Mutex();
-
-    /* construct the platform*/
-    Msg.createEnvironment(args[0]);
-    /* bypass deploymemt */
-    try {
-        Policeman policeman = new Policeman("Boivin","policeman");
-        policeman.start();
-        Emigrant emigrant   = new Emigrant("Jacquelin","emigrant");
-        emigrant.start();
-        processToMigrate = emigrant;
-    } catch (HostNotFoundException e){
-      Msg.error("Create processes failed!");
-      e.printStackTrace();
-    }
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/process/migration/Policeman.java b/examples/deprecated/java/process/migration/Policeman.java
deleted file mode 100644 (file)
index 48ed741..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.migration;
-
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.HostNotFoundException;
-
-public class Policeman extends Process {
-  public Policeman(String hostname, String name) throws HostNotFoundException {
-    super(hostname, name);
-  }
-
-  public void main(String[] args) throws MsgException {
-    waitFor(1);
-
-    Msg.info("Wait a bit before migrating the emigrant.");
-
-    Main.mutex.acquire();
-
-    Main.processToMigrate.migrate(Host.getByName("Jacquelin"));
-    Msg.info("I moved the emigrant");
-    Main.processToMigrate.resume();
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/process/migration/process-migration.tesh b/examples/deprecated/java/process/migration/process-migration.tesh
deleted file mode 100644 (file)
index 849ea97..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-
-$ ${javacmd:=java} -classpath ${classpath:=.} process/migration/Main ${srcdir:=.}/../../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (2:emigrant@Jacquelin) I'll look for a new job on another machine where the grass is greener.
-> [  0.000000] (2:emigrant@Boivin) Yeah, found something to do
-> [  1.000000] (1:policeman@Boivin) Wait a bit before migrating the emigrant.
-> [  3.000000] (2:emigrant@Boivin) Moving back to home after work
-> [  7.000000] (0:maestro@) Terminating the simulation...
-> [  7.000000] (2:emigrant@Jacquelin) I've been moved on this new host:Jacquelin
-> [  7.000000] (2:emigrant@Jacquelin) Uh, nothing to do here. Stopping now
-> [  7.000000] (1:policeman@Boivin) I moved the emigrant
diff --git a/examples/deprecated/java/process/startkilltime/Main.java b/examples/deprecated/java/process/startkilltime/Main.java
deleted file mode 100644 (file)
index 2cc687a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.startkilltime;
-import org.simgrid.msg.Msg;
-
-public class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 2) {
-      Msg.info("Usage   : StartKilltime platform_file deployment_file");
-      Msg.info("example : StartKilltime ../platforms/platform.xml deployment_start_kill.xml");
-      System.exit(1);
-    }
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    Msg.deployApplication(args[1]);
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/process/startkilltime/Sleeper.java b/examples/deprecated/java/process/startkilltime/Sleeper.java
deleted file mode 100644 (file)
index 9989e39..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.startkilltime;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Sleeper extends Process {
-  public Sleeper(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Msg.info("Hello! I go to sleep.");
-    try {
-      waitFor(Integer.parseInt(args[0]));
-      Msg.info("Done sleeping");
-    } catch (MsgException e) {
-      Msg.debug("Wait cancelled.");
-    }
-  }
-}
diff --git a/examples/deprecated/java/process/startkilltime/process-startkilltime.tesh b/examples/deprecated/java/process/startkilltime/process-startkilltime.tesh
deleted file mode 100644 (file)
index d2fd7df..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env tesh
-$ ${javacmd:=java} -classpath ${classpath:=.} process/startkilltime/Main ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/process/startkilltime/startkilltime.xml
-> [0.000000] [java/INFO] Using regular java threads.
-> [node-0.simgrid.org:process.startkilltime.Sleeper:(1) 0.000000] [java/INFO] Hello! I go to sleep.
-> [node-1.simgrid.org:process.startkilltime.Sleeper:(2) 1.000000] [java/INFO] Hello! I go to sleep.
-> [node-2.simgrid.org:process.startkilltime.Sleeper:(3) 2.000000] [java/INFO] Hello! I go to sleep.
-> [node-3.simgrid.org:process.startkilltime.Sleeper:(4) 3.000000] [java/INFO] Hello! I go to sleep.
-> [node-4.simgrid.org:process.startkilltime.Sleeper:(5) 4.000000] [java/INFO] Hello! I go to sleep.
-> [node-5.simgrid.org:process.startkilltime.Sleeper:(6) 5.000000] [java/INFO] Hello! I go to sleep.
-> [node-2.simgrid.org:process.startkilltime.Sleeper:(3) 6.000000] [java/INFO] Done sleeping
-> [node-3.simgrid.org:process.startkilltime.Sleeper:(4) 7.000000] [java/INFO] Done sleeping
-> [10.000000] [java/INFO] Terminating the simulation...
diff --git a/examples/deprecated/java/process/startkilltime/startkilltime.xml b/examples/deprecated/java/process/startkilltime/startkilltime.xml
deleted file mode 100644 (file)
index 4c0e589..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <actor host="node-0.simgrid.org" function="process.startkilltime.Sleeper" start_time="0" kill_time="5">
-    <argument value="10"/>
-  </actor>
-  <actor host="node-1.simgrid.org" function="process.startkilltime.Sleeper" start_time="1" kill_time="6">
-    <argument value="10"/>
-  </actor>
-  <actor host="node-2.simgrid.org" function="process.startkilltime.Sleeper" start_time="2" kill_time="7">
-    <argument value="4" />
-  </actor>
-  <actor host="node-3.simgrid.org" function="process.startkilltime.Sleeper" start_time="3" kill_time="8">
-    <argument value="4" />
-  </actor>
-  <actor host="node-4.simgrid.org" function="process.startkilltime.Sleeper" start_time="4" kill_time="9">
-    <argument value="5" />
-  </actor>
-  <actor host="node-5.simgrid.org" function="process.startkilltime.Sleeper" start_time="5" kill_time="10">
-    <argument value="5"/>
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/process/suspend/DreamMaster.java b/examples/deprecated/java/process/suspend/DreamMaster.java
deleted file mode 100644 (file)
index 3283366..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.suspend;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.HostNotFoundException;
-
-public class DreamMaster extends Process {
-  public DreamMaster(String hostname, String name)  throws HostNotFoundException{
-    super(hostname,name);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Msg.info("Let's create a lazy guy.");
-    Process lazyGuy = new LazyGuy(getHost(),"Lazy",null);
-    lazyGuy.start();
-    Msg.info("Let's wait a little bit...");
-    waitFor(10);
-    Msg.info("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
-    lazyGuy.resume();
-    Msg.info("OK, goodbye now.");
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/process/suspend/LazyGuy.java b/examples/deprecated/java/process/suspend/LazyGuy.java
deleted file mode 100644 (file)
index c689db6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.suspend;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class LazyGuy extends Process {
-  public LazyGuy(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Msg.info("Nobody's watching me ? Let's go to sleep.");
-    suspend();
-    Msg.info("Uuuh ? Did somebody call me ?");
-    Msg.info("Mmmh, goodbye now.");
-  }
-}
\ No newline at end of file
diff --git a/examples/deprecated/java/process/suspend/Main.java b/examples/deprecated/java/process/suspend/Main.java
deleted file mode 100644 (file)
index b7057d5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package process.suspend;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-
-public class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 1) {
-      Msg.info("Usage   : Suspend platform_file");
-      Msg.info("example : Suspend ../platforms/platform.xml");
-      System.exit(1);
-    }
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    try {
-        DreamMaster process1 = new DreamMaster("Jacquelin","DreamMaster");
-        process1.start();
-    } catch (MsgException e){
-      Msg.error("Create processes failed!");
-    }
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/process/suspend/process-suspend.tesh b/examples/deprecated/java/process/suspend/process-suspend.tesh
deleted file mode 100644 (file)
index e24890a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-$ ${javacmd:=java} -classpath ${classpath:=.} process/suspend/Main ${srcdir:=.}/../../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:DreamMaster@Jacquelin) Let's create a lazy guy.
-> [  0.000000] (1:DreamMaster@Jacquelin) Let's wait a little bit...
-> [  0.000000] (2:Lazy@Jacquelin) Nobody's watching me ? Let's go to sleep.
-> [ 10.000000] (0:maestro@) Terminating the simulation...
-> [ 10.000000] (1:DreamMaster@Jacquelin) Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!
-> [ 10.000000] (1:DreamMaster@Jacquelin) OK, goodbye now.
-> [ 10.000000] (2:Lazy@Jacquelin) Uuuh ? Did somebody call me ?
-> [ 10.000000] (2:Lazy@Jacquelin) Mmmh, goodbye now.
diff --git a/examples/deprecated/java/task/priority/Main.java b/examples/deprecated/java/task/priority/Main.java
deleted file mode 100644 (file)
index 4c7c523..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package task.priority;
-import org.simgrid.msg.Msg;
-
-/* Demonstrates the use of Task.setPriority to change the computation priority of a task */
-public class Main {
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) {
-    Msg.init(args);
-    if(args.length < 2) {
-      Msg.info("Usage   : Priority platform_file deployment_file");
-      Msg.info("example : Priority ../platforms/small_platform.xml priority.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    Msg.deployApplication(args[1]);
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/task/priority/Test.java b/examples/deprecated/java/task/priority/Test.java
deleted file mode 100644 (file)
index 002cd16..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package task.priority;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-
-public class Test extends Process {
-  public Test(Host host, String name, String[]args) {
-    super(host,name,args);
-  }
-
-  public void main(String[] args) throws MsgException {
-    double computationAmount = Double.parseDouble(args[0]);
-    double priority = Double.parseDouble(args[1]);
-
-    Msg.info("Hello! Running a task of size " + computationAmount + " with priority " + priority);
-
-    Task task = new Task("Task", computationAmount, 0);
-    task.setPriority(priority);
-
-    task.execute();
-
-    Msg.info("Goodbye now!");
-  }
-}
diff --git a/examples/deprecated/java/task/priority/priority.xml b/examples/deprecated/java/task/priority/priority.xml
deleted file mode 100644 (file)
index 3349a60..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <actor host="Fafard" function="task.priority.Test">
-    <argument value="76296000"/>
-    <argument value="1.0"/>
-  </actor>
-  <actor host="Fafard" function="task.priority.Test">
-    <argument value="76296000"/>
-    <argument value="2.0"/>
-  </actor>
-</platform>
diff --git a/examples/deprecated/java/task/priority/task-priority.tesh b/examples/deprecated/java/task/priority/task-priority.tesh
deleted file mode 100644 (file)
index a457ff7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-
-$ ${javacmd:=java} -classpath ${classpath:=.} task/priority/Main ${srcdir:=.}/../../platforms/small_platform.xml ${srcdir:=.}/task/priority/priority.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:task.priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 1.0
-> [  0.000000] (2:task.priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 2.0
-> [  1.500000] (2:task.priority.Test@Fafard) Goodbye now!
-> [  2.000000] (0:maestro@) Terminating the simulation...
-> [  2.000000] (1:task.priority.Test@Fafard) Goodbye now!
diff --git a/examples/deprecated/java/trace/pingpong/Main.java b/examples/deprecated/java/trace/pingpong/Main.java
deleted file mode 100644 (file)
index 3ff3765..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package trace.pingpong;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.trace.Trace;
-
-public class Main  {
-  public static final String PM_STATE = "PM_STATE";
-
-  private Main() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) throws MsgException {
-    Msg.init(args);
-    if(args.length < 1) {
-      Msg.info("Usage   : Main platform_file");
-      Msg.info("example : Main ../platforms/platform.xml");
-      System.exit(1);
-    }
-
-    /* construct the platform and deploy the application */
-    Msg.createEnvironment(args[0]);
-    new Sender("Jacquelin", "Sender", new String[] {"Boivin", "Tremblay"}).start();
-    new Receiver ("Boivin", "Receiver", null).start();
-    new Receiver ("Tremblay", "Receiver", null).start();
-
-    /* Initialize some state for the hosts */
-    Trace.hostStateDeclare (PM_STATE);
-    Trace.hostStateDeclareValue (PM_STATE, "waitingPing", "0 0 1");
-    Trace.hostStateDeclareValue (PM_STATE, "sendingPong", "0 1 0");
-    Trace.hostStateDeclareValue (PM_STATE, "sendingPing", "0 1 1");
-    Trace.hostStateDeclareValue (PM_STATE, "waitingPong", "1 0 0");
-
-    /*  execute the simulation. */
-    Msg.run();
-  }
-}
diff --git a/examples/deprecated/java/trace/pingpong/PingPongTask.java b/examples/deprecated/java/trace/pingpong/PingPongTask.java
deleted file mode 100644 (file)
index 3732e72..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package trace.pingpong;
-import org.simgrid.msg.Task;
-
-public class PingPongTask extends Task {
-  private double timeVal;
-
-  public PingPongTask() {
-    this.timeVal = 0;
-  }
-
-  public PingPongTask(String name, double computeDuration, double messageSize) {
-    super(name,computeDuration,messageSize);
-  }
-
-  public void setTime(double timeVal){
-    this.timeVal = timeVal;
-  }
-
-  public double getTime() {
-    return this.timeVal;
-  }
-}
-
diff --git a/examples/deprecated/java/trace/pingpong/Receiver.java b/examples/deprecated/java/trace/pingpong/Receiver.java
deleted file mode 100644 (file)
index 167b200..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package trace.pingpong;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-import org.simgrid.trace.Trace;
-
-public class Receiver extends Process {
-  private static final double COMM_SIZE_LAT = 1;
-  private static final double COMM_SIZE_BW = 100000000;
-  private static final String PM_STATE = Main.PM_STATE;
-
-  public Receiver(String hostname, String name, String[]args) throws HostNotFoundException {
-    super(hostname,name,args);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Msg.info("hello!");
-    Trace.hostPushState (getHost().getName(), PM_STATE, "waitingPing");
-
-    /* Wait for the ping */
-    Msg.info("try to get a task");
-
-    PingPongTask ping = (PingPongTask)Task.receive(getHost().getName());
-    double timeGot = Msg.getClock();
-    double timeSent = ping.getTime();
-
-    Msg.info("Got at time "+ timeGot);
-    Msg.info("Was sent at time "+timeSent);
-    double time=timeSent;
-
-    double communicationTime=timeGot - time;
-    Msg.info("Communication time : " + communicationTime);
-
-    Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----");
-
-    /* Send the pong */
-    Trace.hostPushState (getHost().getName(), PM_STATE, "sendingPong");
-    double computeDuration = 0;
-    PingPongTask pong = new PingPongTask("no name",computeDuration,COMM_SIZE_LAT);
-    pong.setTime(time);
-    pong.send(ping.getSource().getName());
-
-    /* Pop the two states */
-    Trace.hostPopState (getHost().getName(), PM_STATE);
-    Trace.hostPopState (getHost().getName(), PM_STATE);
-
-    Msg.info("goodbye!");
-  }
-}
diff --git a/examples/deprecated/java/trace/pingpong/Sender.java b/examples/deprecated/java/trace/pingpong/Sender.java
deleted file mode 100644 (file)
index 3b0ca2a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package trace.pingpong;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-import org.simgrid.trace.Trace;
-
-public class Sender extends Process {
-  private static final double COMM_SIZE_LAT = 1;
-  private static final double COMM_SIZE_BW = 100000000;
-  private static final String PM_STATE = Main.PM_STATE;
-
-  public Sender(String hostname, String name, String[] args) throws HostNotFoundException {
-    super(hostname,name,args);
-  }
-
-  public void main(String[] args) throws MsgException {
-    Msg.info("hello !");
-    Trace.hostPushState (getHost().getName(), PM_STATE, "sendingPing");
-
-    int hostCount = args.length;
-    Msg.info("host count: " + hostCount);
-    String[] mailboxes = new String[hostCount];
-    double time;
-    double computeDuration = 0;
-    PingPongTask ping;
-
-    for(int pos = 0; pos < args.length ; pos++) {
-      mailboxes[pos] = Host.getByName(args[pos]).getName();
-    }
-
-    for (int pos = 0; pos < hostCount; pos++) {
-      time = Msg.getClock();
-      Msg.info("sender time: " + time);
-      ping = new PingPongTask("no name",computeDuration,COMM_SIZE_LAT);
-      ping.setTime(time);
-      ping.send(mailboxes[pos]);
-
-      Trace.hostPushState (getHost().getName(), PM_STATE, "waitingPong");
-      Task.receive(getHost().getName());
-      double timeGot = Msg.getClock();
-      double timeSent = ping.getTime();
-      double communicationTime;
-
-      Msg.info("Got at time "+ timeGot);
-      Msg.info("Was sent at time "+timeSent);
-      time = timeSent;
-
-      communicationTime=timeGot - time;
-      Msg.info("Communication time : " + communicationTime);
-
-      Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----");
-
-      /* Pop the last state (going back to sending ping) */
-      Trace.hostPopState (getHost().getName(), PM_STATE);
-    }
-
-    /* Pop the sendingPong state */
-    Trace.hostPopState (getHost().getName(), PM_STATE);
-    Msg.info("goodbye!");
-  }
-}
diff --git a/examples/deprecated/java/trace/pingpong/trace-pingpong.tesh b/examples/deprecated/java/trace/pingpong/trace-pingpong.tesh
deleted file mode 100644 (file)
index 62c1e0f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env tesh
-
-! output sort 19
-
-$ ${javacmd:=java} -classpath ${classpath:=.} trace/pingpong/Main ${srcdir:=.}/../../platforms/small_platform.xml --cfg=tracing:yes  --cfg=tracing/filename:simulation.trace --cfg=tracing/platform:yes
-> [0.000000] [java/INFO] Using regular java threads.
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'simulation.trace'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/platform' to 'yes'
-> [3.817809] [java/INFO] Terminating the simulation...
-> [Boivin:Receiver:(2) 0.000000] [java/INFO] hello!
-> [Boivin:Receiver:(2) 0.000000] [java/INFO] try to get a task
-> [Boivin:Receiver:(2) 1.048882] [java/INFO] Got at time 1.0488818628325232
-> [Boivin:Receiver:(2) 1.048882] [java/INFO] Was sent at time 0.0
-> [Boivin:Receiver:(2) 1.048882] [java/INFO] Communication time : 1.0488818628325232
-> [Boivin:Receiver:(2) 1.048882] [java/INFO]  --- bw 9.533962169004269E7 ----
-> [Boivin:Receiver:(2) 2.097764] [java/INFO] goodbye!
-> [Jacquelin:Sender:(1) 0.000000] [java/INFO] hello !
-> [Jacquelin:Sender:(1) 0.000000] [java/INFO] host count: 2
-> [Jacquelin:Sender:(1) 0.000000] [java/INFO] sender time: 0.0
-> [Jacquelin:Sender:(1) 2.097764] [java/INFO] Got at time 2.0977637256650463
-> [Jacquelin:Sender:(1) 2.097764] [java/INFO] Was sent at time 0.0
-> [Jacquelin:Sender:(1) 2.097764] [java/INFO] Communication time : 2.0977637256650463
-> [Jacquelin:Sender:(1) 2.097764] [java/INFO]  --- bw 4.7669810845021345E7 ----
-> [Jacquelin:Sender:(1) 2.097764] [java/INFO] sender time: 2.0977637256650463
-> [Jacquelin:Sender:(1) 3.817809] [java/INFO] Got at time 3.8178087458100927
-> [Jacquelin:Sender:(1) 3.817809] [java/INFO] Was sent at time 2.0977637256650463
-> [Jacquelin:Sender:(1) 3.817809] [java/INFO] Communication time : 1.7200450201450463
-> [Jacquelin:Sender:(1) 3.817809] [java/INFO]  --- bw 5.813801315012516E7 ----
-> [Jacquelin:Sender:(1) 3.817809] [java/INFO] goodbye!
-> [Tremblay:Receiver:(3) 0.000000] [java/INFO] hello!
-> [Tremblay:Receiver:(3) 0.000000] [java/INFO] try to get a task
-> [Tremblay:Receiver:(3) 2.957786] [java/INFO] Got at time 2.9577862357375695
-> [Tremblay:Receiver:(3) 2.957786] [java/INFO] Was sent at time 2.0977637256650463
-> [Tremblay:Receiver:(3) 2.957786] [java/INFO] Communication time : 0.8600225100725232
-> [Tremblay:Receiver:(3) 2.957786] [java/INFO]  --- bw 1.1627602630025032E8 ----
-> [Tremblay:Receiver:(3) 3.817809] [java/INFO] goodbye!
-
-$ rm -rf simulation.trace
index 4ff7f67..af145db 100644 (file)
@@ -47,7 +47,6 @@ extern "C" {
 #endif
 
 /** @brief Return code of most MSG functions */
-/* Keep these code as binary values: java bindings manipulate | of these values */
 typedef enum {
   MSG_OK               = 0, /**< @brief Everything is right. Keep on going this way ! */
   MSG_TIMEOUT          = 1, /**< @brief nothing good happened before the timer you provided elapsed */
index d9f7f22..d5ad57b 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,6 @@ class CMakeBuild(build_ext):
         cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
                       '-DPYTHON_EXECUTABLE=' + sys.executable,
                       '-Denable_smpi=OFF',
-                      '-Denable_java=OFF',
                       '-Denable_python=ON',
                       '-Dminimal-bindings=ON',
                       '-Dpybind11_DIR=' + get_cmake_dir()
@@ -105,7 +104,6 @@ setup(
         "Programming Language :: C++",
         "Programming Language :: C",
         "Programming Language :: Fortran",
-        "Programming Language :: Java",
         "Topic :: System :: Distributed Computing",
         "Topic :: System :: Systems Administration",
     ],
index 7cb6fda..41b560a 100644 (file)
@@ -14,37 +14,7 @@ sonar.sources=src,examples,include,teshsuite
 
 
 # Disable some rules on some files
-sonar.issue.ignore.multicriteria=j1,j2,j3,j4,jni1,jni2,c1,c2a,c2b,c3,c5a,c5b,c6a,c6b,c7,c8,c9,c10a,c10b,c10c,cex1a,cex1b,cex2a,cex2b,cex3,cex4,cxx17a,cxx17b,cxx17c,cxx17d,cxx17e,cxx17f,f1,p1,s1,s2,s3,s4,s5
-
-# The Object.finalize() method should not be overridden
-# But we need to clean the native memory with JNI
-sonar.issue.ignore.multicriteria.j1.ruleKey=java:S1113
-sonar.issue.ignore.multicriteria.j1.resourceKey=**/*.java
-
-# Throwable.printStackTrace(...) should not be called
-# But we don't have no better mechanism, and our Java apps are not rocket science
-sonar.issue.ignore.multicriteria.j2.ruleKey=java:S1148
-sonar.issue.ignore.multicriteria.j2.resourceKey=**/*.java
-
-# Using command line arguments is security-sensitive
-# But the authors of the applications using our library will be their only users, so there is no security concern
-sonar.issue.ignore.multicriteria.j3.ruleKey=java:S4823
-sonar.issue.ignore.multicriteria.j3.resourceKey=**/*.java
-
-# Standard outputs should not be used directly to log anything
-# But this file is used before SimGrid is initialized
-sonar.issue.ignore.multicriteria.j4.ruleKey=java:S106
-sonar.issue.ignore.multicriteria.j4.resourceKey=src/bindings/java/org/simgrid/NativeLib.java
-
-# "reinterpret_cast" should not be used
-# But this is exactly intended to store a pointer into a long -- what we do here
-sonar.issue.ignore.multicriteria.jni1.ruleKey=cpp:S3630
-sonar.issue.ignore.multicriteria.jni1.resourceKey=src/bindings/java/*.cpp
-
-# Unused function parameters should be removed
-# But JNI mandates these parameters
-sonar.issue.ignore.multicriteria.jni2.ruleKey=cpp:S1172
-sonar.issue.ignore.multicriteria.jni2.resourceKey=src/bindings/java/*.cpp
+sonar.issue.ignore.multicriteria=c1,c2a,c2b,c3,c5a,c5b,c6a,c6b,c7,c8,c9,c10a,c10b,c10c,cex1a,cex1b,cex2a,cex2b,cex3,cex4,cxx17a,cxx17b,cxx17c,cxx17d,cxx17e,cxx17f,f1,p1,s1,s2,s3,s4,s5
 
 # Pointers should not be cast to integral types
 # But we need that for jMSG, smpi and other places
@@ -206,17 +176,13 @@ sonar.cfamily.gcov.reportsPath=Testing/CoverageInfo
 #   - examples in smpi/mc (coverage doesn't work with model checker)
 #   - XML files
 #   - Python files used to generate either simcalls or deployment files
-#   - Any java source code (it's deprecated now)
 #   - MSG (deprecated too)
-sonar.coverage.exclusions=teshsuite/smpi/mpich3-test/**,teshsuite/smpi/MBI/**,examples/smpi/mc/**,**/*.xml,**/generate.py,**/*.java,src/bindings/java/**,src/msg/**,include/msg/**,examples/deprecated/**,teshsuite/msg/**
+sonar.coverage.exclusions=teshsuite/smpi/mpich3-test/**,teshsuite/smpi/MBI/**,examples/smpi/mc/**,**/*.xml,**/generate.py,src/msg/**,include/msg/**,examples/deprecated/**,teshsuite/msg/**
 
 # Encoding of the source files
 sonar.sourceEncoding=UTF-8
 
 # Version of the used prog languages
-sonar.java.source=8
-sonar.java.binaries=CMakeFiles/simgrid-java_jar.dir,examples/deprecated/java
-sonar.java.libraries=
 sonar.python.version=3
 
 ### NOTE: the following properties are overridden by Jenkins configuration
diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp
deleted file mode 100644 (file)
index 1249ad0..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Context switching within the JVM.                                        */
-
-/* Copyright (c) 2009-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "JavaContext.hpp"
-#include "jxbt_utilities.hpp"
-#include "simgrid/Exception.hpp"
-#include "src/kernel/actor/ActorImpl.hpp"
-
-#include <functional>
-#include <utility>
-
-extern JavaVM* __java_vm;
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(java, "MSG for Java(TM)");
-
-namespace simgrid::kernel::context {
-
-JavaContextFactory::JavaContextFactory() : ContextFactory()
-{
-  xbt_assert(xbt::binary_name == "java");
-}
-
-JavaContextFactory::~JavaContextFactory()=default;
-
-Context* JavaContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor)
-{
-  return this->new_context<JavaContext>(std::move(code), actor);
-}
-
-void JavaContextFactory::run_all(std::vector<actor::ActorImpl*> const& actors)
-{
-  SerialThreadContext::run_all(actors);
-}
-
-JavaContext::JavaContext(std::function<void()>&& code, actor::ActorImpl* actor)
-    : SerialThreadContext(std::move(code), actor, false /* not maestro */)
-{
-  /* ThreadContext already does all we need */
-}
-
-void JavaContext::start_hook()
-{
-  Context::set_current(this); // We need to attach it also for maestro, in contrary to our ancestor
-
-  //Attach the thread to the JVM
-  JNIEnv *env;
-  xbt_assert(__java_vm->AttachCurrentThread((void**)&env, nullptr) == JNI_OK,
-             "The thread could not be attached to the JVM");
-  this->jenv_ = env;
-}
-
-void JavaContext::stop()
-{
-  this->get_actor()->cleanup_from_self();
-
-  /* Unregister the thread from the JVM */
-  JNIEnv* env = this->jenv_;
-  env->DeleteGlobalRef(this->jprocess_);
-  jint error = __java_vm->DetachCurrentThread();
-  if (error != JNI_OK) {
-    /* This is probably a Java thread, ie an actor not created from the XML (and thus from the C++),
-     * but from Java with something like new Process().start().
-     *
-     * We should not even try to detach such threads. Instead, we throw a Java exception that will raise up
-     * until run_jprocess(), IIUC.
-     */
-    jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
-    XBT_DEBUG("Cannot detach the current thread");
-  }
-
-  simgrid::ForcefulKillException::do_throw(); // clean RAII variables with the dedicated exception
-}
-
-} // namespace simgrid::kernel::context
diff --git a/src/bindings/java/JavaContext.hpp b/src/bindings/java/JavaContext.hpp
deleted file mode 100644 (file)
index 83dc9e1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Context switching within the JVM.                                        */
-
-/* Copyright (c) 2009-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_JAVA_JAVA_CONTEXT_HPP
-#define SIMGRID_JAVA_JAVA_CONTEXT_HPP
-
-#include <functional>
-#include <jni.h>
-
-#include "src/kernel/context/ContextThread.hpp"
-
-#include "jmsg.hpp"
-
-namespace simgrid::kernel::context {
-
-class JavaContext;
-class JavacontextFactory;
-
-class JavaContext : public SerialThreadContext {
-public:
-  // The java process instance bound with the msg process structure:
-  jobject jprocess_ = nullptr;
-  // JNI interface pointer associated to this thread:
-  JNIEnv* jenv_           = nullptr;
-
-  friend class JavaContextFactory;
-  JavaContext(std::function<void()>&& code, actor::ActorImpl* actor);
-
-  void start_hook() override;
-  void stop() override;
-};
-
-class JavaContextFactory : public ContextFactory {
-public:
-  JavaContextFactory();
-  ~JavaContextFactory() override;
-  Context* create_context(std::function<void()>&& code, actor::ActorImpl* actor) override;
-  void run_all(std::vector<actor::ActorImpl*> const& actors) override;
-};
-
-XBT_PRIVATE void java_main_jprocess(jobject process);
-
-} // namespace simgrid::kernel::context
-
-#endif /* SIMGRID_JAVA_JAVA_CONTEXT_HPP */
diff --git a/src/bindings/java/MANIFEST.in b/src/bindings/java/MANIFEST.in
deleted file mode 100644 (file)
index bb1ca2b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Built-By: Da SimGrid team
-Main-Class: org.simgrid.msg.Msg
-Class-Path: .
diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp
deleted file mode 100644 (file)
index 9b60f4e..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <algorithm>
-#include <clocale>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "simgrid/Exception.hpp"
-#include "simgrid/plugins/energy.h"
-#include "simgrid/plugins/file_system.h"
-#include "simgrid/plugins/live_migration.h"
-#include "simgrid/plugins/load.h"
-
-#include "simgrid/s4u/Actor.hpp"
-#include "simgrid/s4u/Host.hpp"
-
-#include "jmsg.hpp"
-#include "jmsg_as.hpp"
-#include "jmsg_host.h"
-#include "jmsg_process.h"
-#include "jmsg_task.h"
-#include "jxbt_utilities.hpp"
-
-#include "JavaContext.hpp"
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-int JAVA_HOST_LEVEL = -1;
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-JavaVM *__java_vm = nullptr;
-
-JNIEnv *get_current_thread_env()
-{
-  using simgrid::kernel::context::JavaContext;
-  const JavaContext* ctx = static_cast<JavaContext*>(simgrid::kernel::context::Context::self());
-  if (ctx)
-    return ctx->jenv_;
-  else
-    return nullptr;
-}
-
-void jmsg_throw_status(JNIEnv *env, msg_error_t status) {
-  switch (status) {
-    case MSG_TIMEOUT:
-      jxbt_throw_time_out_failure(env, "");
-      break;
-    case MSG_TRANSFER_FAILURE:
-      jxbt_throw_transfer_failure(env, "");
-      break;
-    case MSG_HOST_FAILURE:
-      jxbt_throw_host_failure(env, "");
-      break;
-    case MSG_TASK_CANCELED:
-      jxbt_throw_task_cancelled(env, "");
-      break;
-    default:
-      xbt_die("undefined message failed (please see jmsg_throw_status function in jmsg.cpp)");
-  }
-}
-
-/***************************************************************************************
- * Unsortable functions                                                        *
- ***************************************************************************************/
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv*, jclass)
-{
-  return (jdouble)simgrid_get_clock();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass, jobjectArray jargs)
-{
-  env->GetJavaVM(&__java_vm);
-
-  simgrid::kernel::context::ContextFactory::initializer = []() {
-    XBT_INFO("Using regular java threads.");
-    return new simgrid::kernel::context::JavaContextFactory();
-  };
-  const _jthrowable* exc                        = env->ExceptionOccurred();
-  if (exc) {
-    env->ExceptionClear();
-  }
-
-  setlocale(LC_NUMERIC,"C");
-
-  int argc = 1;
-  if (jargs)
-    argc += static_cast<int>(env->GetArrayLength(jargs));
-  xbt_assert(argc > 0);
-
-  // Need a static storage because the XBT layer saves the arguments in xbt::binary_name and xbt::cmdline.
-  static std::vector<std::string> args;
-  args.reserve(argc);
-
-  args.emplace_back("java");
-  for (int index = 1; index < argc; index++) {
-    auto jval       = (jstring)env->GetObjectArrayElement(jargs, index - 1);
-    jstring_wrapper tmp(env, jval);
-    args.emplace_back(tmp.value);
-  }
-
-  std::unique_ptr<char* []> argv(new char*[argc + 1]);
-  std::transform(begin(args), end(args), argv.get(), [](std::string& s) { return &s.front(); });
-  argv[argc] = nullptr;
-
-  int argc2 = argc;
-  MSG_init(&argc2, argv.get());
-  xbt_assert(argc2 <= argc);
-
-  for (int index = 1; index < argc2; index++)
-    env->SetObjectArrayElement(jargs, index - 1, (jstring)env->NewStringUTF(argv[index]));
-
-  sg_vm_live_migration_plugin_init();
-  JAVA_HOST_LEVEL = simgrid::s4u::Host::extension_create(nullptr);
-}
-
-JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass)
-{
-  /* Run everything */
-  XBT_DEBUG("Ready to run");
-  simgrid_run();
-  XBT_DEBUG("Done running");
-  XBT_INFO("Terminating the simulation...");
-  /* Cleanup java hosts */
-  sg_host_t* hosts  = sg_host_list();
-  size_t host_count = sg_host_count();
-  for (size_t index = 0; index < host_count - 1; index++) {
-    auto jhost = (jobject)hosts[index]->extension(JAVA_HOST_LEVEL);
-    if (jhost)
-      jhost_unref(env, jhost);
-  }
-  xbt_free(hosts);
-
-  /* Display the status of remaining threads. None should survive, but who knows */
-  jclass clsProcess = jxbt_get_class(env, "org/simgrid/msg/Process");
-  jmethodID idDebug = jxbt_get_static_jmethod(env, clsProcess, "debugAllThreads", "()V");
-  xbt_assert(idDebug != nullptr, "Method Process.debugAllThreads() not found...");
-  env->CallStaticVoidMethod(clsProcess, idDebug);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass, jstring jplatformFile)
-{
-  jstring_wrapper platformFile(env, jplatformFile);
-  simgrid_load_platform(platformFile);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv* env, jclass)
-{
-  sg_netzone_t as  = sg_zone_get_root();
-  jobject jas      = jnetzone_new_instance(env);
-  if (not jas) {
-    jxbt_throw_jni(env, "java As instantiation failed");
-    return nullptr;
-  }
-  jas = jnetzone_ref(env, jas);
-  if (not jas) {
-    jxbt_throw_jni(env, "new global ref allocation failed");
-    return nullptr;
-  }
-  jnetzone_bind(jas, as, env);
-
-  return (jobject) jas;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass, jstring js)
-{
-  jstring_wrapper s(env, js);
-  XBT_DEBUG("%s", s.value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv* env, jclass, jstring js)
-{
-  jstring_wrapper s(env, js);
-  XBT_VERB("%s", s.value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv* env, jclass, jstring js)
-{
-  jstring_wrapper s(env, js);
-  XBT_INFO("%s", s.value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv* env, jclass, jstring js)
-{
-  jstring_wrapper s(env, js);
-  XBT_WARN("%s", s.value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv* env, jclass, jstring js)
-{
-  jstring_wrapper s(env, js);
-  XBT_ERROR("%s", s.value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv* env, jclass, jstring js)
-{
-  jstring_wrapper s(env, js);
-  XBT_CRITICAL("%s", s.value);
-}
-
-static void java_main(int argc, char* argv[]);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv* env, jclass, jstring jdeploymentFile)
-{
-  jstring_wrapper deploymentFile(env, jdeploymentFile);
-
-  simgrid_register_default(java_main);
-  simgrid_load_deployment(deploymentFile);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() {
-  sg_host_energy_plugin_init();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_loadInit() {
-    sg_host_load_plugin_init();
-}
-/** Run a Java org.simgrid.msg.Process
- *
- *  If needed, this waits for the process starting time.
- *  Then it calls the Process.run() method.
- */
-static void run_jprocess(JNIEnv *env, jobject jprocess)
-{
-  // wait for the process's start time
-  jfieldID jprocess_field_Process_startTime = jxbt_get_sfield(env, "org/simgrid/msg/Process", "startTime", "D");
-  jdouble startTime = env->GetDoubleField(jprocess, jprocess_field_Process_startTime);
-  if (startTime > simgrid_get_clock())
-    simgrid::s4u::this_actor::sleep_for(startTime - simgrid_get_clock());
-
-  //Execution of the "run" method.
-  jmethodID id = jxbt_get_smethod(env, "org/simgrid/msg/Process", "run", "()V");
-  xbt_assert((id != nullptr), "Method Process.run() not found...");
-
-  env->CallVoidMethod(jprocess, id);
-  if (env->ExceptionOccurred()) {
-    XBT_DEBUG("Something went wrong in this Java actor, forget about it.");
-    env->ExceptionClear();
-    xbt_assert(__java_vm->DetachCurrentThread() == JNI_OK, "Cannot detach failing thread");
-    simgrid::ForcefulKillException::do_throw();
-  }
-}
-
-/** Create a Java org.simgrid.msg.Process with the arguments and run it */
-static void java_main(int argc, char* argv[])
-{
-  JNIEnv *env = get_current_thread_env();
-  auto* context = static_cast<simgrid::kernel::context::JavaContext*>(simgrid::kernel::context::Context::self());
-
-  //Change the "." in class name for "/".
-  std::string arg0 = argv[0];
-  std::replace(begin(arg0), end(arg0), '.', '/');
-  jclass class_Process = env->FindClass(arg0.c_str());
-  //Retrieve the methodID for the constructor
-  xbt_assert((class_Process != nullptr), "Class not found (%s). The deployment file must use the fully qualified class name, including the package. The case is important.", argv[0]);
-  jmethodID constructor_Process = env->GetMethodID(class_Process, "<init>", "(Lorg/simgrid/msg/Host;Ljava/lang/String;[Ljava/lang/String;)V");
-  xbt_assert((constructor_Process != nullptr), "Constructor not found for class %s. Is there a (Host, String ,String[]) constructor in your class ?", argv[0]);
-
-  //Retrieve the name of the process.
-  jstring jname = env->NewStringUTF(argv[0]);
-  //Build the arguments
-  auto args = static_cast<jobjectArray>(
-      env->NewObjectArray(argc - 1, env->FindClass("java/lang/String"), env->NewStringUTF("")));
-  for (int i = 1; i < argc; i++)
-      env->SetObjectArrayElement(args,i - 1, env->NewStringUTF(argv[i]));
-  //Retrieve the host for the process.
-  jstring jhostName = env->NewStringUTF(simgrid::s4u::Host::current()->get_cname());
-  jobject jhost = Java_org_simgrid_msg_Host_getByName(env, nullptr, jhostName);
-  //creates the process
-  jobject jprocess = env->NewObject(class_Process, constructor_Process, jhost, jname, args);
-  xbt_assert((jprocess != nullptr), "Process allocation failed.");
-  jprocess = env->NewGlobalRef(jprocess);
-  //bind the process to the context
-  const_sg_actor_t actor = sg_actor_self();
-
-  context->jprocess_ = jprocess;
-  /* sets the PID and the PPID of the process */
-  env->SetIntField(jprocess, jprocess_field_Process_pid, static_cast<jint>(actor->get_pid()));
-  env->SetIntField(jprocess, jprocess_field_Process_ppid, static_cast<jint>(actor->get_ppid()));
-  jprocess_bind(jprocess, actor, env);
-
-  run_jprocess(env, context->jprocess_);
-}
-
-namespace simgrid::kernel::context {
-
-/** Run the Java org.simgrid.msg.Process */
-void java_main_jprocess(jobject jprocess)
-{
-  JNIEnv *env = get_current_thread_env();
-  auto* context        = static_cast<JavaContext*>(Context::self());
-  context->jprocess_   = jprocess;
-  jprocess_bind(context->jprocess_, sg_actor_self(), env);
-
-  run_jprocess(env, context->jprocess_);
-}
-} // namespace simgrid::kernel::context
diff --git a/src/bindings/java/jmsg.hpp b/src/bindings/java/jmsg.hpp
deleted file mode 100644 (file)
index d0312d4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Java Wrappers to the MSG API.                                            */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef JMSG_HPP
-#define JMSG_HPP
-#include <jni.h>
-#include <simgrid/msg.h>
-#include <unordered_map>
-
-extern "C" {
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-extern int JAVA_HOST_LEVEL;
-
-JNIEnv* get_current_thread_env();
-/**
- * This function throws the correct exception according to the status provided.
- */
-void jmsg_throw_status(JNIEnv* env, msg_error_t status);
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv* env, jclass cls);
-JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit();
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_loadInit();
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv* env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv* env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv* env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv* env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv* env, jclass cls, jstring jargs);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls, jstring jplatformFile);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv* env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv* env, jclass cls, jstring jdeploymentFile);
-}
-#endif
diff --git a/src/bindings/java/jmsg_as.cpp b/src/bindings/java/jmsg_as.cpp
deleted file mode 100644 (file)
index 48a8dc9..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Java bindings of the NetZones.                                           */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/NetZone.hpp"
-
-#include "jmsg.hpp"
-#include "jmsg_as.hpp"
-#include "jmsg_host.h"
-#include "jxbt_utilities.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-static jmethodID jas_method_As_constructor;
-static jfieldID jas_field_As_bind;
-
-jobject jnetzone_new_instance(JNIEnv* env)
-{
-  jclass cls = jxbt_get_class(env, "org/simgrid/msg/As");
-  return env->NewObject(cls, jas_method_As_constructor);
-}
-
-jobject jnetzone_ref(JNIEnv* env, jobject jas)
-{
-  return env->NewGlobalRef(jas);
-}
-
-void jnetzone_unref(JNIEnv* env, jobject jas)
-{
-  env->DeleteGlobalRef(jas);
-}
-
-void jnetzone_bind(jobject jas, simgrid::s4u::NetZone* netzone, JNIEnv* env)
-{
-  env->SetLongField(jas, jas_field_As_bind, (jlong)(uintptr_t)(netzone));
-}
-
-simgrid::s4u::NetZone* jnetzone_get_native(JNIEnv* env, jobject jas)
-{
-  return (simgrid::s4u::NetZone*)(uintptr_t)env->GetLongField(jas, jas_field_As_bind);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnv* env, jclass cls)
-{
-  jclass class_As = env->FindClass("org/simgrid/msg/As");
-  jas_method_As_constructor = env->GetMethodID(class_As, "<init>", "()V");
-  jas_field_As_bind = jxbt_get_jfield(env,class_As, "bind", "J");
-  xbt_assert(class_As && jas_method_As_constructor && jas_field_As_bind,
-             "Native initialization of msg/AS failed. Please report that bug");
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv * env, jobject jas) {
-  const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
-  return env->NewStringUTF(as->get_cname());
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, jobject jas) {
-  int index = 0;
-  jobjectArray jtable;
-  const simgrid::s4u::NetZone* self_as = jnetzone_get_native(env, jas);
-
-  jclass cls = env->FindClass("org/simgrid/msg/As");
-
-  if (not cls)
-    return nullptr;
-
-  jtable = env->NewObjectArray(static_cast<jsize>(self_as->get_children().size()), cls, nullptr);
-
-  if (not jtable) {
-    jxbt_throw_jni(env, "Hosts table allocation failed");
-    return nullptr;
-  }
-
-  for (auto const& tmp_as : self_as->get_children()) {
-    jobject tmp_jas = jnetzone_new_instance(env);
-    if (not tmp_jas) {
-      jxbt_throw_jni(env, "java As instantiation failed");
-      return nullptr;
-    }
-    tmp_jas = jnetzone_ref(env, tmp_jas);
-    if (not tmp_jas) {
-      jxbt_throw_jni(env, "new global ref allocation failed");
-      return nullptr;
-    }
-    jnetzone_bind(tmp_jas, tmp_as, env);
-
-    env->SetObjectArrayElement(jtable, index, tmp_jas);
-    index++;
-  }
-  return jtable;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jas, jobject jname) {
-  const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
-
-  if (not as) {
-    jxbt_throw_notbound(env, "as", jas);
-    return nullptr;
-  }
-  jstring_wrapper name(env, static_cast<jstring>(jname));
-
-  const char* property = sg_zone_get_property_value(as, name);
-  if (not property) {
-    return nullptr;
-  }
-
-  jobject jproperty = env->NewStringUTF(property);
-
-  return jproperty;
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jobject jas)
-{
-  jobjectArray jtable;
-  jobject jhost;
-  jstring jname;
-  const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
-
-  jclass cls = jxbt_get_class(env, "org/simgrid/msg/Host");
-  if (not cls)
-    return nullptr;
-
-  std::vector<simgrid::s4u::Host*> table = as->get_all_hosts();
-
-  jtable = env->NewObjectArray(static_cast<jsize>(table.size()), cls, nullptr);
-
-  if (not jtable) {
-    jxbt_throw_jni(env, "Hosts table allocation failed");
-    return nullptr;
-  }
-
-  int index = 0;
-  for (auto const& host : table) {
-    jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
-    if (not jhost) {
-      jname = env->NewStringUTF(host->get_cname());
-
-      jhost = Java_org_simgrid_msg_Host_getByName(env, cls, jname);
-
-      env->ReleaseStringUTFChars(static_cast<jstring>(jname), host->get_cname());
-    }
-
-    env->SetObjectArrayElement(jtable, index, jhost);
-    index++;
-  }
-  return jtable;
-}
diff --git a/src/bindings/java/jmsg_as.hpp b/src/bindings/java/jmsg_as.hpp
deleted file mode 100644 (file)
index 670f2c8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Functions related to the java As instances.                              */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef JMSG_AS_HPP
-#define JMSG_AS_HPP
-#include "simgrid/zone.h"
-#include <jni.h>
-
-extern "C" {
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-jobject jnetzone_new_instance(JNIEnv* env);
-jobject jnetzone_ref(JNIEnv* env, jobject jnetzone);
-void jnetzone_unref(JNIEnv* env, jobject jnetzone);
-void jnetzone_bind(jobject jas, msg_netzone_t as, JNIEnv* env);
-simgrid::s4u::NetZone* jnetzone_get_native(JNIEnv* env, jobject jnetzone);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnv* env, jclass cls);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv* env, jobject jas);
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv* env, jobject jnetzone);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv* env, jobject jhost, jobject jname);
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv* env, jobject jnetzone);
-}
-#endif
diff --git a/src/bindings/java/jmsg_comm.cpp b/src/bindings/java/jmsg_comm.cpp
deleted file mode 100644 (file)
index 36774d0..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Java bindings to the Comm API                                            */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "jmsg_comm.h"
-#include "jmsg.hpp"
-#include "jxbt_utilities.hpp"
-
-#include <string>
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-static jfieldID jcomm_field_Comm_bind;
-static jfieldID jcomm_field_Comm_finished;
-static jfieldID jcomm_field_Comm_receiving;
-static jfieldID jtask_field_Comm_task;
-static jfieldID jcomm_field_Comm_taskBind;
-
-void jcomm_bind_task(JNIEnv *env, jobject jcomm) {
-  const_msg_comm_t comm = (msg_comm_t)(uintptr_t)env->GetLongField(jcomm, jcomm_field_Comm_bind);
-  //test if we are receiving or sending a task.
-  jboolean jreceiving = env->GetBooleanField(jcomm, jcomm_field_Comm_receiving);
-  if (jreceiving == JNI_TRUE) {
-    //bind the task object.
-    msg_task_t task = MSG_comm_get_task(comm);
-    xbt_assert(task != nullptr, "Task is nullptr");
-    auto jtask_global = static_cast<jobject>(MSG_task_get_data(task));
-    //case where the data has already been retrieved
-    if (jtask_global == nullptr) {
-      return;
-    }
-
-    //Make sure the data will be correctly gc.
-    jobject jtask_local = env->NewLocalRef(jtask_global);
-    env->DeleteGlobalRef(jtask_global);
-
-    env->SetObjectField(jcomm, jtask_field_Comm_task, jtask_local);
-
-    MSG_task_set_data(task, nullptr);
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_nativeInit(JNIEnv *env, jclass cls) {
-  jclass jfield_class_Comm = env->FindClass("org/simgrid/msg/Comm");
-  xbt_assert(jfield_class_Comm, "Native initialization of msg/Comm failed. Please report that bug");
-
-  jcomm_field_Comm_bind = jxbt_get_jfield(env, jfield_class_Comm, "bind", "J");
-  jcomm_field_Comm_taskBind  = jxbt_get_jfield(env, jfield_class_Comm, "taskBind", "J");
-  jcomm_field_Comm_receiving = jxbt_get_jfield(env, jfield_class_Comm, "receiving", "Z");
-  jtask_field_Comm_task = jxbt_get_jfield(env, jfield_class_Comm, "task", "Lorg/simgrid/msg/Task;");
-  jcomm_field_Comm_finished = jxbt_get_jfield(env, jfield_class_Comm, "finished", "Z");
-  xbt_assert(jcomm_field_Comm_bind && jcomm_field_Comm_taskBind && jcomm_field_Comm_receiving &&
-                 jtask_field_Comm_task && jcomm_field_Comm_finished,
-             "Native initialization of msg/Comm failed. Please report that bug");
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_nativeFinalize(JNIEnv *env, jobject jcomm) {
-  msg_task_t *task_received;
-
-  task_received = (msg_task_t*)  (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_taskBind);
-  delete task_received;
-
-  const_msg_comm_t comm = (msg_comm_t)(uintptr_t)env->GetLongField(jcomm, jcomm_field_Comm_bind);
-  MSG_comm_destroy(comm);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Comm_test(JNIEnv *env, jobject jcomm) {
-  msg_comm_t comm;
-  comm = (msg_comm_t) (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_bind);
-
-  jboolean finished = env->GetBooleanField(jcomm, jcomm_field_Comm_finished);
-  if (finished == JNI_TRUE) {
-    return JNI_TRUE;
-  }
-
-  if (not comm) {
-    jxbt_throw_null(env, "comm is null");
-    return JNI_FALSE;
-  }
-
-  if (MSG_comm_test(comm)) {
-    msg_error_t status = MSG_comm_get_status(comm);
-    if (status == MSG_OK) {
-      jcomm_bind_task(env,jcomm);
-      return JNI_TRUE;
-    } else {
-      //send the correct exception
-      jmsg_throw_status(env,status);
-    }
-  }
-  return JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, jobject jcomm, jdouble timeout) {
-  auto comm = (msg_comm_t)(uintptr_t)env->GetLongField(jcomm, jcomm_field_Comm_bind);
-  if (not comm) {
-    jxbt_throw_null(env, "comm is null");
-    return;
-  }
-
-  jboolean finished = env->GetBooleanField(jcomm, jcomm_field_Comm_finished);
-  if (finished == JNI_TRUE) {
-    return;
-  }
-
-  msg_error_t status;
-  status = MSG_comm_wait(comm, timeout);
-  env->SetBooleanField(jcomm, jcomm_field_Comm_finished, JNI_TRUE);
-  if (status == MSG_OK) {
-    jcomm_bind_task(env,jcomm);
-  } else {
-    jmsg_throw_status(env,status);
-  }
-}
-
-static msg_comm_t* jarray_to_commArray(JNIEnv *env, jobjectArray jcomms, /* OUT */ int *count)
-{
-  *count = env->GetArrayLength(jcomms);
-  auto* comms = new msg_comm_t[*count];
-
-  for (int i=0; i < *count; i++) {
-     jobject jcomm = env->GetObjectArrayElement(jcomms, i);
-     if (env->ExceptionOccurred())
-        break;
-
-     comms[i] = (msg_comm_t) (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_bind);
-     if (not comms[i]) {
-       jxbt_throw_null(env, "comm at rank " + std::to_string(i) + " is null");
-       return nullptr;
-     }
-
-     env->DeleteLocalRef(jcomm); // reduce the load on the garbage collector: we don't need that object anymore
-  }
-  return comms;
-}
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitAll(JNIEnv *env, jclass cls, jobjectArray jcomms, jdouble timeout)
-{
-  int count;
-  msg_comm_t* comms = jarray_to_commArray(env, jcomms, &count);
-  if (not comms)
-    return;
-
-  MSG_comm_waitall(comms, count, timeout);
-  delete[] comms;
-}
-JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls, jobjectArray jcomms)
-{
-  int count;
-  msg_comm_t* comms = jarray_to_commArray(env, jcomms, &count);
-  if (not comms)
-    return -1;
-  xbt_dynar_t dyn = xbt_dynar_new(sizeof(msg_comm_t),nullptr);
-  for (int i=0; i<count; i++) {
-    xbt_dynar_push(dyn, &(comms[i]));
-  }
-
-  int rank = MSG_comm_waitany(dyn);
-  delete[] comms;
-  xbt_dynar_free(&dyn);
-  return rank;
-}
diff --git a/src/bindings/java/jmsg_comm.h b/src/bindings/java/jmsg_comm.h
deleted file mode 100644 (file)
index 8f3da5a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Java bindings to the Comm API                                            */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef MSG_JCOMM_H
-#define MSG_JCOMM_H
-
-#include "simgrid/msg.h"
-#include <jni.h>
-
-SG_BEGIN_DECL
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-/** This function binds the task associated with the communication to the java communication object. */
-void jcomm_bind_task(JNIEnv *env, jobject jcomm);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_nativeInit(JNIEnv *env, jclass cls);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_nativeFinalize(JNIEnv *env, jobject jcomm);
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Comm_test(JNIEnv *env, jobject jcomm);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, jobject jcomm, jdouble timeout);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitAll(JNIEnv *env, jclass cls, jobjectArray jcomms, jdouble timeout);
-JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls, jobjectArray jcomms);
-
-SG_END_DECL
-#endif
diff --git a/src/bindings/java/jmsg_host.cpp b/src/bindings/java/jmsg_host.cpp
deleted file mode 100644 (file)
index edb6b4d..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Functions related to the java host instances.                            */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/Exception.hpp"
-#include "simgrid/plugins/energy.h"
-#include "simgrid/plugins/load.h"
-#include "simgrid/s4u/Host.hpp"
-
-#include "JavaContext.hpp"
-#include "jmsg.hpp"
-#include "jmsg_host.h"
-#include "jxbt_utilities.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-static jmethodID jhost_method_Host_constructor;
-static jfieldID jhost_field_Host_bind;
-static jfieldID jhost_field_Host_name;
-
-jobject jhost_new_instance(JNIEnv * env) {
-  jclass cls = jxbt_get_class(env, "org/simgrid/msg/Host");
-  return env->NewObject(cls, jhost_method_Host_constructor);
-}
-
-jobject jhost_ref(JNIEnv * env, jobject jhost) {
-  return env->NewGlobalRef(jhost);
-}
-
-void jhost_unref(JNIEnv * env, jobject jhost) {
-  env->DeleteGlobalRef(jhost);
-}
-
-void jhost_bind(jobject jhost, msg_host_t host, JNIEnv * env) {
-  env->SetLongField(jhost, jhost_field_Host_bind, (jlong) (uintptr_t) (host));
-}
-
-msg_host_t jhost_get_native(JNIEnv * env, jobject jhost) {
-  return (msg_host_t) (uintptr_t) env->GetLongField(jhost, jhost_field_Host_bind);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls) {
-  jclass class_Host = env->FindClass("org/simgrid/msg/Host");
-  jhost_method_Host_constructor = env->GetMethodID(class_Host, "<init>", "()V");
-  jhost_field_Host_bind = jxbt_get_jfield(env,class_Host, "bind", "J");
-  jhost_field_Host_name = jxbt_get_jfield(env, class_Host, "name", "Ljava/lang/String;");
-  xbt_assert(class_Host && jhost_field_Host_name && jhost_method_Host_constructor && jhost_field_Host_bind,
-             "Native initialization of msg/Host failed. Please report that bug");
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName(JNIEnv* env, jclass cls, jstring jname)
-{
-  /* get the C string from the java string */
-  if (jname == nullptr) {
-    jxbt_throw_null(env, "No host can have a null name");
-    return nullptr;
-  }
-  jstring_wrapper name(env, jname);
-  /* get the host by name       (the hosts are created during the grid resolution) */
-  sg_host_t host = sg_host_by_name(name);
-
-  if (not host) { /* invalid name */
-    jxbt_throw_host_not_found(env, name);
-    return nullptr;
-  }
-
-  if (not host->extension(JAVA_HOST_LEVEL)) { /* native host not associated yet with java host */
-    /* Instantiate a new java host */
-    jobject jhost = jhost_new_instance(env);
-
-    if (not jhost) {
-      jxbt_throw_jni(env, "java host instantiation failed");
-      return nullptr;
-    }
-
-    /* get a global reference to the newly created host */
-    jhost = jhost_ref(env, jhost);
-
-    if (not jhost) {
-      jxbt_throw_jni(env, "new global ref allocation failed");
-      return nullptr;
-    }
-    /* Sets the java host name */
-    env->SetObjectField(jhost, jhost_field_Host_name, jname);
-    /* bind the java host and the native host */
-    jhost_bind(jhost, host, env);
-
-    /* the native host data field is set with the global reference to the java host returned by this function */
-    host->extension_set(JAVA_HOST_LEVEL, jhost);
-  }
-
-  /* return the global reference to the java host instance */
-  return (jobject) host->extension(JAVA_HOST_LEVEL);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost(JNIEnv * env, jclass cls) {
-  jobject jhost;
-
-  sg_host_t host = sg_host_self();
-
-  if (not host->extension(JAVA_HOST_LEVEL)) {
-    /* the native host not yet associated with the java host instance */
-
-    /* instantiate a new java host instance */
-    jhost = jhost_new_instance(env);
-
-    if (not jhost) {
-      jxbt_throw_jni(env, "java host instantiation failed");
-      return nullptr;
-    }
-
-    /* get a global reference to the newly created host */
-    jhost = jhost_ref(env, jhost);
-
-    if (not jhost) {
-      jxbt_throw_jni(env, "global ref allocation failed");
-      return nullptr;
-    }
-    /* Sets the host name */
-    jobject jname = env->NewStringUTF(host->get_cname());
-    env->SetObjectField(jhost, jhost_field_Host_name, jname);
-    /* Bind & store it */
-    jhost_bind(jhost, host, env);
-    host->extension_set(JAVA_HOST_LEVEL, jhost);
-  } else {
-    jhost = (jobject) host->extension(JAVA_HOST_LEVEL);
-  }
-
-  return jhost;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost) {
-  sg_host_t host = jhost_get_native(env, jhost);
-  sg_host_turn_on(host);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost) {
-  sg_host_t host = jhost_get_native(env, jhost);
-  if (not simgrid::ForcefulKillException::try_n_catch([host]() { sg_host_turn_off(host); }))
-    jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Host turned off");
-}
-
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount(JNIEnv * env, jclass cls) {
-  return (jint)sg_host_count();
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed(JNIEnv * env, jobject jhost) {
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return -1;
-  }
-
-  return (jdouble)sg_host_get_speed(host);
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber(JNIEnv * env, jobject jhost) {
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return -1;
-  }
-
-  return (jdouble)sg_host_core_count(host);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname) {
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return nullptr;
-  }
-  jstring_wrapper name(env, (jstring)jname);
-
-  const char* property = sg_host_get_property_value(host, name);
-  if (not property) {
-    return nullptr;
-  }
-
-  jobject jproperty = env->NewStringUTF(property);
-
-  return jproperty;
-}
-
-JNIEXPORT void JNICALL
-Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue) {
-  sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return;
-  }
-  jstring_wrapper name(env, (jstring)jname);
-  jstring_wrapper value_java(env, (jstring)jvalue);
-  const char* value      = xbt_strdup(value_java);
-
-  sg_host_set_property_value(host, name, value);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn(JNIEnv * env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return 0;
-  }
-
-  return (jboolean)sg_host_is_on(host);
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_all(JNIEnv * env, jclass cls_arg)
-{
-  sg_host_t* table = sg_host_list();
-  int count        = sg_host_count();
-
-  jclass cls = jxbt_get_class(env, "org/simgrid/msg/Host");
-  if (not cls)
-    return nullptr;
-
-  jobjectArray jtable = env->NewObjectArray((jsize)count, cls, nullptr);
-
-  if (not jtable) {
-    jxbt_throw_jni(env, "Hosts table allocation failed");
-    return nullptr;
-  }
-
-  for (int index = 0; index < count; index++) {
-    auto jhost = static_cast<jobject>(table[index]->extension(JAVA_HOST_LEVEL));
-
-    if (not jhost) {
-      jstring jname = env->NewStringUTF(table[index]->get_cname());
-      jhost         = Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
-    }
-
-    env->SetObjectArrayElement(jtable, index, jhost);
-  }
-  xbt_free(table);
-  return jtable;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setAsyncMailbox(JNIEnv * env, jclass cls_arg, jobject jname)
-{
-  jstring_wrapper name(env, (jstring)jname);
-  sg_mailbox_set_receiver(name);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_updateAllEnergyConsumptions(JNIEnv* env, jclass cls)
-{
-  sg_host_energy_update_all();
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getConsumedEnergy (JNIEnv *env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return 0;
-  }
-
-  return sg_host_get_consumed_energy(host);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setPstate(JNIEnv* env, jobject jhost, jint pstate)
-{
-  sg_host_t host = jhost_get_native(env, jhost);
-  sg_host_set_pstate(host, pstate);
-}
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getPstate(JNIEnv* env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-  return sg_host_get_pstate(host);
-}
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getPstatesCount(JNIEnv* env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-  return sg_host_get_nb_pstates(host);
-}
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentPowerPeak(JNIEnv* env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-  return sg_host_get_speed(host);
-}
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env, jobject jhost, jint pstate)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-  return sg_host_get_pstate_speed(host, pstate);
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getLoad(JNIEnv* env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-  return sg_host_get_load(host);
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentLoad (JNIEnv *env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return 0;
-  }
-
-  return sg_host_get_current_load(host);
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getComputedFlops (JNIEnv *env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return 0;
-  }
-
-  return sg_host_get_computed_flops(host);
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getAvgLoad (JNIEnv *env, jobject jhost)
-{
-  const_sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return 0;
-  }
-
-  return sg_host_get_avg_load(host);
-}
diff --git a/src/bindings/java/jmsg_host.h b/src/bindings/java/jmsg_host.h
deleted file mode 100644 (file)
index e549bfd..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Functions related to the java host instances.                            */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef MSG_JHOST_H
-#define MSG_JHOST_H
-
-#include "simgrid/host.h"
-#include "simgrid/plugins/file_system.h"
-#include <jni.h>
-
-SG_BEGIN_DECL
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-/** Returns a new java instance of a host. */
-jobject jhost_new_instance(JNIEnv * env);
-
-/** Take a ref onto the java instance (to prevent its collection) */
-jobject jhost_ref(JNIEnv * env, jobject jhost);
-
-/** Release a ref onto the java instance */
-void jhost_unref(JNIEnv * env, jobject jhost);
-
-/** Binds a native instance to a java instance. */
-void jhost_bind(jobject jhost, sg_host_t host, JNIEnv* env);
-
-/** Extracts the native instance associated to a java instance. */
-sg_host_t jhost_get_native(JNIEnv* env, jobject jhost);
-
-/** Initialize the native world, called from the Java world at startup */
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls);
-
-/* Implement the Java API */
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName(JNIEnv* env, jclass cls, jstring jname);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost(JNIEnv* env, jclass cls);
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount (JNIEnv *env, jclass cls);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv* env, jobject jhost);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv* env, jobject jhost);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn(JNIEnv* env, jobject jhost);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed (JNIEnv *env, jobject jhost);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber (JNIEnv *env, jobject jhost);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_all(JNIEnv *env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setAsyncMailbox(JNIEnv * env, jclass cls_arg, jobject jname);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_updateAllEnergyConsumptions(JNIEnv* env, jclass cls);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getConsumedEnergy (JNIEnv *env, jobject jhost);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setPstate(JNIEnv* env, jobject jhost, jint pstate);
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getPstate(JNIEnv* env, jobject jhost);
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getPstatesCount(JNIEnv* env, jobject jhost);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentPowerPeak(JNIEnv* env, jobject jhost);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env, jobject jhost, jint pstate);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getLoad(JNIEnv* env, jobject jhost);
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentLoad(JNIEnv *env, jobject jhost);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getAvgLoad(JNIEnv *env, jobject jhost);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getComputedFlops (JNIEnv *env, jobject jhost);
-SG_END_DECL
-#endif
diff --git a/src/bindings/java/jmsg_process.cpp b/src/bindings/java/jmsg_process.cpp
deleted file mode 100644 (file)
index 9ce7011..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-/* Functions related to the java process instances.                         */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "jmsg_process.h"
-
-#include "JavaContext.hpp"
-#include "jmsg.hpp"
-#include "jmsg_host.h"
-#include "jxbt_utilities.hpp"
-#include "simgrid/Exception.hpp"
-#include "simgrid/s4u/Actor.hpp"
-#include "src/kernel/actor/ActorImpl.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-jfieldID jprocess_field_Process_bind;
-jfieldID jprocess_field_Process_host;
-jfieldID jprocess_field_Process_killTime;
-jfieldID jprocess_field_Process_name;
-jfieldID jprocess_field_Process_pid;
-jfieldID jprocess_field_Process_ppid;
-
-jobject jprocess_from_native(const_sg_actor_t actor)
-{
-  const simgrid::kernel::context::JavaContext* context =
-      static_cast<simgrid::kernel::context::JavaContext*>(actor->get_impl()->context_.get());
-  return context->jprocess_;
-}
-
-jobject jprocess_ref(jobject jprocess, JNIEnv* env)
-{
-  return env->NewGlobalRef(jprocess);
-}
-
-void jprocess_unref(jobject jprocess, JNIEnv* env)
-{
-  env->DeleteGlobalRef(jprocess);
-}
-
-sg_actor_t jprocess_to_native(jobject jprocess, JNIEnv* env)
-{
-  return (sg_actor_t)(intptr_t)env->GetLongField(jprocess, jprocess_field_Process_bind);
-}
-
-void jprocess_bind(jobject jprocess, const_sg_actor_t actor, JNIEnv* env)
-{
-  env->SetLongField(jprocess, jprocess_field_Process_bind, (intptr_t)actor);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jclass cls) {
-  jclass jprocess_class_Process = env->FindClass("org/simgrid/msg/Process");
-  xbt_assert(jprocess_class_Process, "Native initialization of msg/Process failed. Please report that bug");
-
-  jprocess_field_Process_name = jxbt_get_jfield(env, jprocess_class_Process, "name", "Ljava/lang/String;");
-  jprocess_field_Process_bind = jxbt_get_jfield(env, jprocess_class_Process, "bind", "J");
-  jprocess_field_Process_pid = jxbt_get_jfield(env, jprocess_class_Process, "pid", "I");
-  jprocess_field_Process_ppid = jxbt_get_jfield(env, jprocess_class_Process, "ppid", "I");
-  jprocess_field_Process_host = jxbt_get_jfield(env, jprocess_class_Process, "host", "Lorg/simgrid/msg/Host;");
-  jprocess_field_Process_killTime = jxbt_get_jfield(env, jprocess_class_Process, "killTime", "D");
-  xbt_assert(jprocess_field_Process_name && jprocess_field_Process_pid && jprocess_field_Process_ppid &&
-                 jprocess_field_Process_host,
-             "Native initialization of msg/Process failed. Please report that bug");
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject jprocess_arg, jobject jhost)
-{
-  /* create a global java process instance */
-  jobject jprocess = jprocess_ref(jprocess_arg, env);
-
-  /* Actually build the MSG process */
-  auto jname        = (jstring)env->GetObjectField(jprocess, jprocess_field_Process_name);
-  const char* name  = env->GetStringUTFChars(jname, nullptr);
-  auto actor_code   = [jprocess]() { simgrid::kernel::context::java_main_jprocess(jprocess); };
-  auto self         = simgrid::kernel::actor::ActorImpl::self();
-  sg_host_t host    = jhost_get_native(env, jhost);
-  auto* actor       = simgrid::kernel::actor::simcall_answered([name, actor_code, host, self] {
-    return simgrid::kernel::actor::ActorImpl::create(std::move(name), std::move(actor_code), nullptr, host, self).get();
-  });
-  sg_actor_yield();
-
-  env->ReleaseStringUTFChars(jname, name);
-
-  /* Retrieve the kill time from the actor */
-  actor->get_ciface()->set_kill_time((double)env->GetDoubleField(jprocess, jprocess_field_Process_killTime));
-
-  /* sets the PID and the PPID of the actor */
-  env->SetIntField(jprocess, jprocess_field_Process_pid, (jint)actor->get_ciface()->get_pid());
-  env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint)actor->get_ciface()->get_ppid());
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess)
-{
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-
-  actor->daemonize();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv* env, jclass cls)
-{
-  sg_actor_kill_all();
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jclass cls, jint pid)
-{
-  auto const* actor = sg_actor_by_pid(pid);
-
-  if (not actor) {
-    jxbt_throw_process_not_found(env, "PID = " + std::to_string(static_cast<int>(pid)));
-    return nullptr;
-  }
-
-  jobject jprocess = jprocess_from_native(actor);
-
-  if (not jprocess) {
-    jxbt_throw_jni(env, "get process failed");
-    return nullptr;
-  }
-
-  return jprocess;
-}
-
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_nativeGetPID(JNIEnv* env, jobject jprocess)
-{
-  const_sg_actor_t actor = jprocess_to_native(jprocess, env);
-  return sg_actor_get_pid(actor);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname) {
-  const_sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return nullptr;
-  }
-  jstring_wrapper name(env, (jstring)jname);
-
-  const char* property = actor->get_property(name);
-  if (not property)
-    return nullptr;
-
-  jobject jproperty = env->NewStringUTF(property);
-
-  return jproperty;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getCurrentProcess(JNIEnv * env, jclass cls)
-{
-  jobject jprocess = jprocess_from_native(sg_actor_self());
-  if (not jprocess)
-    jxbt_throw_jni(env, xbt_strdup("SIMIX_process_get_jprocess() failed"));
-
-  return jprocess;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_suspend(JNIEnv * env, jobject jprocess)
-{
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-
-  /* suspend the process */
-  actor->suspend();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv * env, jobject jprocess)
-{
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-
-  /* resume the process */
-  actor->resume();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setAutoRestart(JNIEnv* env, jobject jprocess,
-                                                                   jboolean jauto_restart)
-{
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-
-  actor->set_auto_restart(jauto_restart == JNI_TRUE);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart (JNIEnv *env, jobject jprocess) {
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-
-  actor->restart();
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env, jobject jprocess)
-{
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return 0;
-  }
-
-  /* true is the actor is suspended, false otherwise */
-  return (jboolean)actor->is_suspended();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
- {
-  double time =  ((double)jmillis) / 1000 + ((double)jnanos) / 1000000000;
-  msg_error_t rv = MSG_OK;
-  if (not simgrid::ForcefulKillException::try_n_catch([&time]() { simgrid::s4u::this_actor::sleep_for(time); })) {
-    rv = MSG_HOST_FAILURE;
-  }
-  if (rv != MSG_OK) {
-    jmsg_throw_status(env, rv);
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor(JNIEnv * env, jobject jprocess, jdouble jseconds)
-{
-  msg_error_t rv = MSG_OK;
-  if (not simgrid::ForcefulKillException::try_n_catch(
-          [&jseconds]() { simgrid::s4u::this_actor::sleep_for((double)jseconds); })) {
-    rv = MSG_HOST_FAILURE;
-    jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
-  }
-  if (env->ExceptionOccurred())
-    return;
-  if (rv != MSG_OK) {
-    XBT_DEBUG("Status NOK");
-    jmsg_throw_status(env,rv);
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill(JNIEnv * env, jobject jprocess)
-{
-  /* get the native instances from the java ones */
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-  if (not simgrid::ForcefulKillException::try_n_catch([&actor]() { actor->kill(); })) {
-    jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate(JNIEnv * env, jobject jprocess, jobject jhost)
-{
-  sg_actor_t actor = jprocess_to_native(jprocess, env);
-
-  if (not actor) {
-    jxbt_throw_notbound(env, "process", jprocess);
-    return;
-  }
-
-  sg_host_t host = jhost_get_native(env, jhost);
-
-  if (not host) {
-    jxbt_throw_notbound(env, "host", jhost);
-    return;
-  }
-
-  /* change the host of the actor */
-  actor->set_host(host);
-
-  /* change the host java side */
-  env->SetObjectField(jprocess, jprocess_field_Process_host, jhost);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_yield(JNIEnv* env, jclass cls)
-{
-  simgrid::s4u::this_actor::yield();
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdouble jkilltime) {
-  jprocess_to_native(jprocess, env)->set_kill_time((double)jkilltime);
-}
-
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
-  return (jint)sg_actor_count();
-}
diff --git a/src/bindings/java/jmsg_process.h b/src/bindings/java/jmsg_process.h
deleted file mode 100644 (file)
index 3f3679f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Functions related to the java process instances.                         */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef MSG_JPROCESS_H
-#define MSG_JPROCESS_H
-
-#include "simgrid/actor.h"
-#include <jni.h>
-
-SG_BEGIN_DECL;
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-// Cached java fields accessed by the rest of the code
-extern jfieldID jprocess_field_Process_pid;
-extern jfieldID jprocess_field_Process_ppid;
-
-/** Take a ref onto the java instance (to prevent its collection) */
-jobject jprocess_ref(jobject jprocess, JNIEnv* env);
-
-/** Release a ref onto the java instance */
-void jprocess_unref(jobject jprocess, JNIEnv* env);
-
-/** Binds a native instance to a java instance. */
-void jprocess_bind(jobject jprocess, const_sg_actor_t process, JNIEnv* env);
-
-/** Extract the java instance from the native one */
-jobject jprocess_from_native(const_sg_actor_t process);
-
-/** Extract the native instance from the java one */
-sg_actor_t jprocess_to_native(jobject jprocess, JNIEnv* env);
-
-/** Initialize the native world, called from the Java world at startup */
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jclass cls);
-
-/* Implement the Java API */
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject jprocess_arg, jobject jhostname);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv* env, jclass cls);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv* env, jclass cls, jint pid);
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_nativeGetPID(JNIEnv* env, jobject jprocess);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv* env, jobject jprocess, jobject jname);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getCurrentProcess(JNIEnv* env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_suspend(JNIEnv* env, jobject jprocess);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv* env, jobject jprocess);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setAutoRestart(JNIEnv* env, jobject jprocess, jboolean jauto_restart);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart(JNIEnv* env, jobject jprocess);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended(JNIEnv* env, jobject jprocess);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv* env, jclass cls, jlong jmillis, jint jnanos);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor(JNIEnv* env, jobject jprocess, jdouble jseconds);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill(JNIEnv* env, jobject jprocess);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate(JNIEnv* env, jobject jprocess, jobject jhost);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_yield(JNIEnv* env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime(JNIEnv* env, jobject jprocess, jdouble jkilltime);
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls);
-
-SG_END_DECL;
-#endif
diff --git a/src/bindings/java/jmsg_synchro.cpp b/src/bindings/java/jmsg_synchro.cpp
deleted file mode 100644 (file)
index 7932f4b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Java bindings of the Synchronization API.                                */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "jmsg_synchro.h"
-#include "jmsg.hpp"
-#include "jxbt_utilities.hpp"
-#include "simgrid/Exception.hpp"
-#include "simgrid/mutex.h"
-#include "simgrid/semaphore.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-static jfieldID jsynchro_field_Mutex_bind;
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeInit(JNIEnv *env, jclass cls) {
-  jsynchro_field_Mutex_bind = jxbt_get_sfield(env, "org/simgrid/msg/Mutex", "bind", "J");
-  xbt_assert(jsynchro_field_Mutex_bind, "Native initialization of msg/Mutex failed. Please report that bug");
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_init(JNIEnv * env, jobject obj) {
-  sg_mutex_t mutex = sg_mutex_init();
-
-  env->SetLongField(obj, jsynchro_field_Mutex_bind, (jlong)(uintptr_t)(mutex));
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_acquire(JNIEnv * env, jobject obj) {
-  auto mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
-  sg_mutex_lock(mutex);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_release(JNIEnv * env, jobject obj) {
-  sg_mutex_t mutex;
-
-  mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
-  sg_mutex_unlock(mutex);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeFinalize(JNIEnv * env, jobject obj) {
-  const_sg_mutex_t mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
-  sg_mutex_destroy(mutex);
-}
-
-static jfieldID jsynchro_field_Semaphore_bind;
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeInit(JNIEnv *env, jclass cls) {
-  jsynchro_field_Semaphore_bind = jxbt_get_sfield(env, "org/simgrid/msg/Semaphore", "bind", "J");
-  xbt_assert(jsynchro_field_Semaphore_bind, "Native initialization of msg/Semaphore failed. Please report that bug");
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_init(JNIEnv * env, jobject obj, jint capacity) {
-  sg_sem_t sem = sg_sem_init((int)capacity);
-
-  env->SetLongField(obj, jsynchro_field_Semaphore_bind, (jlong)(uintptr_t)(sem));
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_acquire(JNIEnv * env, jobject obj, jdouble timeout) {
-  sg_sem_t sem;
-
-  sem             = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  msg_error_t res = sg_sem_acquire_timeout(sem, (double)timeout) == 0 ? MSG_OK : MSG_TIMEOUT;
-  if (res != MSG_OK) {
-    jmsg_throw_status(env, res);
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_release(JNIEnv * env, jobject obj) {
-  sg_sem_t sem;
-
-  sem = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  sg_sem_release(sem);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Semaphore_wouldBlock(JNIEnv * env, jobject obj) {
-  sg_sem_t sem;
-
-  sem     = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  int res = sg_sem_would_block(sem);
-  return (jboolean) res;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * env, jobject obj) {
-  const_sg_sem_t sem;
-
-  sem = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  sg_sem_destroy(sem);
-}
diff --git a/src/bindings/java/jmsg_synchro.h b/src/bindings/java/jmsg_synchro.h
deleted file mode 100644 (file)
index aa6056a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Java bindings of the Synchronization API.                                */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef MSG_JSYNCHRO_H
-#define MSG_JSYNCHRO_H
-
-#include "xbt/base.h"
-#include <jni.h>
-
-SG_BEGIN_DECL
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeInit(JNIEnv *env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_init(JNIEnv * env, jobject obj);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_acquire(JNIEnv * env, jobject obj);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_release(JNIEnv * env, jobject obj);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeFinalize(JNIEnv * env, jobject obj);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeInit(JNIEnv *env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_init(JNIEnv * env, jobject obj, jint capacity);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_acquire(JNIEnv * env, jobject obj, jdouble timeout);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_release(JNIEnv * env, jobject obj);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Semaphore_wouldBlock(JNIEnv * env, jobject obj);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * env, jobject obj);
-
-SG_END_DECL
-#endif
diff --git a/src/bindings/java/jmsg_task.cpp b/src/bindings/java/jmsg_task.cpp
deleted file mode 100644 (file)
index eda7f82..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/* Functions related to the java task instances.                            */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/Exception.hpp"
-#include "simgrid/s4u/Host.hpp"
-
-#include "jmsg.hpp"
-#include "jmsg_host.h"
-#include "jmsg_process.h"
-#include "jmsg_task.h"
-#include "jxbt_utilities.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-static jmethodID jtask_method_Comm_constructor;
-
-static jfieldID jtask_field_Task_bind;
-static jfieldID jtask_field_Task_name;
-static jfieldID jtask_field_Task_messageSize;
-static jfieldID jtask_field_Comm_bind;
-static jfieldID jtask_field_Comm_taskBind;
-static jfieldID jtask_field_Comm_receiving;
-
-void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env)
-{
-  env->SetLongField(jtask, jtask_field_Task_bind, (intptr_t)task);
-}
-
-msg_task_t jtask_to_native(jobject jtask, JNIEnv* env)
-{
-  return (msg_task_t)(intptr_t)env->GetLongField(jtask, jtask_field_Task_bind);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls) {
-  jclass jtask_class_Comm = env->FindClass("org/simgrid/msg/Comm");
-  jclass jtask_class_Task = env->FindClass("org/simgrid/msg/Task");
-  xbt_assert(jtask_class_Comm && jtask_class_Task,
-             "Native initialization of msg/Comm or msg/Task failed. Please report that bug");
-
-  jtask_method_Comm_constructor = env->GetMethodID(jtask_class_Comm, "<init>", "()V");
-  jtask_field_Task_bind = jxbt_get_jfield(env, jtask_class_Task, "bind", "J");
-  jtask_field_Task_name = jxbt_get_jfield(env, jtask_class_Task, "name", "Ljava/lang/String;");
-  jtask_field_Task_messageSize = jxbt_get_jfield(env, jtask_class_Task, "messageSize", "D");
-  jtask_field_Comm_bind = jxbt_get_jfield(env, jtask_class_Comm, "bind", "J");
-  jtask_field_Comm_taskBind = jxbt_get_jfield(env, jtask_class_Comm, "taskBind", "J");
-  jtask_field_Comm_receiving = jxbt_get_jfield(env, jtask_class_Comm, "receiving", "Z");
-  xbt_assert(jtask_field_Task_bind && jtask_field_Comm_bind && jtask_field_Comm_taskBind &&
-                 jtask_field_Comm_receiving && jtask_method_Comm_constructor,
-             "Native initialization of msg/Task failed. Please report that bug");
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_create(JNIEnv * env, jobject jtask, jstring jname,
-                                      jdouble jflopsAmount, jdouble jbytesAmount)
-{
-  jstring_wrapper task_name(env, jname);
-  msg_task_t task = MSG_task_create(task_name, jflopsAmount, jbytesAmount, jtask);
-
-  /* bind & store the task */
-  jtask_bind(jtask, task, env);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv * env, jobject jtask, jstring jname,
-                                         jobjectArray jhosts, jdoubleArray jcomputeDurations_arg,
-                                         jdoubleArray jmessageSizes_arg)
-{
-  int host_count = env->GetArrayLength(jhosts);
-
-  jdouble* jcomputeDurations = env->GetDoubleArrayElements(jcomputeDurations_arg, nullptr);
-  auto* hosts                = new msg_host_t[host_count];
-  auto* computeDurations     = new double[host_count];
-  for (int index = 0; index < host_count; index++) {
-    jobject jhost           = env->GetObjectArrayElement(jhosts, index);
-    hosts[index] = jhost_get_native(env, jhost);
-    computeDurations[index] = jcomputeDurations[index];
-  }
-  env->ReleaseDoubleArrayElements(jcomputeDurations_arg, jcomputeDurations, 0);
-
-  jdouble* jmessageSizes = env->GetDoubleArrayElements(jmessageSizes_arg, nullptr);
-  auto* messageSizes     = new double[host_count * host_count];
-  for (int index = 0; index < host_count * host_count; index++) {
-    messageSizes[index] = jmessageSizes[index];
-  }
-  env->ReleaseDoubleArrayElements(jmessageSizes_arg, jmessageSizes, 0);
-
-  /* get the C string from the java string */
-  jstring_wrapper name(env, jname);
-  msg_task_t task  = MSG_parallel_task_create(name, host_count, hosts, computeDurations, messageSizes, jtask);
-
-  /* associate the java task object and the native task */
-  jtask_bind(jtask, task, env);
-
-  delete[] hosts;
-  delete[] computeDurations;
-  delete[] messageSizes;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel(JNIEnv * env, jobject jtask)
-{
-  msg_task_t ptask = jtask_to_native(jtask, env);
-
-  if (not ptask) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-
-  msg_error_t rv = MSG_task_cancel(ptask);
-  xbt_assert(rv == MSG_OK, "MSG_task_cancel() unexpectedly failed with error code %d. Please report this bug", rv);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute(JNIEnv * env, jobject jtask)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-  msg_error_t rv;
-  if (not simgrid::ForcefulKillException::try_n_catch([&rv, &task]() { rv = MSG_task_execute(task); })) {
-    jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
-  }
-
-  if (env->ExceptionOccurred())
-    return;
-  if (rv != MSG_OK) {
-    jmsg_throw_status(env, rv);
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound(JNIEnv * env, jobject jtask, jdouble bound)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-  MSG_task_set_bound(task, bound);
-}
-
-JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName(JNIEnv * env, jobject jtask) {
-  const_msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return nullptr;
-  }
-
-  return env->NewStringUTF(MSG_task_get_name(task));
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender(JNIEnv * env, jobject jtask) {
-  const_msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return nullptr;
-  }
-
-  auto const* process = MSG_task_get_sender(task);
-  if (process == nullptr) {
-    return nullptr;
-  }
-  return (jobject)jprocess_from_native(process);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource(JNIEnv * env, jobject jtask)
-{
-  const_msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return nullptr;
-  }
-
-  auto const* host = MSG_task_get_source(task);
-  if (host == nullptr) {
-    return nullptr;
-  }
-  if (not host->extension(JAVA_HOST_LEVEL)) {
-    jxbt_throw_jni(env, "MSG_task_get_source() failed");
-    return nullptr;
-  }
-
-  return (jobject) host->extension(JAVA_HOST_LEVEL);
-}
-
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv * env, jobject jtask)
-{
-  const_msg_task_t ptask = jtask_to_native(jtask, env);
-
-  if (not ptask) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return -1;
-  }
-  return (jdouble)MSG_task_get_flops_amount(ptask);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname) {
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-  jstring_wrapper name(env, static_cast<jstring>(jname));
-
-  env->SetObjectField(jtask, jtask_field_Task_name, jname);
-  MSG_task_set_name(task, name);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority(JNIEnv * env, jobject jtask, jdouble priority)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-  MSG_task_set_priority(task, priority);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jobject jtask, jdouble computationAmount)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-  MSG_task_set_flops_amount(task, computationAmount);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jobject jtask, jdouble dataSize)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-  env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize);
-  MSG_task_set_bytes_amount(task, dataSize);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobject jtask, jstring jalias,
-                                                             jdouble jtimeout,jdouble maxrate)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-
-  /* Add a global ref into the Ctask so that the receiver can use it */
-  MSG_task_set_data(task, env->NewGlobalRef(jtask));
-
-  jstring_wrapper alias(env, jalias);
-  msg_error_t res   = MSG_task_send_with_timeout_bounded(task, alias, jtimeout, maxrate);
-
-  if (res != MSG_OK)
-    jmsg_throw_status(env, res);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv* env, jclass cls, jstring jalias, jdouble jtimeout)
-{
-  msg_task_t task = nullptr;
-
-  jstring_wrapper alias(env, jalias);
-  msg_error_t rv;
-  if (not simgrid::ForcefulKillException::try_n_catch(
-          [&rv, &task, &alias, &jtimeout]() { rv = MSG_task_receive_with_timeout(&task, alias, (double)jtimeout); })) {
-    jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
-  }
-  if (env->ExceptionOccurred())
-    return nullptr;
-  if (rv != MSG_OK) {
-    jmsg_throw_status(env, rv);
-    return nullptr;
-  }
-  auto jtask_global = (jobject)MSG_task_get_data(task);
-
-  /* Convert the global ref into a local ref so that the JVM can free the stuff */
-  jobject jtask_local = env->NewLocalRef(jtask_global);
-  env->DeleteGlobalRef(jtask_global);
-  MSG_task_set_data(task, nullptr);
-
-  return (jobject) jtask_local;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox) {
-  jclass comm_class = env->FindClass("org/simgrid/msg/Comm");
-  if (not comm_class)
-    return nullptr;
-
-  //pointer to store the task object pointer.
-  auto* task = new msg_task_t(nullptr);
-  /* There should be a cache here */
-
-  jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
-  if (not jcomm) {
-    jxbt_throw_jni(env, "Can't create a Comm object.");
-    return nullptr;
-  }
-
-  jstring_wrapper mailbox(env, jmailbox);
-  msg_comm_t comm     = MSG_task_irecv(task, mailbox);
-
-  env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
-  env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
-  env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
-
-  return jcomm;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv* env, jclass cls, jstring jalias,
-                                                                   jdouble jtimeout, jdouble rate)
-{
-  msg_task_t task = nullptr;
-
-  jstring_wrapper alias(env, jalias);
-  msg_error_t res   = MSG_task_receive_with_timeout_bounded(&task, alias, jtimeout, rate);
-  if (env->ExceptionOccurred())
-    return nullptr;
-  if (res != MSG_OK) {
-    jmsg_throw_status(env, res);
-    return nullptr;
-  }
-  auto jtask_global = (jobject)MSG_task_get_data(task);
-
-  /* Convert the global ref into a local ref so that the JVM can free the stuff */
-  jobject jtask_local = env->NewLocalRef(jtask_global);
-  env->DeleteGlobalRef(jtask_global);
-  MSG_task_set_data(task, nullptr);
-
-  return (jobject) jtask_local;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls, jstring jmailbox,
-                                                                 jdouble rate)
-{
-  jclass comm_class = env->FindClass("org/simgrid/msg/Comm");
-  if (not comm_class)
-    return nullptr;
-
-  // pointer to store the task object pointer.
-  auto* task = new msg_task_t(nullptr);
-
-  jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
-  if (not jcomm) {
-    jxbt_throw_jni(env, "Can't create a Comm object.");
-    return nullptr;
-  }
-
-  jstring_wrapper mailbox(env, jmailbox);
-  msg_comm_t comm     = MSG_task_irecv_bounded(task, mailbox, rate);
-
-  env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
-  env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
-  env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
-
-  return jcomm;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox)
-{
-  msg_comm_t comm;
-
-  jclass comm_class = env->FindClass("org/simgrid/msg/Comm");
-
-  if (not comm_class)
-    return nullptr;
-
-  jobject jcomm       = env->NewObject(comm_class, jtask_method_Comm_constructor);
-  jstring_wrapper mailbox(env, jmailbox);
-
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    env->DeleteLocalRef(jcomm);
-    jxbt_throw_notbound(env, "task", jtask);
-        return nullptr;
-  }
-
-  MSG_task_set_data(task, env->NewGlobalRef(jtask));
-  comm = MSG_task_isend(task,mailbox);
-
-  env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
-  env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(nullptr));
-  env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_FALSE);
-
-  return jcomm;
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox,
-                                                                 jdouble maxrate)
-{
-  msg_task_t task;
-  jobject jcomm;
-  msg_comm_t comm;
-
-  jclass comm_class = env->FindClass("org/simgrid/msg/Comm");
-  if (not comm_class)
-    return nullptr;
-
-  jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
-  jstring_wrapper mailbox(env, jmailbox);
-
-  task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    env->DeleteLocalRef(jcomm);
-    jxbt_throw_notbound(env, "task", jtask);
-        return nullptr;
-  }
-
-  MSG_task_set_data(task, env->NewGlobalRef(jtask));
-  comm = MSG_task_isend_bounded(task,mailbox,maxrate);
-
-  env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
-  env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(nullptr));
-  env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_FALSE);
-
-  return jcomm;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask)
-{
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-    }
-
-    MSG_task_destroy(task);
-}
-
-static void msg_task_cancel_on_failed_dsend(void*t) {
-  auto task       = (msg_task_t)t;
-  JNIEnv* env     = get_current_thread_env();
-  if (env) {
-    auto jtask_global = (jobject)MSG_task_get_data(task);
-    /* Destroy the global ref so that the JVM can free the stuff */
-    env->DeleteGlobalRef(jtask_global);
-    /* Don't free the C data here, to avoid a race condition with the GC also sometimes doing so.
-     * A rare memleak is seen as preferable to a rare "free(): invalid pointer" failure that
-     * proves really hard to debug.
-     */
-  }
-  MSG_task_set_data(task, nullptr);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask, jstring jalias)
-{
-  jstring_wrapper alias(env, jalias);
-
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-
-  /* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
-  MSG_task_set_data(task, env->NewGlobalRef(jtask));
-  MSG_task_dsend(task, alias, msg_task_cancel_on_failed_dsend);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask, jstring jalias,
-                                                              jdouble maxrate)
-{
-  jstring_wrapper alias(env, jalias);
-
-  msg_task_t task = jtask_to_native(jtask, env);
-
-  if (not task) {
-    jxbt_throw_notbound(env, "task", jtask);
-    return;
-  }
-
-  /* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
-  MSG_task_set_data(task, env->NewGlobalRef(jtask));
-  MSG_task_dsend_bounded(task, alias, msg_task_cancel_on_failed_dsend, maxrate);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv * env, jclass cls, jstring jalias)
-{
-  jstring_wrapper alias(env, jalias);
-  return (jboolean)MSG_task_listen(alias);
-}
-
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass cls, jstring jalias)
-{
-  jstring_wrapper alias(env, jalias);
-  return (jint)MSG_task_listen_from(alias);
-}
diff --git a/src/bindings/java/jmsg_task.h b/src/bindings/java/jmsg_task.h
deleted file mode 100644 (file)
index 2cb5488..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Functions related to the java task instances.                            */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef MSG_JTASK_H
-#define MSG_JTASK_H
-
-#include <jni.h>
-#include "simgrid/msg.h"
-
-SG_BEGIN_DECL
-
-/** Binds a native instance to a java instance. */
-void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
-
-/** Extract the native instance from the java one */
-msg_task_t jtask_to_native(jobject jtask, JNIEnv* env);
-
-/** Initialize the native world, called from the Java world at startup */
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeInit(JNIEnv* env, jclass cls);
-
-/* Implement the Java API */
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_create(JNIEnv* env, jobject jtask, jstring jname,
-                                                        jdouble jcomputeDuration, jdouble jmessageSize);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv* env, jobject jtask);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv* env, jobject jtask,  jstring jname,
-                                                                jobjectArray jhosts, jdoubleArray jcomputeDurations_arg,
-                                                                jdoubleArray jmessageSizes);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel(JNIEnv* env, jobject jtask);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute(JNIEnv* env, jobject jtask);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound(JNIEnv* env, jobject jtask, jdouble bound);
-JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName(JNIEnv* env, jobject jtask);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv* env, jobject jtask, jobject jname);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender(JNIEnv* env, jobject jtask);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource(JNIEnv* env, jobject jtask);
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv* env, jobject jtask);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority(JNIEnv* env, jobject jtask, jdouble prioriy);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount(JNIEnv* env, jobject jtask, jdouble computationAmount);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount(JNIEnv* env, jobject jtask, jdouble dataSize);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv* env, jobject jtask, jstring jalias,
-                                                             jdouble  jtimeout, jdouble maxrate);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv* env, jclass cls, jstring jalias, jdouble jtimeout);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv* env, jclass cls, jstring jmailbox);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv* env, jclass cls, jstring jalias,
-                                                                   jdouble jtimeout, jdouble rate);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv* env, jclass cls, jstring jmailbox,
-                                                                 jdouble rate);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isend(JNIEnv* env, jobject jtask, jstring jmailbox);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isendBounded(JNIEnv* env, jobject jtask, jstring jmailbox,
-                                                                 jdouble maxrate);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsend(JNIEnv* env, jobject jtask, jstring jalias);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsendBounded(JNIEnv* env, jobject jtask, jstring jalias,
-                                                              jdouble maxrate);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv* env, jclass cls, jstring jalias);
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv* env, jclass cls, jstring jalias);
-
-SG_END_DECL
-#endif
diff --git a/src/bindings/java/jmsg_vm.cpp b/src/bindings/java/jmsg_vm.cpp
deleted file mode 100644 (file)
index a9174ba..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/* Functions related to the Virtual Machines.                               */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "jmsg_vm.h"
-#include "jmsg_host.h"
-#include "jxbt_utilities.hpp"
-#include "simgrid/Exception.hpp"
-#include "simgrid/plugins/live_migration.h"
-#include "src/kernel/resource/VirtualMachineImpl.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-
-extern int JAVA_HOST_LEVEL;
-static jfieldID jvm_field_bind;
-
-void jvm_bind(JNIEnv* env, jobject jvm, sg_vm_t vm)
-{
-  env->SetLongField(jvm, jvm_field_bind, (intptr_t)vm);
-}
-
-sg_vm_t jvm_get_native(JNIEnv* env, jobject jvm)
-{
-  return (sg_vm_t)(intptr_t)env->GetLongField(jvm, jvm_field_bind);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass cls)
-{
-  jclass jprocess_class_VM = env->FindClass("org/simgrid/msg/VM");
-  jvm_field_bind = jxbt_get_jfield(env, jprocess_class_VM, "bind", "J");
-  xbt_assert(jvm_field_bind, "Native initialization of msg/VM failed. Please report that bug");
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isCreated(JNIEnv* env, jobject jvm)
-{
-  const_sg_vm_t vm = jvm_get_native(env, jvm);
-  return sg_vm_is_created(vm);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isRunning(JNIEnv* env, jobject jvm)
-{
-  const_sg_vm_t vm = jvm_get_native(env, jvm);
-  return sg_vm_is_running(vm);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isMigrating(JNIEnv* env, jobject jvm)
-{
-  const_sg_vm_t vm = jvm_get_native(env, jvm);
-  return sg_vm_is_migrating(vm);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isSuspended(JNIEnv* env, jobject jvm)
-{
-  const_sg_vm_t vm = jvm_get_native(env, jvm);
-  return sg_vm_is_suspended(vm);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jdouble bound)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  sg_vm_set_bound(vm, bound);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv* env, jobject jVm, jobject jHost, jstring jname,
-                                                      jint coreAmount, jint jramsize, jint jmig_netspeed,
-                                                      jint jdp_intensity)
-{
-  sg_host_t host = jhost_get_native(env, jHost);
-
-  jstring_wrapper name(env, jname);
-  sg_vm_t vm       = sg_vm_create_migratable(host, name, static_cast<int>(coreAmount), static_cast<int>(jramsize),
-                                       static_cast<int>(jmig_netspeed), static_cast<int>(jdp_intensity));
-
-  jvm_bind(env, jVm, vm);
-  jVm = env->NewGlobalRef(jVm);
-  // We use the extension level of the host, even if that's somehow disturbing
-  vm->extension_set(JAVA_HOST_LEVEL, jVm);
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_VM_all(JNIEnv* env, jclass cls_arg)
-{
-  sg_host_t* hosts  = sg_host_list();
-  size_t host_count = sg_host_count();
-  std::vector<jobject> vms;
-
-  for (size_t i = 0; i < host_count; i++) {
-    const auto* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(hosts[i]);
-    if (vm != nullptr && vm->get_state() != simgrid::s4u::VirtualMachine::State::DESTROYED) {
-      auto jvm = static_cast<jobject>(vm->extension(JAVA_HOST_LEVEL));
-      vms.push_back(jvm);
-    }
-  }
-  xbt_free(hosts);
-
-  vms.shrink_to_fit();
-  int count = vms.size();
-
-  jclass cls = jxbt_get_class(env, "org/simgrid/msg/VM");
-  if (not cls)
-    return nullptr;
-
-  jobjectArray jtable = env->NewObjectArray((jsize)count, cls, nullptr);
-  if (not jtable) {
-    jxbt_throw_jni(env, "Hosts table allocation failed");
-    return nullptr;
-  }
-
-  for (int index = 0; index < count; index++) {
-    jobject jhost = vms.at(index);
-    env->SetObjectArrayElement(jtable, index, jhost);
-  }
-  return jtable;
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv *env, jobject jvm)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  sg_vm_destroy(vm);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_start(JNIEnv *env, jobject jvm)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  sg_vm_start(vm);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  if (vm)
-    sg_vm_shutdown(vm);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_destroy(JNIEnv* env, jobject jvm)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  if (vm) {
-    sg_vm_destroy(vm);
-    auto* vmList = &simgrid::kernel::resource::VirtualMachineImpl::allVms_;
-    vmList->erase(std::remove(vmList->begin(), vmList->end(), vm), vmList->end());
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeMigration(JNIEnv* env, jobject jvm, jobject jhost)
-{
-  sg_vm_t vm     = jvm_get_native(env, jvm);
-  sg_host_t host = jhost_get_native(env, jhost);
-  if (not simgrid::ForcefulKillException::try_n_catch([&vm, &host]() { sg_vm_migrate(vm, host); })) {
-    XBT_VERB("Caught exception during migration");
-    jxbt_throw_host_failure(env, " during migration");
-  }
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_suspend(JNIEnv *env, jobject jvm)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  sg_vm_suspend(vm);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_resume(JNIEnv *env, jobject jvm)
-{
-  sg_vm_t vm = jvm_get_native(env, jvm);
-  sg_vm_resume(vm);
-}
-
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclass cls, jstring jname)
-{
-  /* get the C string from the java string */
-  if (jname == nullptr) {
-    jxbt_throw_null(env, "No VM can have a null name");
-    return nullptr;
-  }
-  jstring_wrapper name(env, jname);
-  /* get the VM by name   (VMs are just special hosts, unfortunately) */
-  auto const* host = sg_host_by_name(name);
-
-  if (not host) { /* invalid name */
-    jxbt_throw_host_not_found(env, name);
-    return nullptr;
-  }
-
-  return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
-}
diff --git a/src/bindings/java/jmsg_vm.h b/src/bindings/java/jmsg_vm.h
deleted file mode 100644 (file)
index 461fd53..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Functions related to the Virtual Machines.                               */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef MSG_VM_H
-#define MSG_VM_H
-
-#include "simgrid/host.h"
-#include "simgrid/vm.h"
-#include <jni.h>
-
-SG_BEGIN_DECL
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-void jvm_bind(JNIEnv* env, jobject jvm, sg_vm_t vm);
-sg_vm_t jvm_get_native(JNIEnv* env, jobject jvm);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeInit(JNIEnv* env, jclass cls);
-
-JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_VM_all(JNIEnv* env, jclass cls_arg);
-
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isCreated(JNIEnv* env, jobject jvm);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isRunning(JNIEnv* env, jobject jvm);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isMigrating(JNIEnv* env, jobject jvm);
-JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_VM_isSuspended(JNIEnv* env, jobject jvm);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_setBound(JNIEnv* env, jobject jvm, jdouble bound);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv* env, jobject jvm, jobject jhost, jstring jname,
-                                                      jint coreAmount, jint jramsize, jint dprate, jint mig_netspeed);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclass cls, jstring jname);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv* env, jobject jvm);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_start(JNIEnv* env, jobject jvm);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeMigration(JNIEnv* env, jobject jvm, jobject jhost);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_suspend(JNIEnv* env, jobject jvm);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_resume(JNIEnv* env, jobject jvm);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv* env, jobject jvm);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_destroy(JNIEnv* env, jobject jvm);
-
-SG_END_DECL
-
-#endif
diff --git a/src/bindings/java/jtrace.cpp b/src/bindings/java/jtrace.cpp
deleted file mode 100644 (file)
index e92e7d4..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Java bindings of the Trace API.                                          */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "jtrace.h"
-#include "jxbt_utilities.hpp"
-#include "simgrid/instr.h"
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
-{
-  jstring_wrapper s(env, js);
-  TRACE_host_state_declare(s);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclareValue (JNIEnv *env, jclass cls, jstring js_state,
-                                                                           jstring js_value, jstring js_color)
-{
-  jstring_wrapper state(env, js_state);
-  jstring_wrapper value(env, js_value);
-  jstring_wrapper color(env, js_color);
-
-  TRACE_host_state_declare_value(state, value, color);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostSetState (JNIEnv *env, jclass cls, jstring js_host,
-                                                                  jstring js_state, jstring js_value)
-{
-  jstring_wrapper host(env, js_host);
-  jstring_wrapper state(env, js_state);
-  jstring_wrapper value(env, js_value);
-
-  TRACE_host_set_state(host, state, value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPushState (JNIEnv *env, jclass cls, jstring js_host,
-                                                                   jstring js_state, jstring js_value)
-{
-  jstring_wrapper host(env, js_host);
-  jstring_wrapper state(env, js_state);
-  jstring_wrapper value(env, js_value);
-
-  TRACE_host_push_state(host, state, value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPopState (JNIEnv *env, jclass cls, jstring js_host,
-                                                                  jstring js_state)
-{
-  jstring_wrapper host(env, js_host);
-  jstring_wrapper state(env, js_state);
-
-  TRACE_host_pop_state(host, state);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableDeclare(JNIEnv* env, jclass cls, jstring js_variable)
-{
-  jstring_wrapper variable(env, js_variable);
-  simgrid::instr::declare_host_variable(variable);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSet(JNIEnv* env, jclass cls, jstring js_host,
-                                                                    jstring js_variable, jdouble value)
-{
-  jstring_wrapper host(env, js_host);
-  jstring_wrapper variable(env, js_variable);
-
-  simgrid::instr::set_host_variable(host, variable, value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableAdd(JNIEnv* env, jclass cls, jstring js_host,
-                                                                    jstring js_variable, jdouble value)
-{
-  jstring_wrapper host(env, js_host);
-  jstring_wrapper variable(env, js_variable);
-
-  simgrid::instr::add_host_variable(host, variable, value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSub(JNIEnv* env, jclass cls, jstring js_host,
-                                                                    jstring js_variable, jdouble value)
-{
-  jstring_wrapper host(env, js_host);
-  jstring_wrapper variable(env, js_variable);
-
-  simgrid::instr::sub_host_variable(host, variable, value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_vmVariableDeclare(JNIEnv* env, jclass cls, jstring js_variable)
-{
-  jstring_wrapper variable(env, js_variable);
-  simgrid::instr::declare_vm_variable(variable);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_vmVariableSet(JNIEnv* env, jclass cls, jstring js_vm,
-                                                                  jstring js_variable, jdouble value)
-{
-  jstring_wrapper vm(env, js_vm);
-  jstring_wrapper variable(env, js_variable);
-
-  simgrid::instr::set_vm_variable(vm, variable, value);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableDeclare (JNIEnv *env, jclass cls, jstring jvar) {
-  jstring_wrapper variable(env, jvar);
-  simgrid::instr::declare_link_variable(variable);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableDeclareWithColor (JNIEnv *env, jclass cls, jstring jvar, jstring jcolor) {
-  jstring_wrapper variable(env, jvar);
-  jstring_wrapper color(env, jcolor);
-  simgrid::instr::declare_link_variable(variable, color);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSet (JNIEnv *env, jclass cls, jstring jlink, jstring jvar, jdouble jvalue) {
-  jstring_wrapper link(env, jlink);
-  jstring_wrapper variable(env, jvar);
-  simgrid::instr::set_link_variable(link, variable, jvalue);
-}
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
-  (JNIEnv *env, jclass cls, jstring jsrc, jstring jdst, jstring jvar, jdouble jval)
-{
-  jstring_wrapper src(env, jsrc);
-  jstring_wrapper dst(env, jdst);
-
-  jstring_wrapper variable(env, jvar);
-  simgrid::instr::set_link_variable(src, dst, variable, jval);
-}
diff --git a/src/bindings/java/jtrace.h b/src/bindings/java/jtrace.h
deleted file mode 100644 (file)
index c4f5380..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Java bindings of the Trace API.                                          */
-
-/* Copyright (c) 2012-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <jni.h>
-/* Header for class org_simgrid_trace_Trace */
-
-#ifndef Included_org_simgrid_trace_Trace
-#define Included_org_simgrid_trace_Trace
-
-/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
-#ifndef JNIEXPORT
-#define JNIEXPORT
-#endif
-#ifndef JNICALL
-#define JNICALL
-#endif
-/* end of eclipse-mandated pimple */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableDeclare (JNIEnv *env, jclass cls, jstring jvar);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_vmVariableDeclare (JNIEnv *env, jclass cls, jstring jvar);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSet (JNIEnv *env, jclass cls, jstring js_host,
-                                                                     jstring jvar, jdouble value);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_vmVariableSet (JNIEnv *env, jclass cls, jstring js_wn,
-                                                                   jstring jvar, jdouble value);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableAdd (JNIEnv *env, jclass cls, jstring js_host,
-                                                                     jstring jvar, jdouble value);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSub (JNIEnv *env, jclass cls, jstring js_host,
-                                                                     jstring jvar, jdouble value);
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableDeclare (JNIEnv *env, jclass cls, jstring jvar);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableDeclareWithColor (JNIEnv *env, jclass cls, jstring jvar,
-                                                                                  jstring jcolor);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSet (JNIEnv *env, jclass cls, jstring jlink,
-                                                                     jstring jvar, jdouble jvalue);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet (JNIEnv *env, jclass cls, jstring jsrc,
-                                                                           jstring jdst, jstring jvar, jdouble jvalue);
-
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclareValue (JNIEnv *env, jclass cls, jstring js_state,
-                                                                           jstring js_value, jstring js_color);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostSetState (JNIEnv *env, jclass cls, jstring js_host,
-                                                                  jstring js_state, jstring js_value);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPushState (JNIEnv *env, jclass cls, jstring js_host,
-                                                                   jstring js_state, jstring js_value);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPopState (JNIEnv *env, jclass cls, jstring js_host,
-                                                                  jstring js_state);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/bindings/java/jxbt_utilities.cpp b/src/bindings/java/jxbt_utilities.cpp
deleted file mode 100644 (file)
index 4e11f74..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Various JNI helper functions                                             */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "jxbt_utilities.hpp"
-#include "xbt/string.hpp"
-#include "xbt/sysdep.h"
-
-jclass jxbt_get_class(JNIEnv * env, const char *name)
-{
-  jclass cls = env->FindClass(name);
-  if (not cls) {
-    jxbt_throw_jni(env, std::string("Class ") + name + " not found");
-    return nullptr;
-  }
-
-  return cls;
-}
-
-jmethodID jxbt_get_jmethod(JNIEnv * env, jclass cls, const char *name, const char *signature)
-{
-  if (not cls)
-    return nullptr;
-
-  jmethodID id = env->GetMethodID(cls, name, signature);
-  if (not id) {
-    jmethodID tostr_id = env->GetMethodID(cls, "getName", "()Ljava/lang/String;");
-    auto jclassname    = (jstring)env->CallObjectMethod(cls, tostr_id, nullptr);
-    jstring_wrapper classname(env, jclassname);
-    auto msg = std::string("Cannot find method") + name + "(" + signature + ") in " + classname.value;
-
-    jxbt_throw_jni(env, msg);
-    return nullptr;
-  }
-
-  return id;
-}
-
-jmethodID jxbt_get_static_jmethod(JNIEnv * env, jclass cls, const char *name, const char *signature)
-{
-  if (not cls)
-    return nullptr;
-
-  jmethodID id = env->GetStaticMethodID(cls, name, signature);
-  if (not id) {
-    jmethodID tostr_id = env->GetMethodID(cls, "getName", "()Ljava/lang/String;");
-    auto jclassname       = (jstring)env->CallObjectMethod(cls, tostr_id, nullptr);
-    jstring_wrapper classname(env, jclassname);
-    auto msg = std::string("Cannot find static method") + name + "(" + signature + ") in " + classname.value;
-
-    jxbt_throw_jni(env, msg);
-    return nullptr;
-  }
-
-  return id;
-}
-
-jmethodID jxbt_get_static_smethod(JNIEnv * env, const char *classname, const char *name, const char *signature)
-{
-  jclass cls = jxbt_get_class(env, classname);
-  if (not cls)
-    return nullptr;
-
-  jmethodID id = env->GetStaticMethodID(cls, name, signature);
-  if (not id) {
-    jxbt_throw_jni(env, std::string("Cannot find static method") + name + "(" + signature + ") in " + classname);
-    return nullptr;
-  }
-  return id;
-}
-
-jmethodID jxbt_get_smethod(JNIEnv * env, const char *classname, const char *name, const char *signature)
-{
-  jclass cls = jxbt_get_class(env, classname);
-  if (not cls)
-    return nullptr;
-
-  jmethodID id = env->GetMethodID(cls, name, signature);
-  if (not id) {
-    jxbt_throw_jni(env, std::string("Cannot find method") + name + "(" + signature + ") in " + classname);
-    return nullptr;
-  }
-  return id;
-}
-
-jfieldID jxbt_get_jfield(JNIEnv * env, jclass cls, const char *name, const char *signature)
-{
-  if (not cls)
-    return nullptr;
-
-  jfieldID id = env->GetFieldID(cls, name, signature);
-  if (not id) {
-    jmethodID getname_id = env->GetMethodID(cls, "getName", "()Ljava/lang/String;");
-    auto jclassname       = (jstring)env->CallObjectMethod(cls, getname_id, nullptr);
-    const char* classname = env->GetStringUTFChars(jclassname, nullptr);
-
-    env->ReleaseStringUTFChars(jclassname, classname);
-
-    jxbt_throw_jni(env, std::string("Cannot find field") + signature + " " + name + " in " + classname);
-
-    return nullptr;
-  }
-
-  return id;
-}
-
-jfieldID jxbt_get_sfield(JNIEnv * env, const char *classname, const char *name, const char *signature)
-{
-  jclass cls = jxbt_get_class(env, classname);
-  if (not cls)
-    return nullptr;
-
-  jfieldID id = env->GetFieldID(cls, name, signature);
-  if (not id) {
-    jxbt_throw_jni(env, std::string("Cannot find field") + signature + " " + name + " in " + classname);
-    return nullptr;
-  }
-
-  return id;
-}
-
-void jxbt_throw_by_name(JNIEnv* env, const char* name, const std::string& msg)
-{
-  jclass cls = env->FindClass(name);
-
-  xbt_assert(cls, "%s (Plus severe error: class %s not found)\n", msg.c_str(), name);
-
-  env->ThrowNew(cls, msg.c_str());
-}
-
-void jxbt_throw_jni(JNIEnv* env, const std::string& msg)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/JniException", "Internal or JNI error: " + msg);
-}
-
-void jxbt_throw_notbound(JNIEnv* env, const std::string& kind, void* pointer)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/JniException",
-                     simgrid::xbt::string_printf("Internal error: %s %p not bound", kind.c_str(), pointer));
-}
-
-void jxbt_throw_null(JNIEnv* env, const std::string& msg)
-{
-  jxbt_throw_by_name(env, "java/lang/NullPointerException", msg);
-}
-
-void jxbt_throw_illegal(JNIEnv* env, const std::string& msg)
-{
-  jxbt_throw_by_name(env, "java/lang/IllegalArgumentException", msg);
-}
-
-void jxbt_throw_host_not_found(JNIEnv* env, const std::string& invalid_name)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/HostNotFoundException", "No such host: " + invalid_name);
-}
-
-void jxbt_throw_process_not_found(JNIEnv* env, const std::string& invalid_name)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/ProcessNotFoundException", "No such process: " + invalid_name);
-}
-
-void jxbt_throw_transfer_failure(JNIEnv* env, const std::string& details)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/TransferFailureException", details);
-}
-
-void jxbt_throw_host_failure(JNIEnv* env, const std::string& details)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/HostFailureException", "Host Failure" + details);
-}
-
-void jxbt_throw_time_out_failure(JNIEnv* env, const std::string& details)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/TimeoutException", details);
-}
-
-void jxbt_throw_task_cancelled(JNIEnv* env, const std::string& details)
-{
-  jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
-}
diff --git a/src/bindings/java/jxbt_utilities.hpp b/src/bindings/java/jxbt_utilities.hpp
deleted file mode 100644 (file)
index 4209f53..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Various JNI helper functions                                             */
-
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef JXBT_UTILITIES_HPP
-#define JXBT_UTILITIES_HPP
-
-#include <cstdint>
-#include <jni.h>
-#include <string>
-
-/* Search a class and throw an exception if not found */
-jclass jxbt_get_class(JNIEnv* env, const char* name);
-
-/* Search a method in a class and throw an exception if not found(it's ok to to pass a NULL class: it's a noop) */
-jmethodID jxbt_get_jmethod(JNIEnv* env, jclass cls, const char* name, const char* signature);
-
-/* Like the jxbt_get_class() but get a static method */
-jmethodID jxbt_get_static_jmethod(JNIEnv* env, jclass cls, const char* name, const char* signature);
-
-/* Search a field in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jfieldID jxbt_get_jfield(JNIEnv* env, jclass cls, const char* name, const char* signature);
-
-/* Search a method in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jmethodID jxbt_get_smethod(JNIEnv* env, const char* classname, const char* name, const char* signature);
-
-/* Like the jxbt_get_smethod() but get a static method */
-jmethodID jxbt_get_static_smethod(JNIEnv* env, const char* classname, const char* name, const char* signature);
-
-/* Search a field in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jfieldID jxbt_get_sfield(JNIEnv* env, const char* classname, const char* name, const char* signature);
-
-/* Throws an exception according to its name */
-void jxbt_throw_by_name(JNIEnv* env, const char* name, const std::string& msg);
-/** Thrown on internal error of this layer, or on problem with JNI */
-void jxbt_throw_jni(JNIEnv* env, const std::string& msg);
-/** Thrown when using an object not bound to a native one where it should, or reverse (kinda JNI issue) */
-void jxbt_throw_notbound(JNIEnv* env, const std::string& kind, void* pointer);
-/** Thrown if NULL gets used */
-void jxbt_throw_null(JNIEnv* env, const std::string& msg);
-
-/** Thrown on illegal arguments */
-void jxbt_throw_illegal(JNIEnv* env, const std::string& msg);
-/** Thrown when looking for a host from name does not lead to anything */
-void jxbt_throw_host_not_found(JNIEnv* env, const std::string& invalid_name);
-/** Thrown when looking for a host from name does not lead to anything */
-void jxbt_throw_process_not_found(JNIEnv* env, const std::string& invalid_name);
-/** Thrown when a transfer failure occurs while Sending task */
-void jxbt_throw_transfer_failure(JNIEnv* env, const std::string& detail);
-/** Thrown when a host failure occurs while Sending a task*/
-void jxbt_throw_host_failure(JNIEnv* env, const std::string& details);
-/** Thrown when a timeout occurs while Sending a task */
-void jxbt_throw_time_out_failure(JNIEnv* env, const std::string& details);
-/**Thrown when a task is canceled */
-void jxbt_throw_task_cancelled(JNIEnv* env, const std::string& details);
-
-class jstring_wrapper {
-  JNIEnv* env_  = nullptr;
-  jstring jstr_ = nullptr;
-
-public:
-  const char* value = nullptr;
-
-  jstring_wrapper(JNIEnv* env, jstring jstr) : env_(env), jstr_(jstr)
-  {
-    if (jstr != nullptr)
-      value = env_->GetStringUTFChars(jstr_, nullptr);
-  }
-  void reset(JNIEnv* env, jstring jstr)
-  {
-    if (jstr_ != nullptr)
-      env_->ReleaseStringUTFChars(jstr_, value);
-    env_  = env;
-    jstr_ = jstr;
-    if (jstr != nullptr)
-      value = env_->GetStringUTFChars(jstr_, nullptr);
-  }
-  ~jstring_wrapper()
-  {
-    if (jstr_ != nullptr)
-      env_->ReleaseStringUTFChars(jstr_, value);
-  }
-  operator const char*() const { return value; }
-  operator const std::string() const { return value; }
-};
-
-#endif
diff --git a/src/bindings/java/org/simgrid/NativeLib.java b/src/bindings/java/org/simgrid/NativeLib.java
deleted file mode 100644 (file)
index ace8ca7..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/* Copyright (c) 2014-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.stream.Stream;
-
-/** Helper class loading the native functions of SimGrid that we use for downcalls
- *
- * Almost all org.simgrid.msg.* classes contain a static block (thus executed when the class is loaded)
- * containing a call to this.
- */
-public final class NativeLib {
-       private static final boolean WINDOWS_OS = System.getProperty("os.name").toLowerCase().startsWith("win");
-       private static boolean isNativeInited = false;
-       private static Path tempDir = null; // where the embeeded libraries are unpacked before loading them
-
-       /** A static-only "class" don't need no constructor */
-       private NativeLib() {
-               throw new IllegalAccessError("Utility class");
-       }
-
-       /** Hidden debug main() function
-        *
-        * It is not the Main-Class defined in src/bindings/java/MANIFEST.in (org.simgrid.msg.Msg is),
-        * so it won't get executed by default. But that's helpful to debug linkage errors, if you
-        * know that it exists. It's used by cmake during the configure, to inform the user.
-        */
-       public static void main(String[] args) {
-               System.out.println("This jarfile searches the native code under: " +getPath());
-       }
-
-       /** Main function loading all the native classes that we need */
-       public static void nativeInit() {
-               if (isNativeInited)
-                       return;
-
-               if (WINDOWS_OS)
-                       NativeLib.nativeInit("winpthread-1");
-
-               NativeLib.nativeInit("simgrid");
-               NativeLib.nativeInit("simgrid-java");
-               isNativeInited = true;
-
-                /* Don't leak the files on disk */
-                if (tempDir != null) {
-                  FileCleaner fclean = new FileCleaner(tempDir.toFile());
-                  fclean.run();
-                }
-       }
-
-       /** Helper function trying to load one requested library */
-       public static void nativeInit(String name) {
-               Throwable cause = null;
-               try {
-                       /* Prefer the version of the library bundled into the jar file and use it */
-                       if (loadLibAsStream(name))
-                               return;
-               } catch (UnsatisfiedLinkError|SecurityException|IOException e) {
-                       cause = e;
-               }
-
-               /* If not found, try to see if we can find a version on disk */
-               try {
-                       System.loadLibrary(name);
-                       return;
-               } catch (UnsatisfiedLinkError systemException) { /* don't care */ }
-
-               System.err.println("\nCannot load the bindings to the "+name+" library in path "+getPath()+" and no usable SimGrid installation found on disk.");
-               if (cause != null) {
-                       if (cause.getMessage().contains("libcgraph.so"))
-                               System.err.println("HINT: Try to install the libcgraph package (sudo apt-get install libcgraph).");
-                       else if (cause.getMessage().contains("libboost_context.so"))
-                               System.err.println("HINT: Try to install the boost-context package (sudo apt-get install libboost-context-dev).");
-                       else
-                               System.err.println("Try to install the missing dependencies, if any. Read carefully the following error message.");
-
-                       System.err.println();
-                       cause.printStackTrace();
-               } else {
-                       System.err.println("This jar file does not seem to fit your system, and no usable SimGrid installation found on disk for "+name+".");
-               }
-               System.exit(1);
-       }
-
-       /** Try to extract the library from the jarfile before loading it */
-       private static boolean loadLibAsStream (String name) throws IOException, UnsatisfiedLinkError {
-               String path = NativeLib.getPath();
-
-               // We must write the lib onto the disk before loading it -- stupid operating systems
-               if (tempDir == null) {
-                       final String tempPrefix = "simgrid-java-";
-
-                       if (WINDOWS_OS) {
-                               // The cleanup at exit fails on Windows where it is impossible to delete files which are still in
-                               // use.  Try to remove stale temporary files from previous executions, and limit disk usage.
-                               Path tmpdir = (new File(System.getProperty("java.io.tmpdir"))).toPath();
-                               try (Stream<Path> paths = Files.find(tmpdir, 1,
-                                       (Path p, java.nio.file.attribute.BasicFileAttributes a) ->
-                                               a.isDirectory() && !p.equals(tmpdir) &&
-                                               p.getFileName().toString().startsWith(tempPrefix))) {
-                                       paths.map(Path::toFile)
-                                            .map(FileCleaner::new)
-                                            .forEach(FileCleaner::run);
-
-                               }
-                       }
-
-                       tempDir = Files.createTempDirectory(tempPrefix);
-               }
-
-               /* For each possible filename of the given library on all possible OSes, try it */
-               for (String filename : new String[]
-                  { name,
-                    "lib"+name+".so",               /* linux */
-                    name+".dll", "lib"+name+".dll", /* windows (pure and mingw) */
-                    "lib"+name+".dylib"             /* macOS */}) {
-
-                       File fileOut = new File(tempDir.toFile(), filename);
-                       try ( // Try-with-resources. These stream will be autoclosed when needed.
-                               InputStream in = NativeLib.class.getClassLoader().getResourceAsStream(path+filename);
-                       ) {
-                               if (in != null) {
-                                       /* copy the library in position */
-                                       Files.copy(in, fileOut.toPath());
-
-                                       /* load that library */
-                                       System.load(fileOut.getAbsolutePath());
-
-                                       /* It loaded! we're good */
-                                       return true;
-                               }
-                       }
-               }
-
-               /* No suitable name found */
-               return false;
-       }
-
-       /** Find where to search for the library in the jar -- keep it aligned with where cmake puts it! */
-       private static String getPath() {
-               // Inspiration: https://github.com/xerial/snappy-java/blob/develop/src/main/java/org/xerial/snappy/OSInfo.java
-               String prefix = "NATIVE";
-               String os = System.getProperty("os.name");
-               String arch = System.getProperty("os.arch");
-
-               if (arch.matches("^i[3-6]86$"))
-                       arch = "x86";
-               else if ("x86_64".equalsIgnoreCase(arch) || "AMD64".equalsIgnoreCase(arch))
-                       arch = "amd64";
-
-               if (os.toLowerCase().startsWith("win")) {
-                       os = "Windows";
-               } else if (os.contains("OS X")) {
-                       os = "Darwin";
-               }
-               os = os.replace(' ', '_');
-               arch = arch.replace(' ', '_');
-
-               return prefix + "/" + os + "/" + arch + "/";
-       }
-
-       /** A hackish mechanism used to remove the file containing our library when the JVM shuts down */
-       private static class FileCleaner implements Runnable {
-               private File dir;
-               public FileCleaner(File dir) {
-                       this.dir = dir;
-               }
-               @Override
-               public void run() {
-                        try (Stream<Path> paths = Files.walk(dir.toPath())) {
-                                paths.sorted(java.util.Comparator.reverseOrder())
-                                     .map(java.nio.file.Path::toFile)
-                                     //.peek(System.err::println) // Prints what gets removed
-                                     .forEach(java.io.File::delete);
-                       } catch(Exception e) {
-                               System.err.println("Error while cleaning temporary file " + dir.getAbsolutePath() +
-                                                  ": " + e.getCause());
-                               e.printStackTrace();
-                        }
-               }
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/As.java b/src/bindings/java/org/simgrid/msg/As.java
deleted file mode 100644 (file)
index 1fdf896..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-public class As {
-
-       private long bind;
-
-       protected As() {}
-
-       @Override
-       public String toString (){
-               return this.getName();
-       }
-       public native String getName();
-
-       public native As[] getSons();
-
-       public native String getProperty(String name);
-
-       public native Host[] getHosts();
-
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
-       public static native void nativeInit();
-       static {
-               nativeInit();
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/Comm.java b/src/bindings/java/org/simgrid/msg/Comm.java
deleted file mode 100644 (file)
index bf76a55..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** Communication action, representing an ongoing communication between processes. */
-public class Comm {
-       /** Indicates if the communication is a receiving communication */
-       protected boolean receiving;
-       /** Indicates if the communication is finished */
-       protected boolean finished = false;
-       /**
-        * Represents the bind between the java comm and the
-        * native C comm. You must never access it, since it is
-        * automatically set.
-        */
-       private long bind = 0;
-       /** Represents the bind for the task object pointer. Don't touch it. */
-       private long taskBind = 0;
-       /** Task associated with the comm. Beware, it can be null */
-       protected Task task = null;
-       /**
-        * Protected constructor, used by Comm factories
-        * in Task.
-        */
-       protected Comm() {
-
-       }
-       /**
-        * Destroy the C communication object, when the GC reclaims the java part.
-        * @deprecated (from Java9 onwards)
-        */
-       @Deprecated @Override
-       protected void finalize() throws Throwable{
-               nativeFinalize();
-       }
-       protected native void nativeFinalize();
-       /**
-        * Returns if the communication is finished or not.
-        * If the communication has finished and there was an error,
-        * raise an exception.
-        */
-       public native boolean test() throws TransferFailureException, HostFailureException, TimeoutException ;
-       /** Wait infinitely for the completion of the communication (infinite timeout) */
-       public void waitCompletion() throws TransferFailureException, HostFailureException, TimeoutException {
-               waitCompletion(-1);
-       }
-       /**
-        * Wait for the completion of the communication.
-        * Throws an exception if there were an error in the communication.
-        * @param timeout Time before giving up (infinite time if negative)
-        */
-       public native void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
-
-       /** Wait all of the communications */
-       public static native void waitAll(Comm[] comms, double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
-       /** Wait all of the communications, with no maximal delay */
-       public static void waitAll(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException {
-               waitAll(comms, -1.);
-       }
-       /** Wait any of the communications, and return the rank of the terminating comm */
-       public static native int waitAny(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException;
-       /**
-        * Returns the task associated with the communication.
-        * if the communication isn't finished yet, will return null.
-        */
-       public Task getTask() {
-               return task;
-       }
-
-       /** Class initializer, to initialize various JNI stuff */
-       public static native void nativeInit();
-       static {
-               org.simgrid.NativeLib.nativeInit();
-               nativeInit();
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/Host.java b/src/bindings/java/org/simgrid/msg/Host.java
deleted file mode 100644 (file)
index d7d4da1..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Bindings to the MSG hosts */
-
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/**
- * A host object represents a location (any possible place) where a process may run.
- * Thus it is represented as a physical resource with computing capabilities, some
- * mailboxes to enable running process to communicate with remote ones, and some private
- * data that can be only accessed by local process. An instance of this class is always
- * bound with the corresponding native host. All the native hosts are automatically created
- * during the call of the method Msg.createEnvironment(). This method take as parameter a
- * platform file which describes all elements of the platform (host, link, root..).
- * You cannot create a host yourself.
- *
- * The best way to get a host instance is to call the static method
- * Host.getByName().
- *
- * For example to get the instance of the host. If your platform
- * file description contains a host named "Jacquelin" :
- *
- * \verbatim
-Host jacquelin;
-
-try {
-       jacquelin = Host.getByName("Jacquelin");
-} catch(HostNotFoundException e) {
-       System.err.println(e.toString());
-}
-...
-\endverbatim
- *
- */
-public class Host {
-
-       /**
-        * This attribute represents a bind between a java host object and
-        * a native host. Even if this attribute is public you must never
-        * access to it. It is set automatically during the call of the
-        * static method Host.getByName().
-        *
-        * @see                         Host.getByName().
-        */
-       private long bind;
-       protected String name;
-
-       /** User data. */
-       private Object data;
-       protected Host() {
-               this.bind = 0;
-               this.data = null;
-       }
-
-       @Override
-       public String toString (){
-               return this.name;
-       }
-
-       /**
-        * This static method gets a host instance associated with a native
-        * host of your platform. This is the best way to get a java host object.
-        *
-        * @param name          The name of the host to get.
-        *
-        * @return              The host object with the given name.
-        * @exception           HostNotFoundException if the name of the host is not valid.
-        */
-       public static native Host getByName(String name) throws HostNotFoundException;
-       /** Counts the installed hosts. */
-       public static native int getCount();
-
-       /** Returns the host of the current process. */
-       public static native Host currentHost();
-
-       /** Returns all hosts of the installed platform. */
-       public static native Host[] all();
-
-       /**
-        * This static method sets a mailbox to receive in asynchronous mode.
-        *
-        * All messages sent to this mailbox will be transferred to
-        * the receiver without waiting for the receive call.
-        * The receive call will still be necessary to use the received data.
-        * If there is a need to receive some messages asynchronously, and some not,
-        * two different mailboxes should be used.
-        *
-        * @param mailboxName The name of the mailbox
-        */
-       public static native void setAsyncMailbox(String mailboxName);
-
-       public String getName() {
-               return name;
-       }
-
-       public void setData(Object data) {
-               this.data = data;
-       }
-
-       public Object getData() {
-               return this.data;
-       }
-       /** Returns true if the host has an associated data object. */
-       public boolean hasData() {
-               return null != this.data;
-       }
-
-       /** Starts the host if it is off */
-       public native void on();
-       /** Stops the host if it is on */
-       public native void off() throws ProcessKilledError;
-
-       /**
-        * This method returns the speed of the processor of a host (in flops),
-        * regardless of the current load of the machine.
-        */
-       public native double getSpeed();
-       public native double getCoreNumber();
-
-       public native String getProperty(String name);
-       public native void setProperty(String name, String value);
-       /** Tests if a host is up and running. */
-       public native boolean isOn();
-
-       /** After this call, sg_host_get_consumed_energy() will not interrupt your process
-        * (until after the next clock update).
-        */
-       public static native void updateAllEnergyConsumptions();
-       /** Returns the amount of Joules consumed by that host so far
-        *
-        * Please note that since the consumption is lazily updated, it may require a simcall to update it.
-        * The result is that the actor requesting this value will be interrupted,
-        * the value will be updated in kernel mode before returning the control to the requesting actor.
-        */
-       public native double getConsumedEnergy();
-
-       /** Returns the current load of the host, as a ratio = achieved_flops / (core_current_speed * core_amount)
-        *
-        * See simgrid::plugin::HostLoad::get_current_load() for the full documentation.
-        */
-       public native double getCurrentLoad();
-       /** Returns the number of flops computed of the host since the beginning of the simulation */
-       public native double getComputedFlops();
-       /** Returns the average load of the host as a ratio since the beginning of the simulation*/
-       public native double getAvgLoad();
-
-       /** Returns the current pstate */
-       public native int getPstate();
-       /** Changes the current pstate */
-       public native void setPstate(int pstate);
-       public native int getPstatesCount();
-       /** Returns the speed of the processor (in flop/s) at the current pstate. See also @ref plugin_energy. */
-       public native double getCurrentPowerPeak();
-       /** Returns the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy. */
-       public native double getPowerPeakAt(int pstate);
-
-       /** Returns the current computation load (in flops per second) */
-       public native double getLoad();
-
-       /** Class initializer, to initialize various JNI stuff */
-       private static native void nativeInit();
-       static {
-               nativeInit();
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/HostFailureException.java b/src/bindings/java/org/simgrid/msg/HostFailureException.java
deleted file mode 100644 (file)
index 2bb72cd..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** This exception is raised when the host on which you are running has just been rebooted. */
-public class HostFailureException extends MsgException {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>HostFailureException</code> without a detail message. */
-       public HostFailureException() {
-               super();
-       }
-       /** Constructs an <code>HostFailureException</code> with a detail message. */
-       public HostFailureException(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/HostNotFoundException.java b/src/bindings/java/org/simgrid/msg/HostNotFoundException.java
deleted file mode 100644 (file)
index f4d2713..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** This exception is raised when looking for a non-existing host. */
-public class HostNotFoundException extends MsgException {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>HostNotFoundException</code> without a detail message. */
-       public HostNotFoundException() {
-               super();
-       }
-       /** Constructs an <code>HostNotFoundException</code> with a detail message. */
-       public HostNotFoundException(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/JniException.java b/src/bindings/java/org/simgrid/msg/JniException.java
deleted file mode 100644 (file)
index 6811443..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This exception is raised when there is a problem within the bindings (in JNI). */
-
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/**
- * Exception raised when there is a problem within the bindings (in JNI).
- *
- * That's a RuntimeException: I guess nobody wants to survive a JNI error in SimGrid
- */
-public class JniException extends RuntimeException {
-       private static final long serialVersionUID = 1L;
-
-
-       /** Constructs an <code>JniException</code> without a detail message. */
-       public JniException() {
-               super();
-       }
-       /** Constructs an <code>JniException</code> with a detail message. */
-       public JniException(String s) {
-                super(s);
-       }
-       public JniException(String string, Exception e) {
-               super(string,e);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java
deleted file mode 100644 (file)
index 928add6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* JNI interface to C code for MSG. */
-
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-public final class Msg {
-
-       /** Retrieves the simulation time */
-       public static final native double getClock();
-       /** Issue a debug logging message. */
-       public static final native void debug(String msg);
-       /** Issue a verbose logging message. */
-       public static final native void verb(String msg);
-       /** Issue an information logging message */
-       public static final native void info(String msg);
-       /** Issue a warning logging message. */
-       public static final native void warn(String msg);
-       /** Issue an error logging message. */
-       public static final native void error(String msg);
-       /** Issue a critical logging message. */
-       public static final native void critical(String s);
-
-       private Msg() {
-               throw new IllegalAccessError("Utility class");
-       }
-
-       /*********************************************************************************
-        * Deployment and initialization related functions                               *
-        *********************************************************************************/
-
-       /** Initialize a MSG simulation.
-        *
-        * @param args            The arguments of the command line of the simulation.
-        */
-       public static final native void init(String[]args);
-
-       /** Tell the kernel that you want to use the energy plugin */
-       public static final native void energyInit();
-
-    /** Tell the kernel that you want to use the filesystem plugin. */
-       public static final native void fileSystemInit();
-
-    /** Initializes the HostLoad plugin.
-     *
-        * The HostLoad plugin provides an API to get the current load of each host.
-     */
-       public static final native void loadInit();
-
-       /** Run the MSG simulation.
-        *
-        * After the simulation, you can freely retrieve the information that you want..
-        * In particular, retrieving the status of a process or the current date is perfectly ok.
-        */
-       public static final native void run() ;
-
-       /** Create the simulation environment by parsing a platform file. */
-       public static final native void createEnvironment(String platformFile);
-
-       public static final native As environmentGetRoutingRoot();
-
-       /** Starts your processes by parsing a deployment file. */
-       public static final native void deployApplication(String deploymentFile);
-
-       /** Example launcher. You can use it or provide your own launcher, as you wish
-        * @param args
-        */
-       public static void main(String[]args) {
-               /* initialize the MSG simulation. Must be done before anything else (even logging). */
-               Msg.init(args);
-
-               if (args.length < 2) {
-                       Msg.info("Usage: Msg platform_file deployment_file");
-                       System.exit(1);
-               }
-
-               /* Load the platform and deploy the application */
-               Msg.createEnvironment(args[0]);
-               Msg.deployApplication(args[1]);
-               /* Execute the simulation */
-               Msg.run();
-       }
-
-       /* Class initializer, to initialize various JNI stuff */
-       static {
-               org.simgrid.NativeLib.nativeInit();
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/MsgException.java b/src/bindings/java/org/simgrid/msg/MsgException.java
deleted file mode 100644 (file)
index 95e6904..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This exception is an abstract class grouping all MSG-related exceptions */
-
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** This exception is an abstract class grouping all MSG-related exceptions */
-public abstract class MsgException extends Exception {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>MsgException</code> without a detail message. */
-       protected MsgException() {
-               super();
-       }
-       /** Constructs an <code>MsgException</code> with a detail message. */
-       protected MsgException(String msg) {
-               super(msg);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/Mutex.java b/src/bindings/java/org/simgrid/msg/Mutex.java
deleted file mode 100644 (file)
index c209ec5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-/** A mutex  implemented on top of SimGrid synchronization mechanisms.
- * You can use it exactly the same way that you use the mutexes,
- * but to handle the interactions between the processes within the simulation.
- *
- * Don't mix simgrid synchronization with Java native one, or it will deadlock!
- */
-public class Mutex {
-       private long bind; // The C object -- don't touch it
-
-       public Mutex() {
-               init();
-       }
-
-       /** @deprecated (from Java9 onwards) */
-       @Deprecated @Override
-       protected void finalize() throws Throwable {
-               nativeFinalize();
-       }
-       private native void nativeFinalize();
-       private native void init();
-       public native void acquire();
-       public native void release();
-
-       /** Class initializer, to initialize various JNI stuff */
-       public static native void nativeInit();
-       static {
-               org.simgrid.NativeLib.nativeInit();
-               nativeInit();
-       }
-}
-
-
diff --git a/src/bindings/java/org/simgrid/msg/Process.java b/src/bindings/java/org/simgrid/msg/Process.java
deleted file mode 100644 (file)
index 266e95e..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-/**
- * A process may be defined as a code, with some private data, executing
- * in a location (host). All the process used by your simulation must be
- * declared in the deployment file (XML format).
- * To create your own process you must inherit your own process from this
- * class and override the method "main()". For example if you want to use
- * a process named Worker proceed as it :
- *
- * (1) import the class Process of the package simgrid.msg
- * import simgrid.msg.Process;
- *
- * public class Worker extends simgrid.msg.Process {
- *
- *  (2) Override the method function
- *
- *  \verbatim
- *     public void main(String[] args) {
- *             System.out.println("Hello MSG");
- *     }
- *  \endverbatim
- * }
- * The name of your process must be declared in the deployment file of your simulation.
- * For the example, for the previous process Worker this file must contains a line :
- * &lt;process host="Maxims" function="Worker"/&gt;, where Maxims is the host of the process
- * Worker. All the process of your simulation are automatically launched and managed by Msg.
- * A process use tasks to simulate communications or computations with another process.
- * For more information see Task. For more information on host concept
- * see Host.
- *
- */
-
-public abstract class Process implements Runnable {
-       /**
-        * This attribute represents a bind between a java process object and
-        * a native process. Even if this attribute is public you must never
-        * access to it. It is set automatically during the build of the object.
-        */
-       private long bind = 0;
-       /** Indicates if the process is started */
-
-       /** Time at which the process should be created  */
-       protected double startTime = 0;
-       /** Time at which the process should be killed */
-       private double killTime = -1; // Used from the C world
-
-       private String name = null;
-
-       private int pid = -1;
-       private int ppid = -1;
-       private Host host = null;
-
-       /** The arguments of the method function of the process. */
-       private ArrayList<String> args = new ArrayList<>();
-
-       /**
-        * Constructs a new process from the name of a host and his name. The method
-        * function of the process doesn't have argument.
-        *
-        * @param hostname              Where to create the process.
-        * @param name                  The name of the process.
-        *
-        * @exception                   HostNotFoundException  if no host with this name exists.
-        *
-        *
-        */
-       protected Process(String hostname, String name) throws HostNotFoundException {
-               this(Host.getByName(hostname), name, null);
-       }
-       /**
-        * Constructs a new process from the name of a host and his name. The arguments
-        * of the method function of the process are specified by the parameter args.
-        *
-        * @param hostname              Where to create the process.
-        * @param name                  The name of the process.
-        * @param args                  The arguments of the main function of the process.
-        *
-        * @exception                   HostNotFoundException  if no host with this name exists.
-        *
-        */
-       protected Process(String hostname, String name, String[] args) throws HostNotFoundException {
-               this(Host.getByName(hostname), name, args);
-       }
-       /**
-        * Constructs a new process from a host and his name. The method function of the
-        * process doesn't have argument.
-        *
-        * @param host                  Where to create the process.
-        * @param name                  The name of the process.
-        *
-        */
-       protected Process(Host host, String name) {
-               this(host, name, null);
-       }
-       /**
-        * Constructs a new process from a host and his name, the arguments of here method function are
-        * specified by the parameter args.
-        *
-        * @param host                  Where to create the process.
-        * @param name                  The name of the process.
-        * @param argsParam             The arguments of main method of the process.
-        */
-       protected Process(Host host, String name, String[]argsParam)
-       {
-               if (host == null)
-                       throw new IllegalArgumentException("Cannot create a process on the null host");
-               if (name == null)
-                       throw new IllegalArgumentException("Process name cannot be null");
-
-               this.host = host;
-               this.name = name;
-
-               this.args = new ArrayList<>();
-               if (null != argsParam)
-                       this.args.addAll(Arrays.asList(argsParam));
-       }
-       /**
-        * Constructs a new process from a host and his name, the arguments of here method function are
-        * specified by the parameter args.
-        *
-        * @param host                  Where to create the process.
-        * @param name                  The name of the process.
-        * @param args                  The arguments of main method of the process.
-        * @param startTime             Start time of the process
-        * @param killTime              Kill time of the process
-        *
-        */
-       protected Process(Host host, String name, String[]args, double startTime, double killTime) {
-               this(host, name, args);
-               this.startTime = startTime;
-               this.killTime = killTime;
-       }
-       /**
-        * The native method to create an MSG process.
-        * @param host    where to create the process.
-        */
-       protected native void create(Host host);
-
-       /**
-        * This method kills all running process of the simulation.
-        */
-       public static native void killAll();
-
-       /** Simply kills the receiving process.
-        *
-        * SimGrid sometimes have issues when you kill processes that are currently communicating and such. We are working on it to fix the issues.
-        */
-       public native void kill();
-       public static void kill(Process p) {
-               p.kill();
-       }
-
-       /** Suspends the process. See {@link #resume()} to resume it afterward */
-       public native void suspend();
-       /** Resume a process that was suspended by {@link #suspend()}. */
-       public native void resume();
-       /** Tests if a process is suspended.
-        *
-        * @see suspend()
-        * @see resume()
-        */
-       public native boolean isSuspended();
-
-       /** Yield the current process. All other processes that are ready at the same timestamp will be executed first */
-       public static native void yield();
-
-       /**
-        * Specify whether the process should restart when its host restarts after a failure
-        *
-        * A process naturally stops when its host stops. It starts again only if autoRestart is set to true.
-        * Otherwise, it just disappears when the host stops.
-        */
-       public native void setAutoRestart(boolean autoRestart);
-       /** Restarts the process from the beginning */
-       public native void restart();
-       /**
-        * Returns the name of the process
-        */
-       public String getName() {
-               return this.name;
-       }
-       /**
-        * Returns the host of the process.
-        * @return                              The host instance of the process.
-        */
-       public Host getHost() {
-               return this.host;
-       }
-       /**
-        * This static method gets a process from a PID.
-        *
-        * @param pid                   The process identifier of the process to get.
-        *
-        * @return                              The process with the specified PID.
-        */
-       public static native Process fromPID(int pid);
-       /**
-        * This method returns the PID of the process.
-        *
-        * @return                              The PID of the process.
-        *
-        */
-       public int getPID()  {
-               if (pid == -1) // Don't traverse the JNI barrier if you already have the answer
-                       pid = nativeGetPID();
-               return pid;
-       }
-       // This should not be used: the PID is supposed to be initialized from the C directly when the actor is created,
-       // but this sometimes fail, so let's play nasty but safe here.
-       private native int nativeGetPID();
-       /**
-        * This method returns the PID of the parent of a process.
-        *
-        * @return                              The PID of the parent of the process.
-        *
-        */
-       public int getPPID()  {
-               return ppid;
-       }
-       /**
-        * Returns the value of a given process property.
-        */
-       public native String getProperty(String name);
-
-       /**
-        * Set the kill time of the process
-        * @param killTime the time when the process is killed
-        */
-       public native void setKillTime(double killTime);
-
-       /**
-        * This static method returns the currently running process.
-        *
-        * @return                              The current process.
-        *
-        */
-       public static native Process getCurrentProcess();
-       /**
-        * Migrates a process to another host.
-        *
-        * @param host                  The host where to migrate the process.
-        *
-        */
-       public native void migrate(Host host);
-       /**
-        * Makes the current process sleep until millis milliseconds have elapsed.
-        * You should note that unlike "waitFor" which takes seconds (as usual in SimGrid), this method takes milliseconds (as usual for sleep() in Java).
-        *
-        * @param millis the length of time to sleep in milliseconds.
-        */
-       public static void sleep(long millis) throws HostFailureException  {
-               sleep(millis,0);
-       }
-       /**
-        * Makes the current process sleep until millis milliseconds and nanos nanoseconds
-        * have elapsed.
-        * Unlike {@link #waitFor(double)} which takes seconds, this method takes
-        * milliseconds and nanoseconds.
-        * Overloads Thread.sleep.
-        * @param millis the length of time to sleep in milliseconds.
-        * @param nanos additional nanoseconds to sleep.
-        */
-       public static native void sleep(long millis, int nanos) throws HostFailureException;
-       /**
-        * Makes the current process sleep until time seconds have elapsed.
-        * @param seconds               The time the current process must sleep.
-        */
-       public native void waitFor(double seconds) throws HostFailureException;
-       /**
-        * This method actually creates and run the process.
-        * It is a noop if the process is already launched.
-        */
-       public final void start() {
-          if (bind == 0)
-            create(host);
-       }
-
-       /** This method runs the process. It calls the method function that you must overwrite. */
-       @Override
-       public void run() {
-
-               try {
-                       String[] argsArray = new String[this.args.size()];
-                       this.args.toArray(argsArray);
-
-                       this.main(argsArray);
-               }
-               catch(MsgException e) {
-                       e.printStackTrace();
-                       Msg.info("Unexpected behavior. Stopping now");
-                       System.exit(1);
-               }
-               /* Let the ProcessKilledError (that we'd get if the process is forcefully killed) flow back to the caller */
-       }
-
-       /**
-        * The main function of the process (to implement by the user).
-        *
-        * @param args
-        * @throws MsgException
-        */
-       public abstract void main(String[]args) throws MsgException;
-
-       /** Stops the execution of the current actor */
-       public void exit() {
-               this.kill();
-       }
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
-       private static native void nativeInit();
-       static {
-               org.simgrid.NativeLib.nativeInit();
-               nativeInit();
-       }
-       /**
-        * This static method returns the current amount of processes running
-        *
-        * @return                      The count of the running processes
-        */
-       public static native int getCount();
-
-        public static void debugAllThreads() {
-           // Search remaining threads that are not main nor daemon
-            for (Thread t : Thread.getAllStackTraces().keySet())
-                if (! t.isDaemon() && !t.getName().equals("main"))
-                    System.err.println("Thread "+t.getName()+" is still running! Please report that bug");
-        }
-}
diff --git a/src/bindings/java/org/simgrid/msg/ProcessKilledError.java b/src/bindings/java/org/simgrid/msg/ProcessKilledError.java
deleted file mode 100644 (file)
index ef0ea27..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** Used internally to interrupt the user code when the process gets killed.
- *
- * \beginrst
- * You can catch it for cleanups or to debug, but DO NOT BLOCK IT, or your simulation will segfault!
- *
- * .. code-block:: java
- *
- *    try {
- *      getHost().off();
- *    } catch (ProcessKilledError e) {
- *      e.printStackTrace();
- *      throw e;
- *    }
- *
- * \endrst
- */
-
-public class ProcessKilledError extends Error {
-       private static final long serialVersionUID = 1L;
-       public ProcessKilledError(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java b/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java
deleted file mode 100644 (file)
index c4c5c4f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** Exception raised when looking for a non-existing process. */
-public class ProcessNotFoundException extends MsgException {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>ProcessNotFoundException</code> without a detail message. */
-       public ProcessNotFoundException() {
-               super();
-       }
-       /** Constructs an <code>ProcessNotFoundException</code> with a detail message. */
-       public ProcessNotFoundException(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/Semaphore.java b/src/bindings/java/org/simgrid/msg/Semaphore.java
deleted file mode 100644 (file)
index dfe4601..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-/** A semaphore implemented on top of SimGrid synchronization mechanisms.
- * You can use it exactly the same way that you use classical semaphores
- * but to handle the interactions between the processes within the simulation.
- *
- */
-
-public class Semaphore {
-       private long bind; // The C object -- don't touch it
-       /**
-        * Semaphore capacity, defined when the semaphore is created. At most capacity
-        * process can acquire this semaphore at the same time.
-        */
-       protected final int capacity;
-       /**
-        * Creates a new semaphore with the given capacity. At most capacity
-        * process can acquire this semaphore at the same time.
-        */
-       public Semaphore(int capacity) {
-               init(capacity);
-               this.capacity = capacity;
-       }
-       /** The native implementation of semaphore initialization
-        */
-       private native void init(int capacity);
-
-
-       /** Locks on the semaphore object until the provided timeout expires
-        * @exception TimeoutException if the timeout expired before
-        *            the semaphore could be acquired.
-        * @param timeout the duration of the lock
-        */
-       public native void acquire(double timeout) throws TimeoutException;
-       /** Locks on the semaphore object with no timeout
-        */
-       public void acquire() {
-               try {
-                       acquire(-1);
-               } catch (TimeoutException e) {
-                       e.printStackTrace(); // This should not happen.
-                       assert false ;
-               }
-       }
-       /** Releases the semaphore object
-        */
-       public native void release();
-       /** returns a boolean indicating it this semaphore would block at this very specific time
-        *
-        * Note that the returned value may be wrong right after the
-        * function call, when you try to use it...  But that's a
-        * classical semaphore issue, and SimGrid's semaphores are not
-        * different to usual ones here.
-        */
-       public native boolean wouldBlock();
-
-       /** Returns the semaphore capacity
-        */
-       public int getCapacity(){
-               return this.capacity;
-       }
-
-
-       /**
-        * Deletes this semaphore when the GC reclaims it
-        * @deprecated (from Java9 onwards)
-        */
-       @Deprecated @Override
-       protected void finalize() throws Throwable {
-               nativeFinalize();
-       }
-       private native void nativeFinalize();
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
-       public static native void nativeInit();
-       static {
-               org.simgrid.NativeLib.nativeInit();
-               nativeInit();
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java
deleted file mode 100644 (file)
index 83ebffd..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/**
- * A task is either something to compute somewhere, or something to exchange between two hosts (or both).
- * It is defined by a computing amount and a message size.
- *
- */
-public class Task {
-       /**
-        * This attribute represents a bind between a java task object and
-        * a native task. Even if this attribute is public you must never
-        * access to it. It is set automatically during the build of the object.
-        */
-       private long bind = 0;
-       /**
-        * Task name
-        */
-       protected String name;
-
-       private double messageSize;
-
-       /** Default constructor (all fields to 0 or null) */
-       public Task() {
-               create(null, 0, 0);
-               this.messageSize = 0;
-       }
-
-       /* *              * *
-        * * Constructors * *
-        * *              * */
-       /**
-        * Construct a new task with the specified processing amount and amount
-        * of data needed.
-        *
-        * @param name  Task's name
-        *
-        * @param flopsAmount   A value of the processing amount (in flop) needed to process the task.
-        *                              If 0, then it cannot be executed with the execute() method.
-        *                              This value has to be &ge; 0.
-        *
-        * @param bytesAmount           A value of amount of data (in bytes) needed to transfer this task.
-        *                              If 0, then it cannot be transferred with the get() and put() methods.
-        *                              This value has to be &ge; 0.
-        */
-       public Task(String name, double flopsAmount, double bytesAmount) {
-               if (flopsAmount<0)
-                       throw new IllegalArgumentException("Task flopsAmount (" + flopsAmount + ") cannot be negative");
-               if (bytesAmount<0)
-                       throw new IllegalArgumentException("Task bytesAmount (" + bytesAmount + ") cannot be negative");
-
-               create(name, flopsAmount, bytesAmount);
-
-               this.name = name;
-               this.messageSize = bytesAmount;
-       }
-       /**
-        * Construct a new parallel task with the specified processing amount and amount for each host
-        * implied.
-        *
-        * @param name          The name of the parallel task.
-        * @param hosts         The list of hosts implied by the parallel task.
-        * @param flopsAmount   The amount of operations to be performed by each host of hosts.
-        *                      flopsAmount[i] is the total number of operations that have to be
-        *                      performed on hosts[i].
-        * @param bytesAmount   A matrix describing the amount of data to exchange between hosts. The
-        *                      length of this array must be hosts.length * hosts.length. It is actually
-        *                      used as a matrix with the lines being the source and the columns being
-        *                      the destination of the communications.
-        */
-       public Task(String name, Host[]hosts, double[]flopsAmount, double[]bytesAmount) {
-               if (flopsAmount == null)
-                       throw new IllegalArgumentException("Parallel task flops amounts is null");
-               if (bytesAmount == null)
-                       throw new IllegalArgumentException("Parallel task bytes amounts is null");
-               if (hosts == null)
-                       throw new IllegalArgumentException("Host list is null");
-               if (name == null)
-                       throw new IllegalArgumentException("Parallel task name is null");
-
-               parallelCreate(name, hosts, flopsAmount, bytesAmount);
-               this.name = name;
-       }
-
-       /**
-        * The natively implemented method to create a MSG task.
-        *
-        * @param name            The name of the task.
-        * @param flopsAmount    A value of the processing amount (in flop) needed
-        *                        to process the task. If 0, then it cannot be executed
-        *                        with the execute() method. This value has to be >= 0.
-        * @param bytesAmount        A value of amount of data (in bytes) needed to transfer
-        *                        this task. If 0, then it cannot be transferred this task.
-        *                        If 0, then it cannot be transferred with the get() and put()
-        *                        methods. This value has to be >= 0.
-        * @exception             IllegalArgumentException if compute duration <0 or message size <0
-        */
-       private final native void create(String name,
-                       double flopsAmount,
-                       double bytesAmount);
-       /**
-        * The natively implemented method to create a MSG parallel task.
-        *
-        * @param name                The name of the parallel task.
-        * @param hosts               The list of hosts implied by the parallel task.
-        * @param flopsAmount         The total number of operations that have to be performed
-        *                            on the hosts.
-        * @param bytesAmount        An array of doubles
-        *
-        */
-       private final native void parallelCreate(String name,
-                       Host[]hosts,
-                       double[]flopsAmount,
-                       double[]bytesAmount);
-       /* *                   * *
-        * * Getters / Setters * *
-        * *                   * */
-       /** Gets the name of the task */
-       public String getName() {
-               return name;
-       }
-
-       /** Gets the sender of the task (or null if not sent yet) */
-       public native Process getSender();
-
-       /** Gets the source of the task (or null if not sent yet). */
-       public native Host getSource();
-
-       /** Gets the remaining amount of flops to execute in this task
-        *
-        * If it's ongoing, you get the exact amount at the present time. If it's already done, it's 0.
-        */
-       public native double getFlopsAmount();
-       /**
-        * Sets the name of the task
-        * @param name the new task name
-        */
-       public native void setName(String name);
-       /**
-        * This method sets the priority of the computation of the task.
-        * The priority doesn't affect the transfer rate. For example a
-        * priority of 2 will make the task receive two times more cpu than
-        * the other ones.
-        *
-        * @param priority      The new priority of the task.
-        */
-       public native void setPriority(double priority);
-
-       /** Set the computation amount needed to process the task
-        *
-        * Warning if the execution is already started and ongoing, this call does nothing.
-        * @param flopsAmount the amount of computation needed to process the task
-        */
-       public native void setFlopsAmount(double flopsAmount);
-       /**
-        * Set the amount of bytes to exchange the task
-        *
-        * Warning if the communication is already started and ongoing, this call does nothing.
-        * @param bytesAmount the size of the task
-        */
-       public native void setBytesAmount(double bytesAmount);
-       /* *                     * *
-        * * Computation-related * *
-        * *                     * */
-       /**
-        * Executes a task on the location on which the current process is running.
-        *
-        * @throws HostFailureException
-        * @throws TaskCancelledException
-        */
-       public native void execute() throws HostFailureException,TaskCancelledException;
-
-       /** Changes the maximum CPU utilization of a computation task. Unit is flops/s. */
-       public native void setBound(double bound);
-
-       /** Cancels a task. */
-       public native void cancel();
-
-       /**
-        * Deletes a task once the garbage collector reclaims it
-        * @deprecated (from Java9 onwards)
-        */
-       @Deprecated @Override
-       protected void finalize() throws Throwable{
-               nativeFinalize();
-               bind=0; // to avoid segfaults if the impossible happens yet again making this task surviving its finalize()
-       }
-       protected native void nativeFinalize();
-       /* *                       * *
-        * * Communication-related * *
-        * *                       * */
-
-       /** Send the task asynchronously on the specified mailbox,
-        *  with no way to retrieve whether the communication succeeded or not
-        *
-        */
-       public native void dsendBounded(String mailbox, double maxrate);
-
-
-       /** Send the task asynchronously on the specified mailbox,
-        *  with no way to retrieve whether the communication succeeded or not
-        *
-        */
-       public native void dsend(String mailbox);
-
-       /**
-        * Sends the task on the specified mailbox
-        *
-        * @param mailbox where to send the message
-        * @throws TimeoutException
-        * @throws HostFailureException
-        * @throws TransferFailureException
-        */
-       public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
-               send(mailbox, -1);
-       }
-
-       /**
-        * Sends the task on the specified mailbox (wait at most \a timeout seconds)
-        *
-        * @param mailbox where to send the message
-        * @param timeout
-        * @throws TimeoutException
-        * @throws HostFailureException
-        * @throws TransferFailureException
-        */
-       public void send(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
-               sendBounded(mailbox, timeout, -1);
-       }
-
-       /** Sends the task on the specified mailbox (capping the sending rate to \a maxrate)
-        *
-        * @param mailbox where to send the message
-        * @param maxrate
-        * @throws TransferFailureException
-        * @throws HostFailureException
-        * @throws TimeoutException
-        */
-       public void sendBounded(String mailbox, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException {
-               sendBounded(mailbox, -1, maxrate);
-       }
-
-
-       /** Sends the task on the specified mailbox (capping the sending rate to \a maxrate) with a timeout
-        *
-        * @param mailbox where to send the message
-        * @param timeout
-        * @param maxrate
-        * @throws TransferFailureException
-        * @throws HostFailureException
-        * @throws TimeoutException
-        */
-       public native void sendBounded(String mailbox, double timeout, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException;
-
-
-       /**
-        * Sends the task on the mailbox asynchronously
-        */
-       public native Comm isend(String mailbox);
-
-       /**
-        * Sends the task on the mailbox asynchronously (capping the sending rate to \a maxrate)
-        */
-       public native Comm isendBounded(String mailbox, double maxrate);
-
-
-       /**
-        * Starts listening for receiving a task from an asynchronous communication
-        * @param mailbox
-        * @return a Comm handler
-        */
-       public static native Comm irecv(String mailbox);
-
-       /**
-        * Retrieves next task on the mailbox identified by the specified alias
-        *
-        * @param mailbox
-        * @return a Task
-        */
-
-       public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
-               return receive(mailbox, -1.0);
-       }
-
-       /**
-        * Retrieves next task on the mailbox identified by the specified alias (wait at most \a timeout seconds)
-        *
-        * @param mailbox
-        * @param timeout
-        * @return a Task
-        */
-       public static native Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
-
-       /**
-        * Starts listening for receiving a task from an asynchronous communication with a capped rate
-        * @param mailbox
-        * @return a Comm handler
-        */
-       public static native Comm irecvBounded(String mailbox, double rate);
-       /**
-        * Retrieves next task from the mailbox identified by the specified name with a capped rate
-        *
-        * @param mailbox
-        * @return a Task
-        */
-
-       public static Task receiveBounded(String mailbox, double rate) throws TransferFailureException, HostFailureException, TimeoutException {
-               return receiveBounded(mailbox, -1.0, rate);
-       }
-
-       /**
-        * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds) with a capped rate
-        *
-        * @param mailbox
-        * @param timeout
-        * @return a Task
-        */
-       public static native Task receiveBounded(String mailbox, double timeout, double rate) throws TransferFailureException, HostFailureException, TimeoutException;
-
-
-
-       /**
-        * Tests whether there is a pending communication on the mailbox identified by the specified alias, and who sent it
-        */
-       public static native int listenFrom(String mailbox);
-       /**
-        * Listen whether there is a task waiting (either for a send or a recv) on the mailbox identified by the specified alias
-        */
-       public static native boolean listen(String mailbox);
-
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
-       public static native void nativeInit();
-       static {
-               org.simgrid.NativeLib.nativeInit();
-               nativeInit();
-       }
-
-       public double getMessageSize() {
-               return this.messageSize;
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/TaskCancelledException.java b/src/bindings/java/org/simgrid/msg/TaskCancelledException.java
deleted file mode 100644 (file)
index 7b5f120..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** Exception raised when a task is cancelled. */
-public class TaskCancelledException extends MsgException {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>TaskCancelledException</code> without a detail message. */
-       public TaskCancelledException() {
-               super();
-       }
-       /** Constructs an <code>TaskCancelledException</code> with a detail message. */
-       public TaskCancelledException(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/TimeoutException.java b/src/bindings/java/org/simgrid/msg/TimeoutException.java
deleted file mode 100644 (file)
index 7d05728..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** Exception raised when sending a task timeouts */
-public class TimeoutException extends MsgException {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>TimeoutFailureException</code> without a detail message. */
-       public TimeoutException() {
-               super();
-       }
-       /** Constructs an <code>TransferFailureException</code> with a detail message. */
-       public TimeoutException(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/TransferFailureException.java b/src/bindings/java/org/simgrid/msg/TransferFailureException.java
deleted file mode 100644 (file)
index 866c2ca..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-/** Exception raised if sending a task fails */
-public class TransferFailureException extends MsgException {
-       private static final long serialVersionUID = 1L;
-
-       /** Constructs an <code>TransferFailureException</code> without a detail message. */
-       public TransferFailureException() {
-               super();
-       }
-       /**
-        * Constructs an <code>TransferFailureException</code> with a detail message.
-        *
-        * @param   s   the detail message.
-        */
-       public TransferFailureException(String s) {
-               super(s);
-       }
-}
diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java
deleted file mode 100644 (file)
index 05d7acf..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Java bindings of the s4u::VirtualMachine */
-
-/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.msg;
-
-public class VM extends Host {
-       // No need to declare a new bind variable: we use the one inherited from the super class Host
-
-       private Host currentHost;
-       private int coreAmount = 1;
-
-       /**
-        * Create a `basic` VM : 1 core and 1GB of RAM.
-        * @param host Host node
-        * @param name name of the machine
-        */
-       public VM(Host host, String name) {
-               this(host,name, /*coreAmount*/1, 1024, 0, 0);
-       }
-
-       /**
-        * Create a VM without useless values (for humans)
-        * @param host Host node
-        * @param name name of the machine
-        * @param coreAmount the amount of cores of the VM
-        */
-       public VM(Host host, String name, int coreAmount) {
-               this(host,name, coreAmount, 1024, 0, 0);
-       }
-
-       /**
-        * Create a VM with 1 core
-        * @param host Host node
-        * @param name name of the machine
-        * @param ramSize size of the RAM that should be allocated (in MBytes)
-        * @param migNetSpeed (network bandwidth allocated for migrations in MB/s, if you don't know put zero ;))
-        * @param dpIntensity (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
-        */
-       public VM(Host host, String name, int ramSize, int migNetSpeed, int dpIntensity){
-               this(host, name, /*coreAmount*/1, ramSize, migNetSpeed, dpIntensity);
-       }
-
-       /**
-        * Create a VM
-        * @param host Host node
-        * @param name name of the machine
-        * @param coreAmount the amount of cores of the VM
-        * @param ramSize size of the RAM that should be allocated (in MBytes)
-        * @param migNetSpeed (network bandwidth allocated for migrations in MB/s, if you don't know put zero ;))
-        * @param dpIntensity (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
-        */
-       public VM(Host host, String name, int coreAmount, int ramSize, int migNetSpeed, int dpIntensity){
-               super();
-               super.name = name;
-               this.currentHost = host;
-               this.coreAmount = coreAmount;
-               create(host, name, coreAmount, ramSize, migNetSpeed, dpIntensity);
-       }
-
-       /** Retrieve the list of all existing VMs */
-       public static native VM[] all();
-
-       /** Retrieve a VM from its name */
-       public static native VM getVMByName(String name);
-
-       /**
-        * Make sure that the GC also destroys the C object
-        * @deprecated (from Java9 onwards)
-        */
-       @Deprecated @Override
-       protected void finalize() throws Throwable {
-               nativeFinalize();
-       }
-       private native void nativeFinalize();
-
-       /** Returns whether the given VM is currently suspended */
-       public native boolean isCreated();
-
-       /** Returns whether the given VM is currently running */
-       public native boolean isRunning();
-
-       /** Returns whether the given VM is currently running */
-       public native boolean isMigrating();
-
-       /** Returns whether the given VM is currently suspended */
-       public native boolean isSuspended();
-
-       /** Returns the amount of virtual CPUs provided */
-       public int getCoreAmount() {
-               return coreAmount;
-       }
-
-       /**
-        * Natively implemented method create the VM.
-        * @param ramSize size of the RAM that should be allocated (in MB)
-        * @param migNetSpeed (network bandwidth allocated for migrations in MB/s, if you don't know put zero ;))
-        * @param dpIntensity (dirty page intensity, a percentage of migNetSpeed [0-100],  if you don't know put zero ;))
-        */
-       private native void create(Host host, String name, int coreAmount, int ramSize, int migNetSpeed, int dpIntensity);
-
-       /**
-        * Set a CPU bound for a given VM.
-        * @param bound in flops/s
-        */
-       public native void setBound(double bound);
-
-       /**  start the VM */
-       public native void start();
-
-       /**
-        * Immediately kills all processes within the given VM.
-        *
-        * No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep()
-        */
-       public native void shutdown();
-
-       /** Shutdown and unref the VM. */
-       public native void destroy();
-
-       /** Change the host on which all processes are running
-        * (pre-copy is implemented)
-        */
-       public void migrate(Host destination) throws HostFailureException{
-               try {
-                       this.nativeMigration(destination);
-               } catch (Exception e){
-                 Msg.info("Migration of VM "+this.getName()+" to "+destination.getName()+" is impossible ("+e.getMessage()+")");
-                 throw new HostFailureException(e.getMessage());
-               }
-               // If the migration correctly returned, then we should change the currentHost value.
-               this.currentHost = destination;
-       }
-       private native void nativeMigration(Host destination) throws MsgException;
-
-       /** Immediately suspend the execution of all processes within the given VM
-        *
-        * No suspension cost occurs. If you want to simulate this too, you want to use a @ref File.write() before or
-        * after, depending on the exact semantic of VM suspend to you.
-        */
-       public native void suspend();
-
-       /** Immediately resumes the execution of all processes within the given VM
-        *
-        * No resume cost occurs. If you want to simulate this too, you want to use a @ref File.read() before or after,
-        * depending on the exact semantic of VM resume to you.
-        */
-       public native void resume();
-
-       /**  Class initializer (for JNI), don't do it yourself */
-       private static native void nativeInit();
-       static {
-               nativeInit();
-       }
-}
diff --git a/src/bindings/java/org/simgrid/trace/Trace.java b/src/bindings/java/org/simgrid/trace/Trace.java
deleted file mode 100644 (file)
index e531148..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/* JNI interface to C code for the TRACES part of SimGrid. */
-
-/* Copyright (c) 2012-2023. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package org.simgrid.trace;
-
-import org.simgrid.NativeLib;
-
-public final class Trace {
-  /* Statically load the library which contains all native functions used in here */
-  static {
-    NativeLib.nativeInit();
-  }
-
-  private Trace() {
-    throw new IllegalStateException("Utility class \"Trace\"");
-  }
-
-  // TODO complete the binding of the tracing API
-
-  /**
-   * Declare a new user variable associated to hosts with a color.
-   *
-   * @param variable
-   * @param color
-   */
-  public static final native void hostVariableDeclareWithColor (String variable, String color);
-
-  /**
-   *  Add a value to a variable of a host.
-   *
-   * @param host
-   * @param variable
-   * @param value
-   */
-  public static final native void hostVariableAdd (String host, String variable, double value);
-
-  /**
-   * Subtract a value from a variable of a host.
-   *
-   * @param host
-   * @param variable
-   * @param value
-   */
-  public static final native void hostVariableSub (String host, String variable, double value);
-
-  /**
-   * Set the value of a variable of a host at a given timestamp.
-   *
-   * @param time
-   * @param host
-   * @param variable
-   * @param value
-   */
-  public static final native void hostVariableSetWithTime (double time, String host, String variable, double value);
-
-  /**
-   *   Add a value to a variable of a host at a given timestamp.
-   *
-   * @param time
-   * @param host
-   * @param variable
-   * @param value
-   */
-  public static final native void hostVariableAddWithTime (double time, String host, String variable, double value);
-
-  /**
-   * Subtract a value from a variable of a host at a given timestamp.
-   *
-   * @param time
-   * @param host
-   * @param variable
-   * @param value
-   */
-  public static final native void hostVariableSubWithTime (double time, String host, String variable, double value);
-
-  /**
-   *  Get declared user host variables.
-   *
-   */
-  public static final native String[]  getHostVariablesName ();
-
-  /**
-   *  Declare a new user variable associated to links.
-   *
-   * @param variable
-   */
-  public static final native void linkVariableDeclare (String variable);
-
-  /**
-   * Declare a new user variable associated to links with a color.
-   * @param variable
-   * @param color
-   */
-  public static final native void linkVariableDeclareWithColor (String variable, String color);
-
-  /**
-   *  Set the value of a variable of a link.
-   *
-   * @param link
-   * @param variable
-   * @param value
-   */
-  public static final native void linkVariableSet (String link, String variable, double value);
-
-  /**
-   * Add a value to a variable of a link.
-   *
-   * @param link
-   * @param variable
-   * @param value
-   */
-  public static final native void linkVariableAdd (String link, String variable, double value);
-
-  /**
-   * Subtract a value from a variable of a link.
-   *
-   * @param link
-   * @param variable
-   * @param value
-   */
-  public static final native void linkVariableSub (String link, String variable, double value);
-
-  /**
-   *  Set the value of a variable of a link at a given timestamp.
-   *
-   * @param time
-   * @param link
-   * @param variable
-   * @param value
-   */
-  public static final native void linkVariableSetWithTime (double time, String link, String variable, double value);
-
-  /**
-   * Add a value to a variable of a link at a given timestamp.
-   *
-   * @param time
-   * @param link
-   * @param variable
-   * @param value
-   */
-  public static final native void linkVariableAddWithTime (double time, String link, String variable, double value);
-
-  /**
-   * Subtract a value from a variable of a link at a given timestamp.
-   *
-   * @param time
-   * @param link
-   * @param variable
-   * @param value
-   */
-  public static final native void linkVariableSubWithTime (double time, String link, String variable, double value);
-
-  /**
-   * Set the value of the variable present in the links connecting source and destination.
-   *
-   * @param src
-   * @param dst
-   * @param variable
-   * @param value
-   */
-  public static final native void linkSrcDstVariableSet (String src, String dst, String variable, double value);
-
-  /**
-   * Add a value to the variable present in the links connecting source and destination.
-   *
-   * @param src
-   * @param dst
-   * @param variable
-   * @param value
-   */
-  public static final native void linkSrcDstVariableAdd (String src, String dst, String variable, double value);
-
-  /**
-   * Subtract a value from the variable present in the links connecting source and destination.
-   *
-   * @param src
-   * @param dst
-   * @param variable
-   * @param value
-   */
-  public static final native void linkSrcDstVariableSub (String src, String dst, String variable, double value);
-
-  /**
-   *  Set the value of the variable present in the links connecting source and destination at a given timestamp.
-   *
-   * @param time
-   * @param src
-   * @param dst
-   * @param variable
-   * @param value
-   */
-  public static final native void linkSrcDstVariableSetWithTime (double time, String src, String dst, String variable, double value);
-
-  /**
-   * Add a value to the variable present in the links connecting source and destination at a given timestamp.
-   *
-   * @param time
-   * @param src
-   * @param dst
-   * @param variable
-   * @param value
-   */
-  public static final native void linkSrcdstVariableAddWithTime (double time, String src, String dst, String variable, double value);
-
-  /**
-   * Subtract a value from the variable present in the links connecting source and destination at a given timestamp.
-   *
-   * @param time
-   * @param src
-   * @param dst
-   * @param variable
-   * @param value
-   */
-  public static final native void linkSrcDstVariableSubWithTime (double time, String src, String dst, String variable, double value);
-
-  /**
-   *  Get declared user link variables.
-   */
-  public static final native String[] getLinkVariablesName ();
-
-
-  /* **** ******** WARNINGS ************** ***** */
-  /* Only the following routines have been       */
-  /* JNI implemented - Adrien May, 22nd          */
-  /* **** ******************************** ***** */
-
-  /**
-   * Declare a user state that will be associated to hosts.
-   * A user host state can be used to trace application states.
-   *
-   * @param name The name of the new state to be declared.
-   */
-  public static final native void hostStateDeclare(String name);
-
-  /**
-   * Declare a new value for a user state associated to hosts.
-   * The color needs to be a string with three numbers separated by spaces in the range [0,1].
-   * A light-gray color can be specified using "0.7 0.7 0.7" as color.
-   *
-   * @param state The name of the new state to be declared.
-   * @param value The name of the value
-   * @param color The color of the value
-   */
-  public static final native void hostStateDeclareValue (String state, String value, String color);
-
-  /**
-   *   Set the user state to the given value.
-   *  (the queue is totally flushed and reinitialized with the given state).
-   *
-   * @param host The name of the host to be considered.
-   * @param state The name of the state previously declared.
-   * @param value The new value of the state.
-   */
-  public static final native void hostSetState (String host, String state, String value);
-
-  /**
-   * Push a new value for a state of a given host.
-   *
-   * @param host The name of the host to be considered.
-   * @param state The name of the state previously declared.
-   * @param value The value to be pushed.
-   */
-  public static final native void hostPushState (String host, String state, String value);
-
-  /**
-   *  Pop the last value of a state of a given host.
-   *
-   * @param host The name of the host to be considered.
-   * @param state The name of the state to be popped.
-   */
-  public static final native void hostPopState (String host, String state);
-
-  /**
-   * Declare a new user variable associated to hosts.
-   *
-   * @param variable
-   */
-  public static final native void hostVariableDeclare (String variable);
-
-  /**
-   * Set the value of a variable of a host.
-   *
-   * @param host
-   * @param variable
-   * @param value
-   */
-  public static final native void hostVariableSet (String host, String variable, double value);
-
-  /**
-   * Declare a new user variable associated to VMs.
-   *
-   * @param variable
-   */
-  public static final native void vmVariableDeclare (String variable);
-
-  /**
-   * Set the value of a variable of a VM.
-   *
-   * @param vm
-   * @param variable
-   * @param value
-   */
-  public static final native void vmVariableSet (String vm, String variable, double value);
-}
index a5cd161..2d8208f 100644 (file)
@@ -116,8 +116,8 @@ static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
 }
 
 /**
- * Install signal handler for SIGSEGV.  Check that nobody has already installed
- * its own handler.  For example, the Java VM does this.
+ * Install signal handler for SIGSEGV.  Check that nobody has already installed its own handler.
+ * Historically, the Java VM did that but this could maybe removed now that Java is gone (TODO)
  */
 static void install_segvhandler()
 {
@@ -230,11 +230,6 @@ void EngineImpl::context_mod_init() const
   }
 #endif
 
-  /* select the context factory to use to create the contexts */
-  if (context::ContextFactory::initializer) { // Give Java a chance to hijack the factory mechanism
-    instance_->set_context_factory(context::ContextFactory::initializer());
-    return;
-  }
   /* use the factory specified by --cfg=contexts/factory:value */
   for (auto const& [factory_name, factory] : context_factories)
     if (context_factory_name == factory_name) {
index bc336be..1b9e459 100644 (file)
@@ -18,8 +18,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_context, kernel, "Context switching mechanis
 
 namespace simgrid::kernel::context {
 
-std::function<ContextFactory*(void)> ContextFactory::initializer;
-
 static e_xbt_parmap_mode_t parallel_synchronization_mode = XBT_PARMAP_DEFAULT;
 static int parallel_contexts                             = 1;
 unsigned stack_size;
index e0a7092..9bcc41e 100644 (file)
@@ -33,9 +33,6 @@ public:
 
   virtual void run_all(std::vector<actor::ActorImpl*> const& actors_list) = 0;
 
-  /* This allows Java to hijack the context factory (Java induces factories of factory :) */
-  static std::function<ContextFactory*(void)> initializer;
-
 protected:
   template <class T, class... Args> T* new_context(Args&&... args)
   {
index 1b608f0..cb578d7 100644 (file)
@@ -39,7 +39,7 @@ private:
 
   void start();                // match a call to release()
   void yield();                // match a call to yield()
-  virtual void start_hook() { /* empty placeholder, called after start(). Used in parallel mode and Java */}
+  virtual void start_hook() { /* empty placeholder, called after start(). Used in parallel mode */}
   virtual void yield_hook() { /* empty placeholder, called before yield(). Used in parallel mode */}
 
   static void wrapper(ThreadContext* context);
index 4c8e87b..0256d3b 100644 (file)
@@ -12,6 +12,7 @@ namespace simgrid {
 // DO NOT define destructors for exceptions in Exception.hpp.
 // Defining it here ensures that the exceptions are defined only in libsimgrid, but not in libsimgrid-java.
 // Doing otherwise naturally breaks things (at least on freebsd with clang).
+// TODO: is it still useful now that Java is gone?
 
 Exception::~Exception()                             = default;
 TimeoutException::~TimeoutException()               = default;
index 5196c3b..5aa9eae 100644 (file)
@@ -103,8 +103,7 @@ XBT_ATTRIB_NORETURN static void handler()
   }
 
   catch (const simgrid::ForcefulKillException&) {
-    XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Maybe a Java->C++ call that is not "
-              "protected in a try/catch?");
+    XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Please help fix this bug.");
   }
 
   // We don't know how to manage other exceptions
diff --git a/teshsuite/java/CMakeLists.txt b/teshsuite/java/CMakeLists.txt
deleted file mode 100644 (file)
index bd5d5b1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-set(semaphoregc_files  SemaphoreGC)
-set(sleephostoff_files SleepHostOff)
-
-foreach(example semaphoregc sleephostoff)
-  foreach (filename ${${example}_files} )
-    set(sources "${${example}_sources}" "${CMAKE_CURRENT_SOURCE_DIR}/${example}/${filename}.java")
-  endforeach()
-
-  set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh)
-
-  if(enable_java)
-    string (REPLACE "-" "/" example_dir ${example})
-    add_jar(java-${example} SOURCES ${sources}
-            INCLUDE_JARS simgrid-java_jar
-            OUTPUT_NAME ${example}
-            OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${example_dir})
-    add_dependencies(java-all java-${example})
-
-    ADD_TESH(tesh-java-${example}  --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath=${TESH_CLASSPATH}${TESH_CLASSPATH_SEPARATOR}${example}.jar --cd ${CMAKE_BINARY_DIR}/teshsuite/java/${example_dir}  ${CMAKE_HOME_DIRECTORY}/teshsuite/java/${example_dir}/${example}.tesh)
-  endif()
-  set(examples_src ${examples_src} ${sources})
-endforeach()
-
-set(examples_src ${examples_src}                                                               PARENT_SCOPE)
-set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
diff --git a/teshsuite/java/semaphoregc/SemaphoreGC.java b/teshsuite/java/semaphoregc/SemaphoreGC.java
deleted file mode 100644 (file)
index e7e5210..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* This test ensures that the used semaphores are not garbage-collected while we still use it.
- * This was reported as bug #19893 on gforge.
- */
-
-package semaphoregc;
-
-import org.simgrid.msg.*;
-import org.simgrid.msg.Process;
-
-class SemCreator extends Process {
-  SemCreator(Host h, String n){
-    super(h, n);
-  }
-
-  public void main(String[] args) throws MsgException{
-    int j;
-    Msg.info("Creating 50 new Semaphores, yielding and triggering a GC after each");
-    for(j = 1; j <= 50; j++) {
-      new Semaphore(0);
-      waitFor(10);
-      System.gc();
-    }
-    Msg.info("It worked, we survived. The test is passed.");
-  }
-}
-
-public class SemaphoreGC {
-  private SemaphoreGC() {
-    throw new IllegalAccessError("Utility class");
-  }
-
-  public static void main(String[] args) throws Exception {
-    Msg.init(args);
-    if (args.length < 1) {
-      Msg.info("Usage: java -cp simgrid.jar:. semaphoregc.SemaphoreGC <deployment.xml>");
-      System.exit(1);
-    }
-    Msg.createEnvironment(args[0]);
-
-    new SemCreator(Host.getByName("Fafard"), "SemCreator").start();
-
-    Msg.run();
-  }
-}
diff --git a/teshsuite/java/semaphoregc/semaphoregc.tesh b/teshsuite/java/semaphoregc/semaphoregc.tesh
deleted file mode 100644 (file)
index 19adc30..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-! timeout 15
-
-$ ${javacmd:=java} -classpath ${classpath:=.} semaphoregc.SemaphoreGC ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.4r]%e(%i:%a@%h)%e%m%n"
-> [    0.0000] (0:maestro@) Using regular java threads.
-> [    0.0000] (1:SemCreator@Fafard) Creating 50 new Semaphores, yielding and triggering a GC after each
-> [  500.0000] (1:SemCreator@Fafard) It worked, we survived. The test is passed.
-> [  500.0000] (0:maestro@) Terminating the simulation...
diff --git a/teshsuite/java/sleephostoff/SleepHostOff.java b/teshsuite/java/sleephostoff/SleepHostOff.java
deleted file mode 100644 (file)
index 7df3646..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright (c) 2014-2023. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package sleephostoff;
-
-import org.simgrid.msg.*;
-import org.simgrid.msg.Process;
-
-class Sleeper extends Process {
-  public Sleeper(Host host, String name, String[] args) {
-    super(host,name,args);
-  }
-  public void main(String[] args) {
-    boolean stillAlive = true;
-    while (stillAlive) {
-      Msg.info("I'm not dead");
-      try {
-        Process.sleep(10);
-        stillAlive = true;
-      } catch (HostFailureException e) {
-        stillAlive = false;
-        Msg.info("catch HostFailureException: "+e.getLocalizedMessage());
-      }
-    }
-  }
-}
-
-class TestRunner extends Process {
-  public TestRunner(Host host, String name, String[] args) {
-    super(host,name,args);
-  }
-
-  public void main(String[] strings) throws MsgException {
-    Host host = Host.getByName("Tremblay");
-
-    Msg.info("**** **** **** ***** ***** Test Sleep ***** ***** **** **** ****");
-    Msg.info("Test sleep: Create a process on "+host.getName()+" that simply make periodic sleep, turn off "
-             +host.getName());
-    new Sleeper(host, "Sleeper", null).start();
-
-    waitFor(0.02);
-    Msg.info("Stop "+host.getName());
-    host.off();
-    Msg.info(host.getName()+" has been stopped");
-    waitFor(0.3);
-    Msg.info("Test sleep seems ok, cool! (number of Process : " + Process.getCount()
-             + ", it should be 1 (i.e. the Test one))");
-  }
-}
-
-public class SleepHostOff {
-  public static void main(String[] args) throws Exception {
-    Msg.init(args);
-
-    if (args.length < 1) {
-      Msg.info("Usage: java -cp simgrid.jar:. sleephostoff.SleepHostOff <platform.xml>");
-      System.exit(1);
-    }
-
-    Msg.createEnvironment(args[0]);
-
-    new TestRunner(Host.getByName("Fafard"), "TestRunner", null).start();
-
-    Msg.run();
-  }
-}
diff --git a/teshsuite/java/sleephostoff/sleephostoff.tesh b/teshsuite/java/sleephostoff/sleephostoff.tesh
deleted file mode 100644 (file)
index 46ca604..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-$ ${javacmd:=java} -classpath ${classpath:=.} sleephostoff.SleepHostOff ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Using regular java threads.
-> [  0.000000] (1:TestRunner@Fafard) **** **** **** ***** ***** Test Sleep ***** ***** **** **** ****
-> [  0.000000] (1:TestRunner@Fafard) Test sleep: Create a process on Tremblay that simply make periodic sleep, turn off Tremblay
-> [  0.000000] (2:Sleeper@Tremblay) I'm not dead
-> [  0.010000] (2:Sleeper@Tremblay) I'm not dead
-> [  0.020000] (1:TestRunner@Fafard) Stop Tremblay
-> [  0.020000] (2:Sleeper@Tremblay) I'm not dead
-> [  0.020000] (2:Sleeper@Tremblay) catch HostFailureException: Host Failure
-> [  0.020000] (1:TestRunner@Fafard) Tremblay has been stopped
-> [  0.320000] (1:TestRunner@Fafard) Test sleep seems ok, cool! (number of Process : 1, it should be 1 (i.e. the Test one))
-> [  0.320000] (0:maestro@) Terminating the simulation...
index 6a00d1e..3fe316b 100644 (file)
@@ -6,7 +6,7 @@
 /* Bug report: https://github.com/simgrid/simgrid/issues/40
  *
  * Task.listen used to be on async mailboxes as it always returned false.
- * This occurs in Java and C, but is only tested here in C.
+ * This occured in Java and C, but only C remains.
  */
 
 #include "simgrid/s4u.hpp"
index 4988146..7ca8e49 100644 (file)
@@ -1,7 +1,6 @@
 ### define source packages
 
 set(EXTRA_DIST
-  src/bindings/java/MANIFEST.in
   src/bindings/python/simgrid_python.cpp
   src/dag/dax.dtd
   src/dag/dax_dtd.c
@@ -488,61 +487,6 @@ set(DAG_SRC
   src/dag/loaders.cpp
   )
 
-set(JMSG_C_SRC
-  src/bindings/java/JavaContext.cpp
-  src/bindings/java/JavaContext.hpp
-  src/bindings/java/jmsg.cpp
-  src/bindings/java/jmsg.hpp
-  src/bindings/java/jmsg_as.cpp
-  src/bindings/java/jmsg_as.hpp
-  src/bindings/java/jmsg_comm.cpp
-  src/bindings/java/jmsg_comm.h
-  src/bindings/java/jmsg_host.cpp
-  src/bindings/java/jmsg_host.h
-  src/bindings/java/jmsg_process.cpp
-  src/bindings/java/jmsg_process.h
-  src/bindings/java/jmsg_synchro.cpp
-  src/bindings/java/jmsg_synchro.h
-  src/bindings/java/jmsg_task.cpp
-  src/bindings/java/jmsg_task.h
-  src/bindings/java/jmsg_vm.cpp
-  src/bindings/java/jmsg_vm.h
-  src/bindings/java/jxbt_utilities.cpp
-  src/bindings/java/jxbt_utilities.hpp
-  )
-
-set(JMSG_JAVA_SRC
-  src/bindings/java/org/simgrid/NativeLib.java
-  src/bindings/java/org/simgrid/msg/As.java
-  src/bindings/java/org/simgrid/msg/Comm.java
-  src/bindings/java/org/simgrid/msg/Host.java
-  src/bindings/java/org/simgrid/msg/HostFailureException.java
-  src/bindings/java/org/simgrid/msg/HostNotFoundException.java
-  src/bindings/java/org/simgrid/msg/JniException.java
-  src/bindings/java/org/simgrid/msg/Msg.java
-  src/bindings/java/org/simgrid/msg/MsgException.java
-  src/bindings/java/org/simgrid/msg/Mutex.java
-  src/bindings/java/org/simgrid/msg/Process.java
-  src/bindings/java/org/simgrid/msg/ProcessKilledError.java
-  src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java
-  src/bindings/java/org/simgrid/msg/Semaphore.java
-  src/bindings/java/org/simgrid/msg/Task.java
-  src/bindings/java/org/simgrid/msg/TaskCancelledException.java
-  src/bindings/java/org/simgrid/msg/TimeoutException.java
-  src/bindings/java/org/simgrid/msg/TransferFailureException.java
-  src/bindings/java/org/simgrid/msg/VM.java
-  )
-
-set(JTRACE_C_SRC
-  src/bindings/java/jtrace.cpp
-  src/bindings/java/jtrace.h
-  )
-
-set(JTRACE_JAVA_SRC src/bindings/java/org/simgrid/trace/Trace.java)
-
-list(APPEND JMSG_C_SRC ${JTRACE_C_SRC})
-list(APPEND JMSG_JAVA_SRC ${JTRACE_JAVA_SRC})
-
 set(TRACING_SRC
   src/instr/instr_config.cpp
   src/instr/instr_interface.cpp
@@ -857,20 +801,6 @@ set(DOC_SOURCES
   docs/source/_ext/showfile.css
   docs/source/_ext/showfile.js
   docs/source/_ext/showfile.py
-  docs/source/_ext/javasphinx/LICENSE
-  docs/source/_ext/javasphinx/MANIFEST.in
-  docs/source/_ext/javasphinx/README.md
-  docs/source/_ext/javasphinx/doc/conf.py
-  docs/source/_ext/javasphinx/doc/index.rst
-  docs/source/_ext/javasphinx/javasphinx/__init__.py
-  docs/source/_ext/javasphinx/javasphinx/apidoc.py
-  docs/source/_ext/javasphinx/javasphinx/compiler.py
-  docs/source/_ext/javasphinx/javasphinx/domain.py
-  docs/source/_ext/javasphinx/javasphinx/extdoc.py
-  docs/source/_ext/javasphinx/javasphinx/formatter.py
-  docs/source/_ext/javasphinx/javasphinx/htmlrst.py
-  docs/source/_ext/javasphinx/javasphinx/util.py
-  docs/source/_ext/javasphinx/setup.py
   docs/source/_static/css/custom.css
   docs/source/_templates/breadcrumbs.html
 
@@ -1026,7 +956,6 @@ set(txt_files
 set(CMAKEFILES_TXT
   examples/c/CMakeLists.txt
   examples/cpp/CMakeLists.txt
-  examples/deprecated/java/CMakeLists.txt
   examples/platforms/CMakeLists.txt
   examples/python/CMakeLists.txt
   examples/smpi/CMakeLists.txt
@@ -1037,7 +966,6 @@ set(CMAKEFILES_TXT
   examples/smpi/smpi_s4u_masterworker/CMakeLists.txt
   examples/sthread/CMakeLists.txt
 
-  teshsuite/java/CMakeLists.txt
   teshsuite/kernel/CMakeLists.txt
   teshsuite/mc/CMakeLists.txt
   teshsuite/models/CMakeLists.txt
@@ -1100,7 +1028,6 @@ set(CMAKE_SOURCE_FILES
   tools/cmake/Distrib.cmake
   tools/cmake/Documentation.cmake
   tools/cmake/Flags.cmake
-  tools/cmake/Java.cmake
   tools/cmake/MaintainerMode.cmake
   tools/cmake/MakeLib.cmake
   tools/cmake/Modules/FindGraphviz.cmake
index 8d871e3..276fc2e 100644 (file)
@@ -52,14 +52,6 @@ add_custom_target(simgrid_convert_TI_traces ALL
 # libraries
 install(TARGETS simgrid DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
 
-if(enable_java)
-  set(SIMGRID_JAR_TO_INSTALL "${SIMGRID_JAR}")
-  install(TARGETS simgrid-java DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
-  install(FILES ${SIMGRID_JAR_TO_INSTALL}
-      DESTINATION java/
-      RENAME simgrid.jar)
-endif()
-
 # pkg-config files
 configure_file("${CMAKE_HOME_DIRECTORY}/tools/pkg-config/simgrid.pc.in"
   "${PROJECT_BINARY_DIR}/simgrid.pc" @ONLY)
@@ -95,7 +87,6 @@ set(source_to_pack
   ${headers_to_install}
   ${source_of_generated_headers}
   ${JMSG_C_SRC}
-  ${JMSG_JAVA_SRC}
   ${MC_SRC_BASE}
   ${MC_SRC}
   ${MC_SIMGRID_MC_SRC}
index 4dcdc42..dd025f8 100644 (file)
@@ -1,28 +1,11 @@
 ###
-### Generate all parts of the documentation
+### Generate the manpages documentation. The sphinx content is not handled in cmake but with the Build.sh script
 ###
-###   - Javadoc (reference)
-###   - manpages (reference of tools)
 
 #### Generate the html documentation
 find_path(FIG2DEV_PATH  NAMES fig2dev  PATHS NO_DEFAULT_PATHS)
 
 if(enable_documentation)
-  if (Java_FOUND)
-    find_path(JAVADOC_PATH  NAMES javadoc   PATHS NO_DEFAULT_PATHS)
-    mark_as_advanced(JAVADOC_PATH)
-
-   ADD_CUSTOM_TARGET(documentation
-      COMMENT "Generating the SimGrid documentation..."
-      COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc/html
-    )
-   ADD_CUSTOM_COMMAND(TARGET documentation
-      COMMAND ${CMAKE_COMMAND} -E echo "XX Javadoc pass"
-      COMMAND ${JAVADOC_PATH}/javadoc -quiet -d ${CMAKE_BINARY_DIR}/doc/html/javadoc/ ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/*.java ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/*/*.java
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc
-    )
-  endif()
-
   #### Generate the manpages
   if( NOT MANPAGE_DIR)
     set( MANPAGE_DIR ${CMAKE_BINARY_DIR}/manpages )
index da04a8a..2c71772 100644 (file)
@@ -65,7 +65,6 @@ if(enable_compile_warnings)
   elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all")
   endif()
-  set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint")
 endif()
 
 # NDEBUG gives a lot of "initialized but unused variables" errors. Don't die anyway.
diff --git a/tools/cmake/Java.cmake b/tools/cmake/Java.cmake
deleted file mode 100644 (file)
index d9b2bb1..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-##
-## The Cmake definitions for the use of Java (and Scala)
-##   This file is loaded only if the Java option is activated
-##
-
-find_package(Java 1.8 COMPONENTS Runtime Development)
-if (NOT ${Java_FOUND})
-  message(FATAL_ERROR "Java not found (need at least Java8). Please install the JDK or disable that option")
-endif()
-set(Java_FOUND 1)
-include(UseJava)
-
-find_package(JNI REQUIRED)
-message(STATUS "[Java] JNI found: ${JNI_FOUND}")
-message(STATUS "[Java] JNI include dirs: ${JNI_INCLUDE_DIRS}")
-
-# Rules to build libsimgrid-java
-################################
-
-add_library(simgrid-java SHARED ${JMSG_C_SRC})
-set_target_properties(simgrid-java PROPERTIES VERSION          ${libsimgrid-java_version})
-set_target_properties(simgrid-java PROPERTIES SKIP_BUILD_RPATH ON)
-set_property(TARGET simgrid-java
-             APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
-
-target_link_libraries(simgrid-java simgrid)
-add_dependencies(tests simgrid-java)
-
-get_target_property(COMMON_INCLUDES simgrid-java INCLUDE_DIRECTORIES)
-if (COMMON_INCLUDES)
-  set_target_properties(simgrid-java PROPERTIES  INCLUDE_DIRECTORIES "${COMMON_INCLUDES};${JNI_INCLUDE_DIRS}")
-else()
-  set_target_properties(simgrid-java PROPERTIES  INCLUDE_DIRECTORIES "${JNI_INCLUDE_DIRS}")
-endif()
-
-get_target_property(CHECK_INCLUDES simgrid-java INCLUDE_DIRECTORIES)
-message(STATUS "[Java] simgrid-java includes: ${CHECK_INCLUDES}")
-
-# Rules to build simgrid.jar
-############################
-
-## Files to include in simgrid.jar
-##
-set(SIMGRID_JAR "${CMAKE_BINARY_DIR}/simgrid.jar")
-set(MANIFEST_IN_FILE "${CMAKE_HOME_DIRECTORY}/src/bindings/java/MANIFEST.in")
-set(MANIFEST_FILE "${CMAKE_BINARY_DIR}/src/bindings/java/MANIFEST.MF")
-
-set(LIBSIMGRID_SO       libsimgrid${CMAKE_SHARED_LIBRARY_SUFFIX})
-set(LIBSIMGRID_JAVA_SO  ${CMAKE_SHARED_LIBRARY_PREFIX}simgrid-java${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-## Here is how to build simgrid.jar
-##
-add_jar(simgrid-java_jar ${JMSG_JAVA_SRC} OUTPUT_NAME simgrid)
-
-if(enable_lib_in_jar)
-  add_dependencies(simgrid-java_jar simgrid-java)
-  add_dependencies(simgrid-java_jar simgrid)
-endif()
-
-if (enable_documentation)
-  add_custom_command(
-    TARGET simgrid-java_jar POST_BUILD
-    COMMENT "Add the documentation into simgrid.jar..."
-    DEPENDS ${MANIFEST_IN_FILE}
-            ${CMAKE_HOME_DIRECTORY}/COPYING
-            ${CMAKE_HOME_DIRECTORY}/ChangeLog
-            ${CMAKE_HOME_DIRECTORY}/NEWS
-            ${CMAKE_HOME_DIRECTORY}/LICENSE-LGPL-2.1
-
-    COMMAND ${CMAKE_COMMAND} -E copy ${MANIFEST_IN_FILE} ${MANIFEST_FILE}
-    COMMAND ${CMAKE_COMMAND} -E echo "Specification-Version: \\\"${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}\\\"" >> ${MANIFEST_FILE}
-    COMMAND ${CMAKE_COMMAND} -E echo "Implementation-Version: \\\"${GIT_VERSION}\\\"" >> ${MANIFEST_FILE}
-
-    COMMAND ${Java_JAVADOC_EXECUTABLE} -quiet -d doc/javadoc -sourcepath ${CMAKE_HOME_DIRECTORY}/src/bindings/java/ org.simgrid.msg org.simgrid.trace
-
-    COMMAND ${JAVA_ARCHIVE} -uvmf ${MANIFEST_FILE} ${SIMGRID_JAR} doc/javadoc
-    COMMAND ${JAVA_ARCHIVE} -uvf  ${SIMGRID_JAR} -C ${CMAKE_HOME_DIRECTORY} COPYING -C ${CMAKE_HOME_DIRECTORY} ChangeLog -C ${CMAKE_HOME_DIRECTORY} LICENSE-LGPL-2.1 -C ${CMAKE_HOME_DIRECTORY} NEWS
-  )
-endif()
-
-###
-### Pack the java libraries into the jarfile if asked to do so
-###
-
-if(enable_lib_in_jar)
-  set(SG_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
-
-  if(${SG_SYSTEM_NAME} MATCHES "kFreeBSD")
-    set(SG_SYSTEM_NAME GNU/kFreeBSD)
-  endif()
-
-  set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})
-  if( (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$") OR
-      (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") OR
-      (${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64") )
-    if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
-      set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/x86)
-    else()
-      set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/amd64)
-    endif()
-  endif()
-  if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
-    set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/arm) # Default arm (soft-float ABI)
-  endif()
-
-  add_custom_command(
-    TARGET simgrid-java_jar POST_BUILD
-    COMMENT "Add the native libs into simgrid.jar..."
-    DEPENDS simgrid simgrid-java ${JAVALIBS}
-
-    COMMAND ${CMAKE_COMMAND} -E make_directory   ${JAVA_NATIVE_PATH}
-
-    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_SO}      ${JAVA_NATIVE_PATH}/${LIBSIMGRID_SO}
-    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_JAVA_SO} ${JAVA_NATIVE_PATH}/${LIBSIMGRID_JAVA_SO}
-  )
-
-if(APPLE)
-  add_custom_command(
-    TARGET simgrid-java_jar POST_BUILD
-    COMMENT "Add the apple-specific native libs into simgrid.jar..."
-    DEPENDS simgrid simgrid-java ${JAVALIBS}
-
-    # We need to fix the rpath of the simgrid-java library so that it
-    #    searches the simgrid library in the right location
-    #
-    # Since we don't officially install the lib before copying it in
-    # the jarfile, the lib is searched for where it was built. Given
-    # how we unpack it, we need to instruct simgrid-java to forget
-    # about the build path, and search in its current directory
-    # instead.
-    #
-    # This has to be done with the classical Apple tools, as follows:
-
-    COMMAND install_name_tool -change ${CMAKE_BINARY_DIR}/lib/libsimgrid.${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX} @loader_path/libsimgrid.dylib ${JAVA_NATIVE_PATH}/${LIBSIMGRID_JAVA_SO}
-  )
-endif(APPLE)
-
-  add_custom_command(
-    TARGET simgrid-java_jar POST_BUILD
-    COMMENT "Packing back the simgrid.jar with the native libs (turn lib_in_jar off when coding in java)..."
-    DEPENDS simgrid simgrid-java ${JAVALIBS}
-
-    COMMAND ${JAVA_ARCHIVE} -uvf ${SIMGRID_JAR}  ${JAVA_NATIVE_PATH}
-
-    COMMAND ${CMAKE_COMMAND} -E echo "-- Cmake put the native code in ${JAVA_NATIVE_PATH}"
-    COMMAND "${Java_JAVA_EXECUTABLE}" -classpath "${SIMGRID_JAR}" org.simgrid.NativeLib
-  )
-endif(enable_lib_in_jar)
-
-include_directories(${JNI_INCLUDE_DIRS} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
index 551c48e..4afca47 100644 (file)
@@ -2,6 +2,7 @@
 
 # On macOS, specify that rpath is useful to look for the dependencies
 # See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling and Java.cmake
+# TODO: is it still useful now that Java is gone? For Python maybe?
 set(CMAKE_MACOSX_RPATH TRUE)
 if(APPLE)
   SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # When installed, use system path
index b3ed2f3..1ac8929 100644 (file)
@@ -1,5 +1,5 @@
 ### ARGs use -D[var]=[ON/OFF] or [1/0] or [true/false](see below)
-### ex: cmake -Denable_java=ON -Denable_ns3=ON ./
+### ex: cmake -Denable_ns3=ON ./
 
 set(BIBTEX2HTML ${BIBTEX2HTML} CACHE PATH "Path to bibtex2html")
 
@@ -23,15 +23,16 @@ option(enable_debug                 "Turn this off to remove all debug messages
 option(enable_documentation "Whether to produce documentation" off)
 
 option(enable_ns3            "Whether ns-3 model is activated." off)
-option(enable_java           "Whether the Java bindings are activated." off)
 option(enable_msg            "Whether the MSG module is activated." off)
-option(enable_lib_in_jar     "Whether the native libraries are bundled in a Java jar file" on)
-option(minimal-bindings      "Whether to compile the bindings libraries (Java/Python) with the minimal dependency set" off)
-mark_as_advanced(minimal-bindings)
-if(minimal-bindings)
-  set(enable_lib_in_jar on)
+option(enable_java            "Java was removed from SimGrid v3.33. Please do not enable it here." off)
+mark_as_advanced(enable_java)
+if (enable_java)
+  message(FATAL "Java was removed from SimGrid v3.33. Please stick to v3.32 or earlier if you need Java.")
 endif()
 
+option(minimal-bindings      "Whether to compile the Python bindings libraries with the minimal dependency set" off)
+mark_as_advanced(minimal-bindings)
+
 option(enable_model-checking "Turn this on to experiment with our prototype of model-checker (hinders the simulation's performance even if turned off at runtime)" off)
 option(enable-model-checking "Please set 'enable_model-checking' instead" off)
 mark_as_advanced(enable-model-checking)
index aa6cf46..a7182fe 100644 (file)
@@ -109,11 +109,6 @@ MACRO(SET_TESH_PROPERTIES NAME FACTORIES)
   ENDFOREACH()
 ENDMACRO()
 
-IF(enable_java)
-  SET(TESH_CLASSPATH_SEPARATOR ":")
-  SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/deprecated/java/${TESH_CLASSPATH_SEPARATOR}${CMAKE_BINARY_DIR}/teshsuite/java/${TESH_CLASSPATH_SEPARATOR}${SIMGRID_JAR}")
-ENDIF()
-
 # New tests should use the Catch Framework
 set(UNIT_TESTS  src/xbt/unit-tests_main.cpp
                 src/kernel/resource/NetworkModelFactors_test.cpp
index b1f64bb..1730440 100644 (file)
@@ -16,7 +16,7 @@ RUN apt update && apt -y upgrade
 RUN apt install -y g++ gcc git valgrind gfortran libboost-dev libeigen3-dev libboost-stacktrace-dev cmake dpkg-dev libunwind-dev libdw-dev libelf-dev libevent-dev python3-dev && \
     mkdir /source/ && cd /source && git clone --depth=1 https://framagit.org/simgrid/simgrid.git simgrid.git && \
     cd simgrid.git && \
-    cmake -DCMAKE_INSTALL_PREFIX=/usr/ -Denable_model-checking=ON -Denable_documentation=OFF -Denable_java=OFF -Denable_smpi=ON -Denable_compile_optimizations=ON . && \
+    cmake -DCMAKE_INSTALL_PREFIX=/usr/ -Denable_model-checking=ON -Denable_documentation=OFF -Denable_smpi=ON -Denable_compile_optimizations=ON . && \
     make -j6 install && \
     git clone --depth=1 https://framagit.org/simgrid/tutorial-model-checking /source/tuto-mc.git && \
     printf "ndet-receive-s4u:\n\t@echo \"Please run the following command before make:\";echo \"    cmake .\"; exit 1" > /source/tuto-mc.git/Makefile &&\
index b3b9b06..9be2f5b 100644 (file)
@@ -14,7 +14,6 @@
 + README\.coding
 + \.circleci/.*
 + \.clang-format
-+ \.classpath
 + \.editorconfig
 + \.gitlab-ci\.yml
 + \.readthedocs.yml
index abbf35a..1e0a264 100644 (file)
@@ -38,9 +38,6 @@ https
 inlining
 ingroup
 int
-java
-Java
-JNI
 kcachegrind
 KILLME
 lat
index 8566d0a..8eea064 100755 (executable)
@@ -12,8 +12,6 @@ echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
 rm -f /tmp/cc*
 rm -f /tmp/*.so
 rm -f /tmp/*.so.*
-rm -rf /tmp/simgrid-java*
-rm -rf /var/tmp/simgrid-java*
 rm -rf /tmp/jvm-*
 find "$WORKSPACE" -name "hs_err_pid*.log" -exec rm -f {} +
 ls /tmp
@@ -59,7 +57,6 @@ NUMPROC="$(nproc)" || NUMPROC=1
 
 
 cd "$BUILDFOLDER"
-rm -rf java_cov*
 rm -rf jacoco_cov*
 rm -rf python_cov*
 rm -rf xml_coverage.xml
index 028e6e2..9d3af90 100755 (executable)
@@ -18,7 +18,7 @@ onoff() {
   fi
 }
 
-[ $# -eq 5 ] || die "Needs 5 arguments : JAVA MC SMPI DEBUG MSG"
+[ $# -eq 4 ] || die "Needs 4 arguments : MC SMPI DEBUG MSG"
 
 ### Cleanup previous runs
 
@@ -44,49 +44,36 @@ cd "$WORKSPACE"/build
 
 #we can't just receive ON or OFF as values as display is bad in the resulting jenkins matrix
 
-if [ "$1" = "JAVA" ]
-then
-  buildjava="ON"
-else
-  buildjava="OFF"
-fi
-
-if [ "$2" = "MC" ]
+if [ "$1" = "MC" ]
 then
   buildmc="ON"
 else
   buildmc="OFF"
 fi
 
-if [ "$3" = "SMPI" ]
+if [ "$2" = "SMPI" ]
 then
   buildsmpi="ON"
 else
   buildsmpi="OFF"
 fi
 
-if [ "$4" = "DEBUG" ]
+if [ "$3" = "DEBUG" ]
 then
   builddebug="ON"
 else
   builddebug="OFF"
 fi
 
-if [ "$5" = "MSG" ]
+if [ "$4" = "MSG" ]
 then
   buildmsg="ON"
 else
   buildmsg="OFF"
 fi
 
-if [ $buildmsg = "OFF" ] && [ $buildjava = "ON" ]
-then
-  echo "Don't even try to build Java without MSG"
-  exit 0
-fi
-
-echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}, MSG=${buildmsg}"
-cmake -Denable_documentation=OFF -Denable_java=${buildjava} -Denable_msg=${buildmsg} \
+echo "Step ${STEP}/${NSTEPS} - Building with debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}, MSG=${buildmsg}"
+cmake -Denable_documentation=OFF -Denable_msg=${buildmsg} \
       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
       -Denable_mallocators=ON -Denable_debug=${builddebug} \
       -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
index 2b5d8ce..04b4737 100755 (executable)
@@ -74,7 +74,7 @@ cd "$WORKSPACE"/build
 
 ctest -D ExperimentalStart || true
 
-cmake -Denable_documentation=OFF -Denable_java=OFF \
+cmake -Denable_documentation=OFF \
       -Denable_compile_optimizations=ON -Denable_compile_warnings=ON \
       -Denable_mallocators=OFF \
       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \
index 36c17be..131f03c 100755 (executable)
@@ -12,8 +12,6 @@ echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
 rm -f /tmp/cc*
 rm -f /tmp/*.so
 rm -f /tmp/*.so.*
-rm -rf /tmp/simgrid-java*
-rm -rf /var/tmp/simgrid-java*
 rm -rf /tmp/jvm-*
 find $WORKSPACE -name "hs_err_pid*.log" -exec rm -f {} +
 ls /tmp
@@ -222,7 +220,6 @@ cmake -G"$GENERATOR" ${INSTALL:+-DCMAKE_INSTALL_PREFIX=$INSTALL} \
   -Denable_ns3=$(onoff test "$have_NS3" = "yes" -a "$build_mode" = "Debug") \
   -DSIMGRID_PYTHON_LIBDIR=${SIMGRID_PYTHON_LIBDIR} \
   ${MAY_DISABLE_SOURCE_CHANGE} ${MAY_DISABLE_LTO} ${MAY_HINT_AT_NS3} \
-  -Denable_java=$(onoff test "$build_mode" = "ModelChecker") \
   -Denable_msg=$(onoff test "$build_mode" = "ModelChecker") \
   -DLTO_EXTRA_FLAG="auto" \
   -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
index 10397ae..98a18e1 100644 (file)
    fun:_Ux86_64_setcontext
 }
 
-# Java cruft
-{
-  JavaCruft 1
-  Memcheck:Addr4
-  ...
-  fun:_ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread
-  fun:JVM_DoPrivileged
-  ...
-}
-{
-   JavaCruft 2
-   Memcheck:Cond
-   ...
-   fun:_ZN13CompileBroker25invoke_compiler_on_methodEP11CompileTask
-   ...
-}
-
-{
-   Somewhere within the Java conditions and monitors
-   Memcheck:Cond
-   fun:MarsagliaXORV
-   ...
-}
-
-#ignore python cruft
+# Ignore python cruft
 {
    ignore python cruft 1
    Memcheck:Cond