From: Frederic Suter Date: Tue, 17 Sep 2019 07:34:49 +0000 (+0200) Subject: another test conversion to disks X-Git-Tag: v3.24~73 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/83c4a771b7e8e4649b2a65877e93e8ba5eb7c887 another test conversion to disks --- diff --git a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp index 9cb7c06d96..1261137a37 100644 --- a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp +++ b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp @@ -9,22 +9,22 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u test"); static void host() { - simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk1"); - int id = simgrid::s4u::this_actor::get_pid(); + simgrid::s4u::Disk* disk = simgrid::s4u::this_actor::get_host()->get_disks().front(); // Disk1 + int id = simgrid::s4u::this_actor::get_pid(); XBT_INFO("process %d is writing!", id); - storage->write(3000000); + disk->write(4000000); XBT_INFO("process %d goes to sleep for %d seconds", id, id); simgrid::s4u::this_actor::sleep_for(id); XBT_INFO("process %d is writing again!", id); - storage->write(3000000); + disk->write(4000000); XBT_INFO("process %d goes to sleep for %d seconds", id, 6 - id); simgrid::s4u::this_actor::sleep_for(6 - id); XBT_INFO("process %d is reading!", id); - storage->read(3000000); + disk->read(4000000); XBT_INFO("process %d goes to sleep for %d seconds", id, id); simgrid::s4u::this_actor::sleep_for(id); XBT_INFO("process %d is reading again!", id); - storage->read(3000000); + disk->read(4000000); } int main(int argc, char** argv) diff --git a/teshsuite/s4u/concurrent_rw/concurrent_rw.tesh b/teshsuite/s4u/concurrent_rw/concurrent_rw.tesh index 89994b3073..89e43ce300 100644 --- a/teshsuite/s4u/concurrent_rw/concurrent_rw.tesh +++ b/teshsuite/s4u/concurrent_rw/concurrent_rw.tesh @@ -1,4 +1,4 @@ -$ ./concurrent_rw ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n" +$ ./concurrent_rw ${platfdir}/hosts_with_disks.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n" > [ 0.000000] (host@bob) process 1 is writing! > [ 0.000000] (host@bob) process 2 is writing! > [ 0.000000] (host@bob) process 3 is writing! @@ -24,14 +24,14 @@ $ ./concurrent_rw ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%P@ > [ 6.600000] (host@bob) process 3 is reading! > [ 6.600000] (host@bob) process 4 is reading! > [ 6.600000] (host@bob) process 5 is reading! -> [ 6.750000] (host@bob) process 1 goes to sleep for 1 seconds -> [ 6.750000] (host@bob) process 2 goes to sleep for 2 seconds -> [ 6.750000] (host@bob) process 3 goes to sleep for 3 seconds -> [ 6.750000] (host@bob) process 4 goes to sleep for 4 seconds -> [ 6.750000] (host@bob) process 5 goes to sleep for 5 seconds -> [ 7.750000] (host@bob) process 1 is reading again! -> [ 8.750000] (host@bob) process 2 is reading again! -> [ 9.750000] (host@bob) process 3 is reading again! -> [ 10.750000] (host@bob) process 4 is reading again! -> [ 11.750000] (host@bob) process 5 is reading again! -> [ 11.780000] (maestro@) Simulation time 11.78 +> [ 6.800000] (host@bob) process 1 goes to sleep for 1 seconds +> [ 6.800000] (host@bob) process 2 goes to sleep for 2 seconds +> [ 6.800000] (host@bob) process 3 goes to sleep for 3 seconds +> [ 6.800000] (host@bob) process 4 goes to sleep for 4 seconds +> [ 6.800000] (host@bob) process 5 goes to sleep for 5 seconds +> [ 7.800000] (host@bob) process 1 is reading again! +> [ 8.800000] (host@bob) process 2 is reading again! +> [ 9.800000] (host@bob) process 3 is reading again! +> [ 10.800000] (host@bob) process 4 is reading again! +> [ 11.800000] (host@bob) process 5 is reading again! +> [ 11.840000] (maestro@) Simulation time 11.84