Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 21 Jul 2022 16:22:02 +0000 (18:22 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 21 Jul 2022 16:22:02 +0000 (18:22 +0200)
MANIFEST.in
docs/source/Platform_cpp.rst
examples/cpp/CMakeLists.txt
src/bindings/java/org/simgrid/NativeLib.java
src/sthread/sthread.c
src/sthread/sthread_impl.cpp
src/surf/HostImpl.cpp
teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh

index 09a068e..5be3136 100644 (file)
@@ -553,12 +553,12 @@ include examples/python/exec-async/exec-async.py
 include examples/python/exec-async/exec-async.tesh
 include examples/python/exec-basic/exec-basic.py
 include examples/python/exec-basic/exec-basic.tesh
-include examples/python/exec-basic/exec-ptask.py
-include examples/python/exec-basic/exec-ptask.tesh
 include examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py
 include examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.tesh
 include examples/python/exec-dvfs/exec-dvfs.py
 include examples/python/exec-dvfs/exec-dvfs.tesh
+include examples/python/exec-ptask/exec-ptask.py
+include examples/python/exec-ptask/exec-ptask.tesh
 include examples/python/exec-remote/exec-remote.py
 include examples/python/exec-remote/exec-remote.tesh
 include examples/python/io-degradation/io-degradation.py
@@ -713,6 +713,7 @@ include examples/smpi/trace_call_location/trace_call_location.tesh
 include examples/smpi/trace_simple/trace_simple.c
 include examples/smpi/trace_simple/trace_simple.tesh
 include examples/sthread/pthread-mutex-simple.c
+include examples/sthread/pthread-mutex-simple.tesh
 include examples/sthread/sthread-mutex-simple.c
 include src/include/catch_simgrid.hpp
 include teshsuite/java/semaphoregc/SemaphoreGC.java
index 75abec5..e0aad12 100644 (file)
@@ -155,7 +155,7 @@ Note that the leaves and loopback links are defined through callbacks, as follow
 
     /* create each leaf in the Fat-Tree, return a pair composed of: <object (host, zone), gateway> */
     static std::pair<simgrid::kernel::routing::NetPoint*, simgrid::kernel::routing::NetPoint*>
-    create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned int>& /*coord*/, int id)
+    create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned long>& /*coord*/, unsigned long id)
     {
       /* creating zone */
       std::string hostname = "host" + std::to_string(id);
index c16f574..bc8952b 100644 (file)
@@ -78,11 +78,11 @@ else()
   endforeach()
 endif()
 
-if (SIMGRID_HAVE_MC)
-  # Hijack some regular tests to run them on top of the MC
-  foreach (example synchro-barrier synchro-mutex synchro-semaphore)
-    set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-mc-${example}.tesh)
+# Hijack some regular tests to run them on top of the MC
+foreach (example synchro-barrier synchro-mutex synchro-semaphore)
+  set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-mc-${example}.tesh)
 
+  if (SIMGRID_HAVE_MC)
     ADD_TESH(s4u-mc-${example}
              --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example}
              --setenv libdir=${CMAKE_BINARY_DIR}/lib
@@ -92,8 +92,10 @@ if (SIMGRID_HAVE_MC)
              ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-mc-${example}.tesh)
 
     add_dependencies(tests-mc s4u-${example})
-  endforeach()
+  endif()
+endforeach()
 
+if (SIMGRID_HAVE_MC)
   # Dependency on the regular tests
   foreach(example mc-centralized-mutex)
     add_dependencies(tests-mc s4u-${example})
index 5d2b646..507a2cb 100644 (file)
@@ -48,6 +48,12 @@ public final class NativeLib {
                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 */
@@ -108,8 +114,6 @@ public final class NativeLib {
                        }
 
                        tempDir = Files.createTempDirectory(tempPrefix);
-                       // don't leak the files on disk, but remove it on JVM shutdown
-                       Runtime.getRuntime().addShutdownHook(new Thread(new FileCleaner(tempDir.toFile())));
                }
 
                /* For each possible filename of the given library on all possible OSes, try it */
index 15f01a8..a52fec8 100644 (file)
@@ -70,7 +70,7 @@ int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*start_
     return raw_pthread_create(thread, attr, start_routine, arg);
 
   sthread_inside_simgrid = 1;
-  int res                = sthread_create(thread, attr, start_routine, arg);
+  int res                = sthread_create((sthread_t*)thread, attr, start_routine, arg);
   sthread_inside_simgrid = 0;
   return res;
 }
@@ -83,7 +83,7 @@ int pthread_join(pthread_t thread, void** retval)
     return raw_pthread_join(thread, retval);
 
   sthread_inside_simgrid = 1;
-  int res                = sthread_join(thread, retval);
+  int res                = sthread_join((sthread_t)thread, retval);
   sthread_inside_simgrid = 0;
   return res;
 }
@@ -174,7 +174,7 @@ int gettimeofday(struct timeval* tv, XBT_ATTRIB_UNUSED TIMEZONE_TYPE* tz)
     intercepter_init();
 
   if (sthread_inside_simgrid)
-    return raw_gettimeofday(tv, (void*)tz);
+    return raw_gettimeofday(tv, tz);
 
   sthread_inside_simgrid = 1;
   int res                = sthread_gettimeofday(tv);
@@ -229,11 +229,6 @@ int sem_post(sem_t *sem) {
        return raw_sem_post(sem);
 }
 
-int pthread_join(pthread_t thread, void **retval) {
-       sg_actor_join(thread, -1);
-    return 0;
-}
-
 int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr) {
     *cond = sg_cond_init();
     return 0;
index 768a0d5..7721982 100644 (file)
@@ -166,11 +166,6 @@ int sem_post(sem_t *sem) {
        return raw_sem_post(sem);
 }
 
-int pthread_join(pthread_t thread, void **retval) {
-       sg_actor_join(thread, -1);
-    return 0;
-}
-
 int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr) {
     *cond = sg_cond_init();
     return 0;
index 82b2f92..d646288 100644 (file)
@@ -159,11 +159,12 @@ s4u::VirtualMachine* HostImpl::create_vm(const std::string& name, s4u::VirtualMa
   auto* cpu =
       englobing_zone_->get_cpu_vm_model()->create_cpu(vm, speeds)->set_core_count(vm->get_vm_impl()->get_core_amount());
 
-  if (get_iface()->get_pstate() != 0)
-    cpu->set_pstate(get_iface()->get_pstate());
-
   cpu->seal();
 
+  if (get_iface()->get_pstate() != 0) {
+    cpu->set_pstate(get_iface()->get_pstate());
+  }
+
   /* Currently, a VM uses the network resource of its physical host */
   vm->set_netpoint(get_iface()->get_netpoint());
 
index 940489f..fff9336 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test allreduce
 ! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ${platfdir:=.}/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_config.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async-small-thresh:65536 --cfg=smpi/send-is-detached-thresh:128000 --cfg=smpi/simulate-computation:no "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ${platfdir:=.}/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_config.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async-small-thresh:65536 --cfg=smpi/send-is-detached-thresh:128000 --cfg=smpi/simulate-computation:no "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error  --log=root.app:stdout
 > [  0.000000] (0:maestro@) [rank 0] -> Tremblay
 > [  0.000000] (0:maestro@) [rank 1] -> Tremblay
 > [  0.000000] (0:maestro@) [rank 2] -> Tremblay