From: Martin Quinson Date: Sat, 7 Apr 2018 15:13:12 +0000 (+0200) Subject: kill ALL trailing whitespace (and deprecate a function in Link) X-Git-Tag: v3.20~508 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/27b0c1ee1d85c53f1d11bb2b8e539cd76e4cf437?ds=sidebyside kill ALL trailing whitespace (and deprecate a function in Link) Sorry for the mixup, I forgot to commit between the two change sets. --- diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 6b37ba7b53..efdc1bd822 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -232,9 +232,9 @@ public: /** Resume a suspended actor by resuming the task on which it was waiting for the completion. */ void resume(); - + void yield(); - + /** Returns true if the actor is suspended. */ int isSuspended(); diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index 62f76333dd..120989b33d 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -31,13 +31,17 @@ class XBT_PUBLIC Link : public simgrid::xbt::Extendable { public: /** @brief Retrieve a link from its name */ - static Link* byName(const char* name); + static Link* by_name(const char* name); /** @brief Retrieves the name of that link as a C++ string */ const std::string& get_name() const; /** @brief Retrieves the name of that link as a C string */ const char* get_cname() const; + XBT_ATTRIB_DEPRECATED_v323("Please use Link::by_name()") static Link* byName(const char* name) + { + return by_name(name); + } XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_name()") const std::string& getName() const { return get_name(); } XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_cname()") const char* getCname() const { return get_cname(); } diff --git a/include/simgrid_config.h.in b/include/simgrid_config.h.in index 3ee9f3f204..3b93712833 100644 --- a/include/simgrid_config.h.in +++ b/include/simgrid_config.h.in @@ -9,7 +9,7 @@ #define SIMGRID_PUBLIC_CONFIG_H #include -/** Define the version numbers of the used header files. +/** Define the version numbers of the used header files. See sg_version_get() to retrieve the version of the dynamic library. */ #define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@ #define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@ diff --git a/include/smpi/mpif.h.in b/include/smpi/mpif.h.in index 580f2b3a6e..a84311ca43 100644 --- a/include/smpi/mpif.h.in +++ b/include/smpi/mpif.h.in @@ -165,7 +165,7 @@ parameter(MPI_WIN_DISP_UNIT=-3) ! These IDs have to be unique, consecutive -! and ordered as in smpi_f77.cpp. +! and ordered as in smpi_f77.cpp. parameter(MPI_COMM_WORLD=0) parameter(MPI_BYTE=1) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index bccb165e6d..b6271b6e9a 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -1054,8 +1054,7 @@ std::vector> shift_and_frame_private_blocks(const std: size_t offset, size_t buff_size); std::vector> merge_private_blocks(std::vector> src, std::vector> dst); - - + #endif #endif diff --git a/src/bindings/java/org/simgrid/NativeLib.java b/src/bindings/java/org/simgrid/NativeLib.java index a2c966cda6..1902618e19 100644 --- a/src/bindings/java/org/simgrid/NativeLib.java +++ b/src/bindings/java/org/simgrid/NativeLib.java @@ -13,9 +13,9 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Path; -/** Helper class loading the native functions of SimGrid that we use for downcalls - * - * Almost all org.simgrid.msg.* classes contain a static bloc (thus executed when the class is loaded) +/** Helper class loading the native functions of SimGrid that we use for downcalls + * + * Almost all org.simgrid.msg.* classes contain a static bloc (thus executed when the class is loaded) * containing a call to this. */ public final class NativeLib { @@ -27,8 +27,8 @@ public final class NativeLib { throw new IllegalAccessError("Utility class"); } - /** Hidden debug main() function - * + /** 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. @@ -96,8 +96,8 @@ public final class NativeLib { } /* For each possible filename of the given library on all possible OSes, try it */ - for (String filename : new String[] - { name, + for (String filename : new String[] + { name, "lib"+name+".so", /* linux */ name+".dll", "lib"+name+".dll", /* windows (pure and mingw) */ "lib"+name+".dylib" /* mac osx */}) { @@ -110,11 +110,11 @@ public final class NativeLib { if (in == null) continue; // Try the next name: no such file found - /* copy the library in position */ - byte[] buffer = new byte[4096]; - int bytesRead; + /* copy the library in position */ + byte[] buffer = new byte[4096]; + int bytesRead; while ((bytesRead = in.read(buffer)) != -1) // Read until EOF - out.write(buffer, 0, bytesRead); + out.write(buffer, 0, bytesRead); out.close(); // Windows cannot open it twice, so close it first. Shame. diff --git a/src/bindings/java/org/simgrid/msg/As.java b/src/bindings/java/org/simgrid/msg/As.java index 92ee06bc08..83cea1c3bd 100644 --- a/src/bindings/java/org/simgrid/msg/As.java +++ b/src/bindings/java/org/simgrid/msg/As.java @@ -14,7 +14,7 @@ public class As { @Override public String toString (){ - return this.getName(); + return this.getName(); } public native String getName(); diff --git a/src/bindings/java/org/simgrid/msg/Comm.java b/src/bindings/java/org/simgrid/msg/Comm.java index 12e6a11ed3..d4b405ec34 100644 --- a/src/bindings/java/org/simgrid/msg/Comm.java +++ b/src/bindings/java/org/simgrid/msg/Comm.java @@ -14,7 +14,7 @@ public class Comm { protected boolean finished = false; /** * Represents the bind between the java comm and the - * native C comm. You must never access it, since it is + * native C comm. You must never access it, since it is * automatically set. */ private long bind = 0; diff --git a/src/bindings/java/org/simgrid/msg/File.java b/src/bindings/java/org/simgrid/msg/File.java index 23283cfdf0..3633c5921f 100644 --- a/src/bindings/java/org/simgrid/msg/File.java +++ b/src/bindings/java/org/simgrid/msg/File.java @@ -12,25 +12,25 @@ public class File { public static final int SEEK_END = 2; /** * Represents the bind between the java comm and the - * native C comm. You must never access it, since it is + * native C comm. You must never access it, since it is * automatically set. */ private long bind = 0; /** * Constructor, opens the file. - * @param path is the file location on the storage + * @param path is the file location on the storage */ public File(String path) { open(path); } /** - * Opens the file whose name is the string pointed to by path. + * Opens the file whose name is the string pointed to by path. * @param path is the file location on the storage */ protected native void open(String path); /** - * Read elements of a file. + * Read elements of a file. * @param size of each element * @param nMemb is the number of elements of data to write * @return the actually read size @@ -38,17 +38,17 @@ public class File { public native long read(long size, long nMemb); /** - * Write elements into a file. - * @param size of each element - * @param nMemb is the number of elements of data to write + * Write elements into a file. + * @param size of each element + * @param nMemb is the number of elements of data to write * @return the actually written size */ public native long write(long size, long nMemb); /** - * Write elements into a file. + * Write elements into a file. * @param offset : number of bytes to offset from origin - * @param origin : Position used as reference for the offset. It is specified by one of the following constants - * defined in <stdio.h> exclusively to be used as arguments for this function (SEEK_SET = + * @param origin : Position used as reference for the offset. It is specified by one of the following constants + * defined in <stdio.h> exclusively to be used as arguments for this function (SEEK_SET = * beginning of file, SEEK_CUR = current position of the file pointer, SEEK_END = end of file) */ public native void seek(long offset, long origin); diff --git a/src/bindings/java/org/simgrid/msg/Host.java b/src/bindings/java/org/simgrid/msg/Host.java index a5f32b1cf4..3b22144f87 100644 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@ -10,16 +10,16 @@ package org.simgrid.msg; import org.simgrid.msg.Storage; /** - * 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 + * 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 an host instance is to call the static method + * The best way to get an host instance is to call the static method * Host.getByName(). * * For example to get the instance of the host. If your platform @@ -28,7 +28,7 @@ import org.simgrid.msg.Storage; * \verbatim Host jacquelin; -try { +try { jacquelin = Host.getByName("Jacquelin"); } catch(HostNotFoundException e) { System.err.println(e.toString()); @@ -36,21 +36,21 @@ try { ... \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 + * 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. */ + /** User data. */ private Object data; protected Host() { this.bind = 0; @@ -59,7 +59,7 @@ public class Host { @Override public String toString (){ - return this.name; + return this.name; } /** @@ -70,24 +70,24 @@ public class Host { * * @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. */ + /** Counts the installed hosts. */ public static native int getCount(); - /** Returns the host of the current process. */ + /** Returns the host of the current process. */ public static native Host currentHost(); - /** Returns all hosts of the installed platform. */ + /** 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. + * + * 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, + * 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 @@ -100,7 +100,7 @@ public class Host { public void setData(Object data) { this.data = data; - } + } public Object getData() { return this.data; @@ -110,15 +110,15 @@ public class Host { return null != this.data; } - /** Starts the host if it is off */ + /** Starts the host if it is off */ public native void on(); - /** Stops the host if it is on */ + /** Stops the host if it is on */ public native void off(); /** * 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(); @@ -136,7 +136,7 @@ public class Host { * (until after the next clock update). */ public static native void updateAllEnergyConsumptions(); - /** Returns the amount of Joules consumed by that host so far + /** 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, @@ -160,4 +160,4 @@ public class Host { static { nativeInit(); } -} +} diff --git a/src/bindings/java/org/simgrid/msg/HostFailureException.java b/src/bindings/java/org/simgrid/msg/HostFailureException.java index edb471bd94..68a6a6c5e2 100644 --- a/src/bindings/java/org/simgrid/msg/HostFailureException.java +++ b/src/bindings/java/org/simgrid/msg/HostFailureException.java @@ -9,7 +9,7 @@ package org.simgrid.msg; public class HostFailureException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an HostFailureException without a detail message. */ + /** Constructs an HostFailureException without a detail message. */ public HostFailureException() { super(); } diff --git a/src/bindings/java/org/simgrid/msg/HostNotFoundException.java b/src/bindings/java/org/simgrid/msg/HostNotFoundException.java index 13d69939ca..fdfffce240 100644 --- a/src/bindings/java/org/simgrid/msg/HostNotFoundException.java +++ b/src/bindings/java/org/simgrid/msg/HostNotFoundException.java @@ -9,7 +9,7 @@ package org.simgrid.msg; public class HostNotFoundException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an HostNotFoundException without a detail message. */ + /** Constructs an HostNotFoundException without a detail message. */ public HostNotFoundException() { super(); } diff --git a/src/bindings/java/org/simgrid/msg/JniException.java b/src/bindings/java/org/simgrid/msg/JniException.java index 741e35e782..626a043b71 100644 --- a/src/bindings/java/org/simgrid/msg/JniException.java +++ b/src/bindings/java/org/simgrid/msg/JniException.java @@ -9,7 +9,7 @@ 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 { @@ -20,7 +20,7 @@ public class JniException extends RuntimeException { public JniException() { super(); } - /** Constructs an JniException with a detail message. */ + /** Constructs an JniException with a detail message. */ public JniException(String s) { super(s); } diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java index cc1cb7d0ba..2f7483d5aa 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -44,8 +44,8 @@ public final class Msg { /** 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. + * 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() ; diff --git a/src/bindings/java/org/simgrid/msg/MsgException.java b/src/bindings/java/org/simgrid/msg/MsgException.java index c93ace1495..6c0e70981f 100644 --- a/src/bindings/java/org/simgrid/msg/MsgException.java +++ b/src/bindings/java/org/simgrid/msg/MsgException.java @@ -15,7 +15,7 @@ public abstract class MsgException extends Exception { public MsgException() { super(); } - /** Constructs an MsgException with a detail message. */ + /** Constructs an MsgException with a detail message. */ public 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 index 77a72ca8c5..db29b55865 100644 --- a/src/bindings/java/org/simgrid/msg/Mutex.java +++ b/src/bindings/java/org/simgrid/msg/Mutex.java @@ -5,10 +5,10 @@ * 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. - * +/** 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 { diff --git a/src/bindings/java/org/simgrid/msg/Process.java b/src/bindings/java/org/simgrid/msg/Process.java index 4c274753e4..80c31a72ba 100644 --- a/src/bindings/java/org/simgrid/msg/Process.java +++ b/src/bindings/java/org/simgrid/msg/Process.java @@ -9,20 +9,20 @@ import java.util.Arrays; import java.util.ArrayList; /** - * A process may be defined as a code, with some private data, executing + * 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 + * 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 Slave proceed as it : * * (1) import the class Process of the package simgrid.msg * import simgrid.msg.Process; - * + * * public class Slave extends simgrid.msg.Process { * * (2) Override the method function - * + * * \verbatim * public void main(String[] args) { * System.out.println("Hello MSG"); @@ -33,10 +33,10 @@ import java.util.ArrayList; * For the example, for the previous process Slave this file must contains a line : * <process host="Maxims" function="Slave"/>, where Maxims is the host of the process * Slave. 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 + * 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 { @@ -70,7 +70,7 @@ public abstract class Process implements Runnable { * @param name The name of the process. * * @exception HostNotFoundException if no host with this name exists. - * + * * */ public Process(String hostname, String name) throws HostNotFoundException { @@ -86,12 +86,12 @@ public abstract class Process implements Runnable { * * @exception HostNotFoundException if no host with this name exists. * - */ + */ public 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 + * 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. @@ -109,7 +109,7 @@ public abstract class Process implements Runnable { * @param name The name of the process. * @param argsParam The arguments of main method of the process. */ - public Process(Host host, String name, String[]argsParam) + public Process(Host host, String name, String[]argsParam) { if (host == null) throw new IllegalArgumentException("Cannot create a process on the null host"); @@ -150,7 +150,7 @@ public abstract class Process implements Runnable { * * @return The function returns the PID of the next created process. * - */ + */ public static native int killAll(); /** Simply kills the receiving process. @@ -178,7 +178,7 @@ public abstract class Process implements Runnable { /** * 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. */ @@ -194,7 +194,7 @@ public abstract class Process implements Runnable { /** * Returns the host of the process. * @return The host instance of the process. - */ + */ public Host getHost() { return this.host; } @@ -204,17 +204,17 @@ public abstract class Process implements Runnable { * @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(); + 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, @@ -225,12 +225,12 @@ public abstract class Process implements Runnable { * * @return The PID of the parent of the process. * - */ + */ public int getPPID() { return ppid; } /** - * Returns the value of a given process property. + * Returns the value of a given process property. */ public native String getProperty(String name); @@ -245,7 +245,7 @@ public abstract class Process implements Runnable { * * @return The current process. * - */ + */ public static native Process getCurrentProcess(); /** * Migrates a process to another host. @@ -264,9 +264,9 @@ public abstract class Process implements Runnable { sleep(millis,0); } /** - * Makes the current process sleep until millis milliseconds and nanos nanoseconds + * Makes the current process sleep until millis milliseconds and nanos nanoseconds * have elapsed. - * Unlike {@link #waitFor(double)} which takes seconds, this method takes + * 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. @@ -276,8 +276,8 @@ public abstract class Process implements Runnable { /** * 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; + */ + 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. @@ -331,7 +331,7 @@ public abstract class Process implements Runnable { * This static method returns the current amount of processes running * * @return The count of the running processes - */ + */ public static native int getCount(); } diff --git a/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java b/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java index 7bdd8920eb..b51c243999 100644 --- a/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java +++ b/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java @@ -9,7 +9,7 @@ package org.simgrid.msg; public class ProcessNotFoundException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an ProcessNotFoundException without a detail message. */ + /** Constructs an ProcessNotFoundException without a detail message. */ public ProcessNotFoundException() { super(); } diff --git a/src/bindings/java/org/simgrid/msg/RngStream.java b/src/bindings/java/org/simgrid/msg/RngStream.java index 0ad8dfe93d..99788e3031 100644 --- a/src/bindings/java/org/simgrid/msg/RngStream.java +++ b/src/bindings/java/org/simgrid/msg/RngStream.java @@ -16,7 +16,7 @@ public class RngStream { */ private long bind; /** - * Creates and returns a new stream without identifier. + * Creates and returns a new stream without identifier. * This procedure reserves space to keep the information relative to * the RngStream, initializes its seed Ig , sets Bg and Cg equal to Ig , sets its antithetic and * precision switches to 0. The seed Ig is equal to the initial seed of the package given by @@ -27,7 +27,7 @@ public class RngStream { create(""); } /** - * Creates and returns a new stream with identifier "name". + * Creates and returns a new stream with identifier "name". * This procedure reserves space to keep the information relative to * the RngStream, initializes its seed Ig , sets Bg and Cg equal to Ig , sets its antithetic and * precision switches to 0. The seed Ig is equal to the initial seed of the package given by @@ -89,7 +89,7 @@ public class RngStream { * Advances the state of the stream by k values, without modifying the states of other streams (as * in RngStream_SetSeed), nor the values of Bg and Ig associated with this stream. If e > 0, then * k = 2e + c; if e < 0, then k = -2-e + c; and if e = 0, then k = c. Note: c is allowed to take - * negative values. We discourage the use of this procedure. + * negative values. We discourage the use of this procedure. */ public native void advanceState(int e, int g); diff --git a/src/bindings/java/org/simgrid/msg/Semaphore.java b/src/bindings/java/org/simgrid/msg/Semaphore.java index 45ffb69d04..68a41ca604 100644 --- a/src/bindings/java/org/simgrid/msg/Semaphore.java +++ b/src/bindings/java/org/simgrid/msg/Semaphore.java @@ -5,21 +5,21 @@ * 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. +/** 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. + * 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 + * 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 + * Creates a new semaphore with the given capacity. At most capacity * process can acquire this semaphore at the same time. */ public Semaphore(int capacity) { @@ -32,7 +32,7 @@ public class Semaphore { /** Locks on the semaphore object until the provided timeout expires - * @exception TimeoutException if the timeout expired before + * @exception TimeoutException if the timeout expired before * the semaphore could be acquired. * @param timeout the duration of the lock */ diff --git a/src/bindings/java/org/simgrid/msg/Storage.java b/src/bindings/java/org/simgrid/msg/Storage.java index 4b15bba5e5..8cf553010c 100644 --- a/src/bindings/java/org/simgrid/msg/Storage.java +++ b/src/bindings/java/org/simgrid/msg/Storage.java @@ -14,7 +14,7 @@ public class Storage { * This attribute represents a bind between a java storage object and * a native storage. Even if this attribute is public you must never * access to it. - */ + */ private long bind = 0; /** Storage name */ @@ -22,7 +22,7 @@ public class Storage { @Override public String toString (){ - return this.name; + return this.name; } @@ -34,15 +34,15 @@ public class Storage { * * @return The storage object with the given name. * @exception StorageNotFoundException if the name of the storage is not valid. - */ - public static native Storage getByName(String name) + */ + public static native Storage getByName(String name) throws HostNotFoundException, StorageNotFoundException; /** * This method returns the name of a storage. * @return The name of the storage. * - */ + */ public String getName() { return name; } @@ -52,7 +52,7 @@ public class Storage { * * @return The size (in bytes) of the storage element. * - */ + */ public native long getSize(); /** @@ -60,7 +60,7 @@ public class Storage { * * @return The free size (in bytes) of the storage element. * - */ + */ public native long getFreeSize(); /** @@ -68,21 +68,21 @@ public class Storage { * * @return The used size (in bytes) of the storage element. * - */ + */ public native long getUsedSize(); /** - * Returns the value of a given storage property. + * Returns the value of a given storage property. */ public native String getProperty(String name); /** - * Change the value of a given storage property. + * Change the value of a given storage property. */ public native void setProperty(String name, String value); - /** + /** * * Returns the host name the storage is attached to * @@ -95,7 +95,7 @@ public class Storage { * * @return An array containing all the storages installed. * - */ + */ public static native Storage[] all(); /** diff --git a/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java b/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java index 839b7339b8..fd2667eda7 100644 --- a/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java +++ b/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java @@ -9,7 +9,7 @@ package org.simgrid.msg; public class StorageNotFoundException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an StorageNotFoundException without a detail message. */ + /** Constructs an StorageNotFoundException without a detail message. */ public StorageNotFoundException() { super(); } diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index a82ce2f7c2..d4e816db1a 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -39,14 +39,14 @@ public class Task { * * @param name Task's name * - * @param flopsAmount A value of the processing amount (in flop) needed to process 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 transfert this task. * If 0, then it cannot be transfered with the get() and put() methods. * This value has to be ≥ 0. - */ + */ public Task(String name, double flopsAmount, double bytesAmount) { if (flopsAmount<0) throw new IllegalArgumentException("Task flopsAmount (" + flopsAmount + ") cannot be negative"); @@ -64,14 +64,14 @@ public class Task { * * @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 + * @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 + * @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"); @@ -90,12 +90,12 @@ public class Task { * 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 + * @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 transfert - * this task. If 0, then it cannot be transfered this task. - * If 0, then it cannot be transfered with the get() and put() + * @param bytesAmount A value of amount of data (in bytes) needed to transfert + * this task. If 0, then it cannot be transfered this task. + * If 0, then it cannot be transfered with the get() and put() * methods. This value has to be >= 0. * @exception IllegalArgumentException if compute duration <0 or message size <0 */ @@ -128,10 +128,10 @@ public class Task { public native Process getSender(); /** Gets the source of the task (or null if not sent yet). */ - public native Host getSource(); + 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(); @@ -147,18 +147,18 @@ public class Task { * 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 */ @@ -175,9 +175,9 @@ public class Task { 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); + public native void setBound(double bound); - /** Cancels a task. */ + /** Cancels a task. */ public native void cancel(); /** Deletes a task once the garbage collector reclaims it */ @@ -191,48 +191,48 @@ public class Task { * * Communication-related * * * * * */ - /** Send the task asynchronously on the specified mailbox, + /** 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, + /** 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 + * Sends the task on the specified mailbox * * @param mailbox where to send the message * @throws TimeoutException - * @throws HostFailureException - * @throws TransferFailureException + * @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 + * @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) + /** Sends the task on the specified mailbox (capping the sending rate to \a maxrate) * * @param mailbox where to send the message - * @param maxrate + * @param maxrate * @throws TransferFailureException * @throws HostFailureException * @throws TimeoutException @@ -246,7 +246,7 @@ public class Task { * * @param mailbox where to send the message * @param timeout - * @param maxrate + * @param maxrate * @throws TransferFailureException * @throws HostFailureException * @throws TimeoutException @@ -273,7 +273,7 @@ public class Task { public static native Comm irecv(String mailbox); /** - * Retrieves next task on the mailbox identified by the specified alias + * Retrieves next task on the mailbox identified by the specified alias * * @param mailbox * @return a Task @@ -287,7 +287,7 @@ public class Task { * Retrieves next task on the mailbox identified by the specified alias (wait at most \a timeout seconds) * * @param mailbox - * @param timeout + * @param timeout * @return a Task */ public static native Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException; diff --git a/src/bindings/java/org/simgrid/msg/TaskCancelledException.java b/src/bindings/java/org/simgrid/msg/TaskCancelledException.java index d63f7a1970..0d4c8761e4 100644 --- a/src/bindings/java/org/simgrid/msg/TaskCancelledException.java +++ b/src/bindings/java/org/simgrid/msg/TaskCancelledException.java @@ -9,7 +9,7 @@ package org.simgrid.msg; public class TaskCancelledException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an TaskCancelledException without a detail message. */ + /** Constructs an TaskCancelledException without a detail message. */ public TaskCancelledException() { super(); } diff --git a/src/bindings/java/org/simgrid/msg/TimeoutException.java b/src/bindings/java/org/simgrid/msg/TimeoutException.java index d4a3ed0365..4a851e622f 100644 --- a/src/bindings/java/org/simgrid/msg/TimeoutException.java +++ b/src/bindings/java/org/simgrid/msg/TimeoutException.java @@ -9,7 +9,7 @@ package org.simgrid.msg; public class TimeoutException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an TimeoutFailureException without a detail message. */ + /** Constructs an TimeoutFailureException without a detail message. */ public TimeoutException() { super(); } diff --git a/src/bindings/java/org/simgrid/msg/TransferFailureException.java b/src/bindings/java/org/simgrid/msg/TransferFailureException.java index 1bc952ac5c..cc77cee02b 100644 --- a/src/bindings/java/org/simgrid/msg/TransferFailureException.java +++ b/src/bindings/java/org/simgrid/msg/TransferFailureException.java @@ -9,12 +9,12 @@ package org.simgrid.msg; public class TransferFailureException extends MsgException { private static final long serialVersionUID = 1L; - /** Constructs an TransferFailureException without a detail message. */ + /** Constructs an TransferFailureException without a detail message. */ public TransferFailureException() { super(); } /** - * Constructs an TransferFailureException with a detail message. + * Constructs an TransferFailureException with a detail message. * * @param s the detail message. */ diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index c26a85c058..0e1ee126a9 100644 --- a/src/bindings/java/org/simgrid/msg/VM.java +++ b/src/bindings/java/org/simgrid/msg/VM.java @@ -10,7 +10,7 @@ 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 Host currentHost; private int coreAmount = 1; /** @@ -56,7 +56,7 @@ public class VM extends Host { public VM(Host host, String name, int coreAmount, int ramSize, int migNetSpeed, int dpIntensity){ super(); super.name = name; - this.currentHost = host; + this.currentHost = host; this.coreAmount = coreAmount; create(host, name, coreAmount, ramSize, migNetSpeed, dpIntensity); } @@ -108,8 +108,8 @@ public class VM extends Host { public native void start(); /** - * Immediately kills all processes within the given VM. - * + * 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(); @@ -127,21 +127,21 @@ public class VM extends Host { Msg.info("Migration of VM "+this.getName()+" to "+destination.getName()+" is impossible ("+e.getMessage()+")"); throw new HostFailureException(); } - // If the migration correcly returned, then we should change the currentHost value. - this.currentHost = destination; + // If the migration correcly 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 + * 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, + * 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(); diff --git a/src/bindings/java/org/simgrid/trace/Trace.java b/src/bindings/java/org/simgrid/trace/Trace.java index cb9c61897d..97d6a6d419 100644 --- a/src/bindings/java/org/simgrid/trace/Trace.java +++ b/src/bindings/java/org/simgrid/trace/Trace.java @@ -16,19 +16,19 @@ public final class Trace { NativeLib.nativeInit(); } - // TODO complete the binding of the tracing API + // TODO complete the binding of the tracing API /** - * Declare a new user variable associated to hosts with a color. - * + * 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. - * + * Add a value to a variable of a host. + * * @param host * @param variable * @param value @@ -36,8 +36,8 @@ public final class Trace { public static final native void hostVariableAdd (String host, String variable, double value); /** - * Subtract a value from a variable of a host. - * + * Subtract a value from a variable of a host. + * * @param host * @param variable * @param value @@ -45,8 +45,8 @@ public final class Trace { 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. - * + * Set the value of a variable of a host at a given timestamp. + * * @param time * @param host * @param variable @@ -55,8 +55,8 @@ public final class Trace { 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. - * + * Add a value to a variable of a host at a given timestamp. + * * @param time * @param host * @param variable @@ -65,8 +65,8 @@ public final class Trace { 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. - * + * Subtract a value from a variable of a host at a given timestamp. + * * @param time * @param host * @param variable @@ -75,28 +75,28 @@ public final class Trace { public static final native void hostVariableSubWithTime (double time, String host, String variable, double value); /** - * Get declared user host variables. - * + * Get declared user host variables. + * */ public static final native String[] getHostVariablesName (); /** - * Declare a new user variable associated to links. - * + * 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. + * 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. - * + * Set the value of a variable of a link. + * * @param link * @param variable * @param value @@ -104,8 +104,8 @@ public final class Trace { public static final native void linkVariableSet (String link, String variable, double value); /** - * Add a value to a variable of a link. - * + * Add a value to a variable of a link. + * * @param link * @param variable * @param value @@ -113,8 +113,8 @@ public final class Trace { public static final native void linkVariableAdd (String link, String variable, double value); /** - * Subtract a value from a variable of a link. - * + * Subtract a value from a variable of a link. + * * @param link * @param variable * @param value @@ -122,8 +122,8 @@ public final class Trace { 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. - * + * Set the value of a variable of a link at a given timestamp. + * * @param time * @param link * @param variable @@ -133,7 +133,7 @@ public final class Trace { /** * Add a value to a variable of a link at a given timestamp. - * + * * @param time * @param link * @param variable @@ -142,8 +142,8 @@ public final class Trace { 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. - * + * Subtract a value from a variable of a link at a given timestamp. + * * @param time * @param link * @param variable @@ -152,8 +152,8 @@ public final class Trace { 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. - * + * Set the value of the variable present in the links connecting source and destination. + * * @param src * @param dst * @param variable @@ -162,8 +162,8 @@ public final class Trace { 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. - * + * Add a value to the variable present in the links connecting source and destination. + * * @param src * @param dst * @param variable @@ -172,8 +172,8 @@ public final class Trace { 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. - * + * Subtract a value from the variable present in the links connecting source and destination. + * * @param src * @param dst * @param variable @@ -182,8 +182,8 @@ public final class Trace { 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. - * + * Set the value of the variable present in the links connecting source and destination at a given timestamp. + * * @param time * @param src * @param dst @@ -193,8 +193,8 @@ public final class Trace { 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. - * + * Add a value to the variable present in the links connecting source and destination at a given timestamp. + * * @param time * @param src * @param dst @@ -204,8 +204,8 @@ public final class Trace { 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. - * + * Subtract a value from the variable present in the links connecting source and destination at a given timestamp. + * * @param time * @param src * @param dst @@ -215,29 +215,29 @@ public final class Trace { public static final native void linkSrcDstVariableSubWithTime (double time, String src, String dst, String variable, double value); /** - * Get declared user link variables. + * Get declared user link variables. */ public static final native String[] getLinkVariablesName (); - /* **** ******** WARNINGS ************** ***** */ + /* **** ******** WARNINGS ************** ***** */ /* Only the following routines have been */ /* JNI implemented - Adrien May, 22nd */ - /* **** ******************************** ***** */ + /* **** ******************************** ***** */ /** - * Declare a user state that will be associated to hosts. + * 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. - * + * 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 @@ -247,7 +247,7 @@ public final class Trace { /** * 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. @@ -255,8 +255,8 @@ public final class Trace { public static final native void hostSetState (String host, String state, String value); /** - * Push a new value for a state of a given host. - * + * 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. @@ -264,23 +264,23 @@ public final class Trace { public static final native void hostPushState (String host, String state, String value); /** - * Pop the last value of a state of a given host. - * + * 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. - * + * 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. - * + * Set the value of a variable of a host. + * * @param host * @param variable * @param value @@ -288,15 +288,15 @@ public final class Trace { public static final native void hostVariableSet (String host, String variable, double value); /** - * Declare a new user variable associated to VMs. - * + * 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. - * + * Set the value of a variable of a VM. + * * @param vm * @param variable * @param value diff --git a/src/s4u/s4u_link.cpp b/src/s4u/s4u_link.cpp index 031f57d268..f0bbec6fa5 100644 --- a/src/s4u/s4u_link.cpp +++ b/src/s4u/s4u_link.cpp @@ -24,7 +24,7 @@ const char* sg_link_name(sg_link_t link) } sg_link_t sg_link_by_name(const char* name) { - return simgrid::s4u::Link::byName(name); + return simgrid::s4u::Link::by_name(name); } int sg_link_is_shared(sg_link_t link) @@ -73,7 +73,7 @@ void sg_link_exit() namespace simgrid { namespace s4u { -Link* Link::byName(const char* name) +Link* Link::by_name(const char* name) { kernel::resource::LinkImpl* res = kernel::resource::LinkImpl::byName(name); if (res == nullptr) diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 00bcbac991..36f7639e6c 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -20,8 +20,8 @@ # The `nohandler` is used to disable handlers. # I wish we could completely remove the handlers as their only use is # to adapt the interface between the exported symbol that is visible -# by the user applications and the internal symbol that is implemented -# by the kernel. +# by the user applications and the internal symbol that is implemented +# by the kernel. # The only remaining use of that mechanism is to add the caller # identity as a parameter of internal call, but that could be # automated too (eg by having a special parameter type called "self") @@ -30,7 +30,7 @@ # you should complete the libsmx.c file by adding the corresponding function # (a.k.a. stub). Anyway, if you omit to do it, the invocation of ./simcalls.py will notify you ;) # If you want to remove an handler, it is important to remove although -# the corresponding code (simcall_HANDLER_name_of_simcall(xxx) (note that comment the code +# the corresponding code (simcall_HANDLER_name_of_simcall(xxx) (note that comment the code # is not sufficient, the python script does not check whether the code is commented or not). # Last but not the least, you should declare the new simix call in # ./include/simgrid/simix.h (otherwise you will get a warning at compile time) diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index 6989839ef3..81edc6bc06 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -369,7 +369,7 @@ if __name__ == '__main__': fd.write('#include \n') fd.write('#include \n') fd.write('#include "src/simix/smx_synchro_private.hpp"\n') - + fd.write("/** @cond */ // Please Doxygen, don't look at this\n") fd.write(''' template diff --git a/src/simix/simix_network.tla b/src/simix/simix_network.tla index 9ff81f2656..476628d195 100644 --- a/src/simix/simix_network.tla +++ b/src/simix/simix_network.tla @@ -1,13 +1,13 @@ ---- MODULE simix_network ---- -(* This is a TLA module specifying the networking layer of SIMIX. +(* This is a TLA module specifying the networking layer of SIMIX. It is used to verify the soundness of the DPOR reduction algorithm - used in the model-checker. + used in the model-checker. If you think you found a new independence lemma, add it to this file and relaunch TLC to check whether your lemma actually holds. *) EXTENDS Naturals, Sequences, FiniteSets -CONSTANTS RdV, Addr, Proc, ValTrue, ValFalse, SendIns, RecvIns, WaitIns, +CONSTANTS RdV, Addr, Proc, ValTrue, ValFalse, SendIns, RecvIns, WaitIns, TestIns, LocalIns VARIABLES network, memory, pc @@ -51,8 +51,8 @@ TypeInv == /\ network \subseteq Comm mailbox(rdv) == {comm \in network : comm.rdv=rdv /\ comm.status \in {"send","recv"}} (* The set of memory addresses of a process being used in a communication *) -CommBuffers(pid) == - {c.data_src: c \in { y \in network: y.status /= "done" /\ (y.src = pid \/ y.dst = pid)}} +CommBuffers(pid) == + {c.data_src: c \in { y \in network: y.status /= "done" /\ (y.src = pid \/ y.dst = pid)}} \cup {c.data_dst: c \in { y \in network: y.status /= "done" /\ (y.src = pid \/ y.dst = pid)}} (* This is a send step of the system *) @@ -60,41 +60,41 @@ CommBuffers(pid) == (* rdv: the rendez-vous point where the "send" communication request is going to be pushed *) (* data_r: the address in the sender's memory where the data is stored *) (* comm_r: the address in the sender's memory where to store the communication id *) -Send(pid, rdv, data_r, comm_r) == +Send(pid, rdv, data_r, comm_r) == /\ rdv \in RdV /\ pid \in Proc /\ data_r \in Addr /\ comm_r \in Addr /\ pc[pid] \in SendIns - + (* A matching recv request exists in the rendez-vous *) (* Complete the sender fields and set the communication to the ready state *) /\ \/ \exists c \in mailbox(rdv): /\ c.status="recv" /\ \forall d \in mailbox(rdv): d.status="recv" => c.id <= d.id - /\ network' = + /\ network' = (network \ {c}) \cup {[c EXCEPT !.status = "ready", !.src = pid, !.data_src = data_r]} (* Use c's existing communication id *) /\ memory' = [memory EXCEPT ![pid][comm_r] = c.id] - - + + (* No matching recv communication request exists. *) (* Create a send request and push it in the network. *) - \/ /\ ~ \exists c \in mailbox(rdv): c.status = "recv" - /\ LET comm == - [id |-> Cardinality(network)+1, + \/ /\ ~ \exists c \in mailbox(rdv): c.status = "recv" + /\ LET comm == + [id |-> Cardinality(network)+1, rdv |-> rdv, - status |-> "send", + status |-> "send", src |-> pid, - dst |-> NoProc, + dst |-> NoProc, data_src |-> data_r, data_dst |-> NoAddr] IN /\ network' = network \cup {comm} - /\ memory' = [memory EXCEPT ![pid][comm_r] = comm.id] + /\ memory' = [memory EXCEPT ![pid][comm_r] = comm.id] /\ \E ins \in Instr : pc' = [pc EXCEPT ![pid] = ins] (* This is a receive step of the system *) @@ -102,38 +102,38 @@ Send(pid, rdv, data_r, comm_r) == (* rdv: the Rendez-vous where the "receive" communication request is going to be pushed *) (* data_r: the address in the receivers's memory where the data is going to be stored *) (* comm_r: the address in the receivers's memory where to store the communication id *) -Recv(pid, rdv, data_r, comm_r) == +Recv(pid, rdv, data_r, comm_r) == /\ rdv \in RdV /\ pid \in Proc /\ data_r \in Addr /\ comm_r \in Addr /\ pc[pid] \in RecvIns - + (* A matching send request exists in the rendez-vous *) (* Complete the receiver fields and set the communication to the ready state *) /\ \/ \exists c \in mailbox(rdv): /\ c.status="send" /\ \forall d \in mailbox(rdv): d.status="send" => c.id <= d.id - /\ network' = + /\ network' = (network \ {c}) \cup {[c EXCEPT !.status = "ready", !.dst = pid, !.data_dst = data_r]} (* Use c's existing communication id *) /\ memory' = [memory EXCEPT ![pid][comm_r] = c.id] - - + + (* No matching send communication request exists. *) (* Create a recv request and push it in the network. *) - \/ /\ ~ \exists c \in mailbox(rdv): c.status = "send" - /\ LET comm == + \/ /\ ~ \exists c \in mailbox(rdv): c.status = "send" + /\ LET comm == [id |-> Cardinality(network)+1, - status |-> "recv", - dst |-> pid, + status |-> "recv", + dst |-> pid, data_dst |-> data_r] IN /\ network' = network \cup {comm} - /\ memory' = [memory EXCEPT ![pid][comm_r] = comm.id] + /\ memory' = [memory EXCEPT ![pid][comm_r] = comm.id] /\ \E ins \in Instr : pc' = [pc EXCEPT ![pid] = ins] (* Wait for at least one communication from a given list to complete *) @@ -171,7 +171,7 @@ Test(pid, comms, ret_r) == \/ ~ \exists comm_r \in comms, c \in network: c.id = memory[pid][comm_r] /\ c.status \in {"ready","done"} /\ memory' = [memory EXCEPT ![pid][ret_r] = ValFalse] - /\ UNCHANGED network + /\ UNCHANGED network /\ \E ins \in Instr : pc' = [pc EXCEPT ![pid] = ins] (* Local instruction execution *) @@ -191,11 +191,11 @@ Next == \exists p \in Proc, data_r \in Addr, comm_r \in Addr, rdv \in RdV, \/ Wait(p, comm_r) \/ Test(p, comm_r, ret_r) \/ Local(p) - + Spec == Init /\ [][Next]_<> ------------------------------- (* Independence of iSend / iRecv steps *) -THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: +THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: \forall data1, data2, comm1, comm2 \in Addr: /\ p1 /= p2 /\ ENABLED Send(p1, rdv1, data1, comm1) @@ -211,10 +211,10 @@ THEOREM \forall p1, p2 \in Proc: \forall data, comm1, comm2 \in Addr: \/ (comm1 /= c.data_src /\ comm1 /= c.data_dst) /\ ENABLED Send(p1, rdv, data, comm1) /\ ENABLED Wait(p2, comm2) - => I(Send(p1, rdv, data, comm1), Wait(p2, comm2)) + => I(Send(p1, rdv, data, comm1), Wait(p2, comm2)) (* Independence of iSend's in different rendez-vous *) -THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: +THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: \forall data1, data2, comm1, comm2 \in Addr: /\ p1 /= p2 /\ rdv1 /= rdv2 @@ -224,7 +224,7 @@ THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: Send(p2, rdv2, data2, comm2)) (* Independence of iRecv's in different rendez-vous *) -THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: +THEOREM \forall p1, p2 \in Proc: \forall rdv1, rdv2 \in RdV: \forall data1, data2, comm1, comm2 \in Addr: /\ p1 /= p2 /\ rdv1 /= rdv2 diff --git a/src/smpi/BUGS b/src/smpi/BUGS index 81227ca7e4..519af08ae2 100644 --- a/src/smpi/BUGS +++ b/src/smpi/BUGS @@ -4,5 +4,5 @@ ________________________________________________________________________________ int main( int argc, char *argv[] ) then the compilation smpicc fails : conflicting types for ‘smpi_simulated_main’ since smpicc substitutes smpi_simulated_main for the user main() declaration. - + ___________________________________________________________________________________________ diff --git a/src/smpi/colls/coll_tuned_topo.cpp b/src/smpi/colls/coll_tuned_topo.cpp index 7138c7ed90..8bef88a6e1 100644 --- a/src/smpi/colls/coll_tuned_topo.cpp +++ b/src/smpi/colls/coll_tuned_topo.cpp @@ -52,10 +52,10 @@ static int calculate_num_nodes_up_to_level( int fanout, int level ) { /* just use geometric progression formula for sum: a^0+a^1+...a^(n-1) = (a^n-1)/(a-1) */ - if(fanout > 1) - return ((pown(fanout,level) - 1)/(fanout - 1)); - else - return 0; // is this right ? + if (fanout > 1) + return ((pown(fanout, level) - 1) / (fanout - 1)); + else + return 0; // is this right ? } /* diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index 2e3876ebed..d4768ed80f 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -17,30 +17,112 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_smpi, instr, "Tracing SMPI"); static std::unordered_map*> keys; -static const char* smpi_colors[] = { - "recv", "1 0 0", "irecv", "1 0.52 0.52", "send", "0 0 1", - "isend", "0.52 0.52 1", "sendrecv", "0 1 1", "wait", "1 1 0", - "waitall", "0.78 0.78 0", "waitany", "0.78 0.78 0.58", "test", "0.52 0.52 0", - - "allgather", "1 0 0", "allgatherv", "1 0.52 0.52", "allreduce", "1 0 1", - "alltoall", "0.52 0 1", "alltoallv", "0.78 0.52 1", "barrier", "0 0.78 0.78", - "bcast", "0 0.78 0.39", "gather", "1 1 0", "gatherv", "1 1 0.52", - "reduce", "0 1 0", "reducescatter", "0.52 1 0.52", "scan", "1 0.58 0.23", - "exscan", "1 0.54 0.25", "scatterv", "0.52 0 0.52", "scatter", "1 0.74 0.54", - - "computing", "0 1 1", "sleeping", "0 0.5 0.5", - - "init", "0 1 0", "finalize", "0 1 0", - - "put", "0.3 1 0", "get", "0 1 0.3", "accumulate", "1 0.3 0", - "rput", "0.3 1 0", "rget", "0 1 0.3", "raccumulate", "1 0.3 0", - "compare_and_swap", "0.3 1 0", "get_accumulate", "0 1 0.3", "rget_accumulate", "1 0.3 0", - "win_fence", "1 0 0.3", "win_post", "1 0 0.8", "win_wait", "1 0.8 0", - "win_start", "0.8 0 1", "win_complete", "0.8 1 0", "win_lock", "1 0 0.3", - "win_unlock", "1 0 0.3", "win_lock_all", "1 0 0.8", "win_unlock_all", "1 0.8 0", - "win_flush", "1 0 0.3", "win_flush_local", "1 0 0.8", "win_flush_all", "1 0.8 0", - "win_flush_local_all", "1 0 0.3", "" , "" -}; +static const char* smpi_colors[] = {"recv", + "1 0 0", + "irecv", + "1 0.52 0.52", + "send", + "0 0 1", + "isend", + "0.52 0.52 1", + "sendrecv", + "0 1 1", + "wait", + "1 1 0", + "waitall", + "0.78 0.78 0", + "waitany", + "0.78 0.78 0.58", + "test", + "0.52 0.52 0", + + "allgather", + "1 0 0", + "allgatherv", + "1 0.52 0.52", + "allreduce", + "1 0 1", + "alltoall", + "0.52 0 1", + "alltoallv", + "0.78 0.52 1", + "barrier", + "0 0.78 0.78", + "bcast", + "0 0.78 0.39", + "gather", + "1 1 0", + "gatherv", + "1 1 0.52", + "reduce", + "0 1 0", + "reducescatter", + "0.52 1 0.52", + "scan", + "1 0.58 0.23", + "exscan", + "1 0.54 0.25", + "scatterv", + "0.52 0 0.52", + "scatter", + "1 0.74 0.54", + + "computing", + "0 1 1", + "sleeping", + "0 0.5 0.5", + + "init", + "0 1 0", + "finalize", + "0 1 0", + + "put", + "0.3 1 0", + "get", + "0 1 0.3", + "accumulate", + "1 0.3 0", + "rput", + "0.3 1 0", + "rget", + "0 1 0.3", + "raccumulate", + "1 0.3 0", + "compare_and_swap", + "0.3 1 0", + "get_accumulate", + "0 1 0.3", + "rget_accumulate", + "1 0.3 0", + "win_fence", + "1 0 0.3", + "win_post", + "1 0 0.8", + "win_wait", + "1 0.8 0", + "win_start", + "0.8 0 1", + "win_complete", + "0.8 1 0", + "win_lock", + "1 0 0.3", + "win_unlock", + "1 0 0.3", + "win_lock_all", + "1 0 0.8", + "win_unlock_all", + "1 0.8 0", + "win_flush", + "1 0 0.3", + "win_flush_local", + "1 0 0.8", + "win_flush_all", + "1 0.8 0", + "win_flush_local_all", + "1 0 0.3", + "", + ""}; static const char* instr_find_color(const char* state) { diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 65c074f8a0..574f7c2b3f 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -207,7 +207,7 @@ int smpi_usleep(useconds_t usecs) #if _POSIX_TIMERS > 0 int smpi_nanosleep(const struct timespec* tp, struct timespec* t) -{ +{ if (not smpi_process()) return nanosleep(tp,t); return static_cast(private_sleep(static_cast(tp->tv_sec + tp->tv_nsec / 1000000000.0))); diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index d38d6f9515..fc047a634f 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -674,9 +674,9 @@ public: Datatype::encode(args.datatype1), Datatype::encode(args.datatype2))); - Colls::alltoall(send_buffer(args.send_size*args.comm_size* args.datatype1->size()), - args.send_size, args.datatype1, recv_buffer(args.recv_size * args.comm_size * args.datatype2->size()), - args.recv_size, args.datatype2, MPI_COMM_WORLD); + Colls::alltoall(send_buffer(args.send_size * args.comm_size * args.datatype1->size()), args.send_size, + args.datatype1, recv_buffer(args.recv_size * args.comm_size * args.datatype2->size()), + args.recv_size, args.datatype2, MPI_COMM_WORLD); TRACE_smpi_comm_out(my_proc_id); } @@ -715,14 +715,14 @@ public: Datatype::encode(args.datatype1), Datatype::encode(args.datatype2))); if (name == "gatherV") { - Colls::gatherv(send_buffer(args.send_size * args.datatype1->size()), args.send_size, args.datatype1, - (rank == args.root) ? recv_buffer(args.recv_size_sum * args.datatype2->size()) : nullptr, args.recvcounts->data(), args.disps.data(), args.datatype2, args.root, - MPI_COMM_WORLD); + Colls::gatherv(send_buffer(args.send_size * args.datatype1->size()), args.send_size, args.datatype1, + (rank == args.root) ? recv_buffer(args.recv_size_sum * args.datatype2->size()) : nullptr, + args.recvcounts->data(), args.disps.data(), args.datatype2, args.root, MPI_COMM_WORLD); } else { - Colls::allgatherv(send_buffer(args.send_size * args.datatype1->size()), args.send_size, args.datatype1, - recv_buffer(args.recv_size_sum * args.datatype2->size()), args.recvcounts->data(), args.disps.data(), args.datatype2, - MPI_COMM_WORLD); + Colls::allgatherv(send_buffer(args.send_size * args.datatype1->size()), args.send_size, args.datatype1, + recv_buffer(args.recv_size_sum * args.datatype2->size()), args.recvcounts->data(), + args.disps.data(), args.datatype2, MPI_COMM_WORLD); } TRACE_smpi_comm_out(my_proc_id); @@ -757,9 +757,10 @@ public: nullptr, Datatype::encode(args.datatype1), Datatype::encode(args.datatype2))); - Colls::scatterv((rank == args.root) ? send_buffer(args.send_size_sum * args.datatype1->size()) : nullptr, args.sendcounts->data(), args.disps.data(), - args.datatype1, recv_buffer(args.recv_size * args.datatype2->size()), args.recv_size, args.datatype2, args.root, - MPI_COMM_WORLD); + Colls::scatterv((rank == args.root) ? send_buffer(args.send_size_sum * args.datatype1->size()) : nullptr, + args.sendcounts->data(), args.disps.data(), args.datatype1, + recv_buffer(args.recv_size * args.datatype2->size()), args.recv_size, args.datatype2, args.root, + MPI_COMM_WORLD); TRACE_smpi_comm_out(my_proc_id); } @@ -775,8 +776,9 @@ public: std::to_string(args.comp_size), /* ugly hack to print comp_size */ Datatype::encode(args.datatype1))); - Colls::reduce_scatter(send_buffer(args.recv_size_sum * args.datatype1->size()), recv_buffer(args.recv_size_sum * args.datatype1->size()), - args.recvcounts->data(), args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD); + Colls::reduce_scatter(send_buffer(args.recv_size_sum * args.datatype1->size()), + recv_buffer(args.recv_size_sum * args.datatype1->size()), args.recvcounts->data(), + args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD); smpi_execute_flops(args.comp_size); TRACE_smpi_comm_out(my_proc_id); diff --git a/src/smpi/mpi/smpi_datatype.cpp b/src/smpi/mpi/smpi_datatype.cpp index a17f42eba4..f943415abb 100644 --- a/src/smpi/mpi/smpi_datatype.cpp +++ b/src/smpi/mpi/smpi_datatype.cpp @@ -530,7 +530,7 @@ int Datatype::create_subarray(int ndims, int* array_of_sizes, return MPI_ERR_ARG; } } - + MPI_Aint extent = oldtype->get_extent(); int i; @@ -545,7 +545,7 @@ int Datatype::create_subarray(int ndims, int* array_of_sizes, step = 1; end = ndims; } - + MPI_Aint size = (MPI_Aint)array_of_sizes[i] * (MPI_Aint)array_of_sizes[i+step]; MPI_Aint lb = (MPI_Aint)array_of_starts[i] + (MPI_Aint)array_of_starts[i+step] *(MPI_Aint)array_of_sizes[i]; @@ -568,7 +568,7 @@ int Datatype::create_subarray(int ndims, int* array_of_sizes, //handle LB and UB with a resized call create_hindexed( 1, sizes, lbs, tmp, newtype); unref(tmp); - + tmp = *newtype; create_resized(tmp, 0, extent, newtype); diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index b8daa19e35..b7b2203d2b 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -255,7 +255,7 @@ while [ $# -gt 0 ]; do ;; *) PROC_ARGS="${PROC_ARGS:+$PROC_ARGS }$1" - shift + shift ;; esac done @@ -270,12 +270,12 @@ if [ -z "${HOSTFILE}" ] ; then HOSTFILETMP=1 HOSTFILE="$(mktemp smpitmp-hostfXXXXXX)" perl -ne 'print "$1\n" if /.*.*/' ${PLATFORM} > ${HOSTFILE} - perl -ne 'if (/.*" >> ${APPLICATIONTMP} fi - else + else echo ${XML_ARGS} >> ${APPLICATIONTMP} fi echo " " >> ${APPLICATIONTMP} @@ -480,7 +480,7 @@ if [ -n "${KEEP}" ] ; then echo "Generated hostfile ${HOSTFILE} kept." fi if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then - echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept." + echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept." fi fi diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index ac6fbe8021..e92c13320f 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -170,7 +170,7 @@ public: void update_remains_lazy(double now) override; std::list cpus(); - + void suspend() override; void resume() override; }; diff --git a/src/surf/plugins/host_dvfs.cpp b/src/surf/plugins/host_dvfs.cpp index 130147d8a6..1a169b4585 100644 --- a/src/surf/plugins/host_dvfs.cpp +++ b/src/surf/plugins/host_dvfs.cpp @@ -107,7 +107,7 @@ public: */ class OnDemand : public Governor { /** - * See https://elixir.bootlin.com/linux/v4.15.4/source/drivers/cpufreq/cpufreq_ondemand.c + * See https://elixir.bootlin.com/linux/v4.15.4/source/drivers/cpufreq/cpufreq_ondemand.c * DEF_FREQUENCY_UP_THRESHOLD and od_update() */ double freq_up_threshold = 0.80; diff --git a/src/surf/xml/simgrid.dtd b/src/surf/xml/simgrid.dtd index 93fed8a226..c28d7619c0 100644 --- a/src/surf/xml/simgrid.dtd +++ b/src/surf/xml/simgrid.dtd @@ -1,4 +1,4 @@ - */ +/* */ case 401: /* rule 401 can match eol */ YY_RULE_SETUP @@ -10422,10 +10459,30 @@ YY_RULE_SETUP if (!AX_surfxml_zoneRoute_src) FAIL("Required attribute `src' not set for `zoneRoute' element."); LEAVE; STag_surfxml_zoneRoute(); surfxml_pcdata_ix = 0; ETag_surfxml_zoneRoute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; - case S_surfxml_zone_5: SET(S_surfxml_zone_6); break; - case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; + case S_surfxml_AS_1: + case S_surfxml_AS_3: + case S_surfxml_AS_5: + SET(S_surfxml_AS_6); + break; + case S_surfxml_AS: + case S_surfxml_AS_4: + case S_surfxml_AS_6: + case S_surfxml_AS_7: + case S_surfxml_AS_8: + SET(S_surfxml_AS_8); + break; + case S_surfxml_zone_3: + case S_surfxml_zone_5: + case S_surfxml_zone_6: + SET(S_surfxml_zone_6); + break; + case S_surfxml_zone: + case S_surfxml_zone_1: + case S_surfxml_zone_4: + case S_surfxml_zone_7: + case S_surfxml_zone_8: + SET(S_surfxml_zone_8); + break; } } YY_BREAK @@ -10449,10 +10506,30 @@ YY_RULE_SETUP ETag_surfxml_zoneRoute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; - case S_surfxml_zone_5: SET(S_surfxml_zone_6); break; - case S_surfxml_zone: case S_surfxml_zone_1: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; + case S_surfxml_AS_1: + case S_surfxml_AS_3: + case S_surfxml_AS_5: + SET(S_surfxml_AS_6); + break; + case S_surfxml_AS: + case S_surfxml_AS_4: + case S_surfxml_AS_6: + case S_surfxml_AS_7: + case S_surfxml_AS_8: + SET(S_surfxml_AS_8); + break; + case S_surfxml_zone_3: + case S_surfxml_zone_5: + case S_surfxml_zone_6: + SET(S_surfxml_zone_6); + break; + case S_surfxml_zone: + case S_surfxml_zone_1: + case S_surfxml_zone_4: + case S_surfxml_zone_7: + case S_surfxml_zone_8: + SET(S_surfxml_zone_8); + break; } } YY_BREAK diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 5834a8ac2d..87e135363a 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -141,7 +141,7 @@ void parse_platform_file(const char *file) xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str()); tmgr_trace_t trace = traces_set_list.at(elm.first); - sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str()); + sg_link_t link = simgrid::s4u::Link::by_name(elm.second.c_str()); xbt_assert(link, "Link %s undefined", elm.second.c_str()); link->setStateTrace(trace); } @@ -149,7 +149,7 @@ void parse_platform_file(const char *file) for (auto const& elm : trace_connect_list_link_bw) { xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str()); tmgr_trace_t trace = traces_set_list.at(elm.first); - sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str()); + sg_link_t link = simgrid::s4u::Link::by_name(elm.second.c_str()); xbt_assert(link, "Link %s undefined", elm.second.c_str()); link->setBandwidthTrace(trace); } @@ -157,7 +157,7 @@ void parse_platform_file(const char *file) for (auto const& elm : trace_connect_list_link_lat) { xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str()); tmgr_trace_t trace = traces_set_list.at(elm.first); - sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str()); + sg_link_t link = simgrid::s4u::Link::by_name(elm.second.c_str()); xbt_assert(link, "Link %s undefined", elm.second.c_str()); link->setLatencyTrace(trace); } diff --git a/src/xbt/automaton/automaton_lexer.yy.c b/src/xbt/automaton/automaton_lexer.yy.c index 8715148d49..98ca200081 100644 --- a/src/xbt/automaton/automaton_lexer.yy.c +++ b/src/xbt/automaton/automaton_lexer.yy.c @@ -28,7 +28,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 0 +#define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -107,25 +107,13 @@ typedef unsigned int flex_uint32_t; #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ @@ -186,7 +174,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t xbt_automaton_parser_leng; +extern int xbt_automaton_parser_leng; extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; @@ -198,34 +186,30 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up xbt_automaton_parser_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parser_text again */ \ - } \ - while ( 0 ) +#define yyless(n) \ + do { \ + /* Undo effects of setting up xbt_automaton_parser_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg); \ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parser_text again */ \ + } while (0) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; +struct yy_buffer_state { + FILE* yy_input_file; - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + char* yy_ch_buf; /* input buffer */ + char* yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -251,8 +235,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -274,14 +258,13 @@ struct yy_buffer_state * just pointing xbt_automaton_parser_in at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - - }; +}; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE* yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -300,13 +283,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when xbt_automaton_parser_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t xbt_automaton_parser_leng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int xbt_automaton_parser_leng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static char* yy_c_buf_p = NULL; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow xbt_automaton_parser_wrap()'s to do buffer switches * instead of setting up a fresh xbt_automaton_parser_in. A bit of a hack ... @@ -329,7 +312,7 @@ static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE xbt_automaton_parser__scan_bytes(yyconst char* bytes, int len); void *xbt_automaton_parser_alloc (yy_size_t ); void *xbt_automaton_parser_realloc (void *,yy_size_t ); @@ -337,24 +320,22 @@ void xbt_automaton_parser_free (void * ); #define yy_new_buffer xbt_automaton_parser__create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - xbt_automaton_parser_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ +#define yy_set_interactive(is_interactive) \ + { \ + if (!YY_CURRENT_BUFFER) { \ + xbt_automaton_parser_ensure_buffer_stack(); \ + YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - xbt_automaton_parser_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ +#define yy_set_bol(at_bol) \ + { \ + if (!YY_CURRENT_BUFFER) { \ + xbt_automaton_parser_ensure_buffer_stack(); \ + YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -366,7 +347,7 @@ void xbt_automaton_parser_free (void * ); typedef unsigned char YY_CHAR; -FILE *xbt_automaton_parser_in = (FILE *) 0, *xbt_automaton_parser_out = (FILE *) 0; +FILE *xbt_automaton_parser_in = NULL, *xbt_automaton_parser_out = NULL; typedef int yy_state_type; @@ -383,30 +364,26 @@ extern char *xbt_automaton_parser_text; static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); -#if defined(__GNUC__) && __GNUC__ >= 3 -__attribute__((__noreturn__)) -#endif -static void yy_fatal_error (yyconst char msg[] ); +static void yynoreturn yy_fatal_error(yyconst char* msg); /* Done after the current pattern has been matched and before the * corresponding action - sets up xbt_automaton_parser_text. */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - xbt_automaton_parser_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + xbt_automaton_parser_leng = (int)(yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 25 #define YY_END_OF_BUFFER 26 /* This struct is not used in this scanner, but its presence is necessary. */ -struct yy_trans_info - { +struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; - }; +}; static yyconst flex_int16_t yy_accept[54] = { 0, 0, 0, 26, 24, 18, 23, 8, 24, 24, 9, @@ -544,7 +521,7 @@ char *xbt_automaton_parser_text; extern YYSTYPE yylval; -#line 548 "automaton_lexer.yy.c" +#line 533 "automaton_lexer.yy.c" #define INITIAL 0 @@ -583,7 +560,7 @@ FILE *xbt_automaton_parser_get_out (void ); void xbt_automaton_parser_set_out (FILE * _out_str ); -yy_size_t xbt_automaton_parser_get_leng (void ); +int xbt_automaton_parser_get_leng(void); char *xbt_automaton_parser_get_text (void ); @@ -642,42 +619,39 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( xbt_automaton_parser_text, xbt_automaton_parser_leng, 1, xbt_automaton_parser_out )) {} } while (0) +#define ECHO \ + do { \ + if (fwrite(xbt_automaton_parser_text, (size_t)xbt_automaton_parser_leng, 1, xbt_automaton_parser_out)) { \ + } \ + } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( xbt_automaton_parser_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( xbt_automaton_parser_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, xbt_automaton_parser_in))==0 && ferror(xbt_automaton_parser_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(xbt_automaton_parser_in); \ - } \ - }\ -\ +#define YY_INPUT(buf, result, max_size) \ + if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) { \ + int c = '*'; \ + size_t n; \ + for (n = 0; n < max_size && (c = getc(xbt_automaton_parser_in)) != EOF && c != '\n'; ++n) \ + buf[n] = (char)c; \ + if (c == '\n') \ + buf[n++] = (char)c; \ + if (c == EOF && ferror(xbt_automaton_parser_in)) \ + YY_FATAL_ERROR("input in flex scanner failed"); \ + result = n; \ + } else { \ + errno = 0; \ + while ((result = (int)fread(buf, 1, max_size, xbt_automaton_parser_in)) == 0 && ferror(xbt_automaton_parser_in)) { \ + if (errno != EINTR) { \ + YY_FATAL_ERROR("input in flex scanner failed"); \ + break; \ + } \ + errno = 0; \ + clearerr(xbt_automaton_parser_in); \ + } \ + } #endif @@ -724,8 +698,7 @@ extern int xbt_automaton_parser_lex (void); #define YY_BREAK /*LINTED*/break; #endif -#define YY_RULE_SETUP \ - YY_USER_ACTION +#define YY_RULE_SETUP YY_USER_ACTION /** The main scanner function which does all the work. */ @@ -735,196 +708,187 @@ YY_DECL char *yy_cp, *yy_bp; int yy_act; - if ( !(yy_init) ) - { + if (!(yy_init)) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if (!(yy_start)) + (yy_start) = 1; /* first start state */ - if ( ! xbt_automaton_parser_in ) + if (!xbt_automaton_parser_in) xbt_automaton_parser_in = stdin; - if ( ! xbt_automaton_parser_out ) + if (!xbt_automaton_parser_out) xbt_automaton_parser_out = stdout; - if ( ! YY_CURRENT_BUFFER ) { - xbt_automaton_parser_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); + if (!YY_CURRENT_BUFFER) { + xbt_automaton_parser_ensure_buffer_stack(); + YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE); } - xbt_automaton_parser__load_buffer_state( ); - } + xbt_automaton_parser__load_buffer_state(); + } { #line 38 "parserPromela.lex" +#line 754 "automaton_lexer.yy.c" -#line 769 "automaton_lexer.yy.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ { - yy_cp = (yy_c_buf_p); + yy_cp = (yy_c_buf_p); - /* Support of xbt_automaton_parser_text. */ - *yy_cp = (yy_hold_char); + /* Support of xbt_automaton_parser_text. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_match: + do { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if (yy_accept[yy_current_state]) { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 54 ) - yy_c = yy_meta[(unsigned int) yy_c]; + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { + yy_current_state = (int)yy_def[yy_current_state]; + if (yy_current_state >= 54) + yy_c = yy_meta[(unsigned int)yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 90 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t)yy_c]; + ++yy_cp; + } while (yy_base[yy_current_state] != 90); + + yy_find_action: yy_act = yy_accept[yy_current_state]; + if (yy_act == 0) { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; } - YY_DO_BEFORE_ACTION; + YY_DO_BEFORE_ACTION; -do_action: /* This label is used only to access EOF actions. */ + do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + switch (yy_act) { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; -case 1: -YY_RULE_SETUP + case 1: + YY_RULE_SETUP #line 40 "parserPromela.lex" { return (NEVER); } - YY_BREAK +YY_BREAK case 2: YY_RULE_SETUP #line 41 "parserPromela.lex" { return (IF); } - YY_BREAK +YY_BREAK case 3: YY_RULE_SETUP #line 42 "parserPromela.lex" { return (FI); } - YY_BREAK +YY_BREAK case 4: YY_RULE_SETUP #line 43 "parserPromela.lex" { return (IMPLIES); } - YY_BREAK +YY_BREAK case 5: YY_RULE_SETUP #line 44 "parserPromela.lex" { return (GOTO); } - YY_BREAK +YY_BREAK case 6: YY_RULE_SETUP #line 45 "parserPromela.lex" { return (AND); } - YY_BREAK +YY_BREAK case 7: YY_RULE_SETUP #line 46 "parserPromela.lex" { return (OR); } - YY_BREAK +YY_BREAK case 8: YY_RULE_SETUP #line 47 "parserPromela.lex" { return (NOT); } - YY_BREAK +YY_BREAK case 9: YY_RULE_SETUP #line 48 "parserPromela.lex" { return (LEFT_PAR); } - YY_BREAK +YY_BREAK case 10: YY_RULE_SETUP #line 49 "parserPromela.lex" { return (RIGHT_PAR); } - YY_BREAK +YY_BREAK case 11: YY_RULE_SETUP #line 50 "parserPromela.lex" { return (CASE); } - YY_BREAK +YY_BREAK case 12: YY_RULE_SETUP #line 51 "parserPromela.lex" { return (COLON); } - YY_BREAK +YY_BREAK case 13: YY_RULE_SETUP #line 52 "parserPromela.lex" { return (SEMI_COLON); } - YY_BREAK +YY_BREAK case 14: YY_RULE_SETUP #line 53 "parserPromela.lex" { return (CASE_TRUE); } - YY_BREAK +YY_BREAK case 15: YY_RULE_SETUP #line 54 "parserPromela.lex" { return (LEFT_BRACE); } - YY_BREAK +YY_BREAK case 16: YY_RULE_SETUP #line 55 "parserPromela.lex" { return (RIGHT_BRACE); } - YY_BREAK +YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 58 "parserPromela.lex" { } - YY_BREAK +YY_BREAK case 18: YY_RULE_SETUP #line 60 "parserPromela.lex" { } - YY_BREAK +YY_BREAK case 19: YY_RULE_SETUP #line 63 "parserPromela.lex" { sscanf(xbt_automaton_parser_text,"%lf",&yylval.real); return (LITT_REEL); } - YY_BREAK +YY_BREAK case 20: YY_RULE_SETUP #line 66 "parserPromela.lex" { sscanf(xbt_automaton_parser_text,"%d",&yylval.integer); return (LITT_ENT); } - YY_BREAK +YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP @@ -932,110 +896,104 @@ YY_RULE_SETUP { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1); sscanf(xbt_automaton_parser_text,"%s",yylval.string); return (LITT_CHAINE); } - YY_BREAK +YY_BREAK case 22: YY_RULE_SETUP #line 73 "parserPromela.lex" { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1); sscanf(xbt_automaton_parser_text,"%s",yylval.string); - return (ID); } - YY_BREAK + return (ID); +} +YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP #line 77 "parserPromela.lex" { } - YY_BREAK +YY_BREAK case 24: YY_RULE_SETUP #line 79 "parserPromela.lex" { } - YY_BREAK +YY_BREAK case 25: YY_RULE_SETUP #line 81 "parserPromela.lex" ECHO; - YY_BREAK -#line 960 "automaton_lexer.yy.c" +YY_BREAK +#line 945 "automaton_lexer.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed xbt_automaton_parser_in at a new source and called - * xbt_automaton_parser_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parser_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } +case YY_END_OF_BUFFER: { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed xbt_automaton_parser_in at a new source and called + * xbt_automaton_parser_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parser_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */ + yy_state_type yy_next_state; - yy_current_state = yy_get_previous_state( ); + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ + yy_current_state = yy_get_previous_state(); - yy_next_state = yy_try_NUL_trans( yy_current_state ); + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_next_state = yy_try_NUL_trans(yy_current_state); - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } + yy_bp = (yytext_ptr) + YY_MORE_ADJ; - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } + if (yy_next_state) { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { + else { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else + switch (yy_get_next_buffer()) { + case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; - if ( xbt_automaton_parser_wrap( ) ) - { + if (xbt_automaton_parser_wrap()) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * xbt_automaton_parser_text, we can now set up @@ -1049,179 +1007,158 @@ case YY_STATE_EOF(INITIAL): yy_act = YY_STATE_EOF(YY_START); goto do_action; - } + } - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) + else { + if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE; - } - break; } + break; + } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; - } - break; } + break; +} - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ +default: + YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of xbt_automaton_parser_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - yy_size_t number_to_move, i; + char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char* source = (yytext_ptr); + int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) + YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { + if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ + if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; - } + } - else - { + else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; - } } + } /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)-1); - for ( i = 0; i < number_to_move; ++i ) + for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++); - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + else { + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf); - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; + if (b->yy_is_our_buffer) { + int new_size = b->yy_buf_size * 2; - if ( new_size <= 0 ) + if (new_size <= 0) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - xbt_automaton_parser_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else + b->yy_ch_buf = (char*) + /* Include room in for 2 EOB chars. */ + xbt_automaton_parser_realloc((void*)b->yy_ch_buf, b->yy_buf_size + 2); + } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + if (!b->yy_ch_buf) + YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + } - if ( num_to_read > YY_READ_BUF_SIZE ) + if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { + if ((yy_n_chars) == 0) { + if (number_to_move == YY_MORE_ADJ) { ret_val = EOB_ACT_END_OF_FILE; - xbt_automaton_parser_restart(xbt_automaton_parser_in ); - } + xbt_automaton_parser_restart(xbt_automaton_parser_in); + } - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } + else { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } + } else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = + (char*)xbt_automaton_parser_realloc((void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size); + if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); } (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; @@ -1234,26 +1171,23 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; - char *yy_cp; + char* yy_cp; yy_current_state = (yy_start); - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { + for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { + if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 54 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + (yy_last_accepting_cpos) = yy_cp; + } + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { + yy_current_state = (int)yy_def[yy_current_state]; + if (yy_current_state >= 54) + yy_c = yy_meta[(unsigned int)yy_c]; } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t)yy_c]; + } return yy_current_state; } @@ -1261,68 +1195,62 @@ static int yy_get_next_buffer (void) /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) { int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + char* yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { + if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 54 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 53); + (yy_last_accepting_cpos) = yy_cp; + } + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { + yy_current_state = (int)yy_def[yy_current_state]; + if (yy_current_state >= 54) + yy_c = yy_meta[(unsigned int)yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t)yy_c]; + yy_is_jam = (yy_current_state == 53); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT static void yyunput (int c, char * yy_bp ) { - char *yy_cp; + char* yy_cp; - yy_cp = (yy_c_buf_p); + yy_cp = (yy_c_buf_p); /* undo effects of setting up xbt_automaton_parser_text */ *yy_cp = (yy_hold_char); - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ + if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - yy_size_t number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + int number_to_move = (yy_n_chars) + 2; + char* dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) *--dest = *--source; - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_cp += (int)(dest - source); + yy_bp += (int)(dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } + if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) + YY_FATAL_ERROR("flex scanner push-back overflow"); + } - *--yy_cp = (char) c; + *--yy_cp = (char)c; - (yytext_ptr) = yy_bp; + (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; + (yy_c_buf_p) = yy_cp; } #endif @@ -1339,23 +1267,20 @@ static int yy_get_next_buffer (void) *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { + if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + else { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); - switch ( yy_get_next_buffer( ) ) - { + switch (yy_get_next_buffer()) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a @@ -1368,83 +1293,80 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - xbt_automaton_parser_restart(xbt_automaton_parser_in ); + xbt_automaton_parser_restart(xbt_automaton_parser_in); /*FALLTHROUGH*/ - case EOB_ACT_END_OF_FILE: - { - if ( xbt_automaton_parser_wrap( ) ) - return EOF; + case EOB_ACT_END_OF_FILE: { + if (xbt_automaton_parser_wrap()) + return 0; - if ( ! (yy_did_buffer_switch_on_eof) ) + if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif - } + } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; - } } } + } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parser_text */ + c = *(unsigned char*)(yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parser_text */ (yy_hold_char) = *++(yy_c_buf_p); return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ - void xbt_automaton_parser_restart (FILE * input_file ) +void xbt_automaton_parser_restart(FILE* input_file) { - if ( ! YY_CURRENT_BUFFER ){ - xbt_automaton_parser_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); + if (!YY_CURRENT_BUFFER) { + xbt_automaton_parser_ensure_buffer_stack(); + YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE); } - xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER,input_file ); - xbt_automaton_parser__load_buffer_state( ); + xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER, input_file); + xbt_automaton_parser__load_buffer_state(); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer ) +void xbt_automaton_parser__switch_to_buffer(YY_BUFFER_STATE new_buffer) { /* TODO. We should be able to replace this entire function body * with - * xbt_automaton_parser_pop_buffer_state(); - * xbt_automaton_parser_push_buffer_state(new_buffer); - */ - xbt_automaton_parser_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) + * xbt_automaton_parser_pop_buffer_state(); + * xbt_automaton_parser_push_buffer_state(new_buffer); + */ + xbt_automaton_parser_ensure_buffer_stack(); + if (YY_CURRENT_BUFFER == new_buffer) return; - if ( YY_CURRENT_BUFFER ) - { + if (YY_CURRENT_BUFFER) { /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); + *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } YY_CURRENT_BUFFER_LVALUE = new_buffer; - xbt_automaton_parser__load_buffer_state( ); + xbt_automaton_parser__load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag @@ -1456,10 +1378,10 @@ static int yy_get_next_buffer (void) static void xbt_automaton_parser__load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - xbt_automaton_parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + xbt_automaton_parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. @@ -1468,26 +1390,26 @@ static void xbt_automaton_parser__load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE * file, int size ) +YY_BUFFER_STATE xbt_automaton_parser__create_buffer(FILE* file, int size) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); + b = (YY_BUFFER_STATE)xbt_automaton_parser_alloc(sizeof(struct yy_buffer_state)); + if (!b) + YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__create_buffer()"); b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) xbt_automaton_parser_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); + b->yy_ch_buf = (char*)xbt_automaton_parser_alloc(b->yy_buf_size + 2); + if (!b->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__create_buffer()"); b->yy_is_our_buffer = 1; - xbt_automaton_parser__init_buffer(b,file ); + xbt_automaton_parser__init_buffer(b, file); return b; } @@ -1496,19 +1418,19 @@ static void xbt_automaton_parser__load_buffer_state (void) * @param b a buffer created with xbt_automaton_parser__create_buffer() * */ - void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b ) +void xbt_automaton_parser__delete_buffer(YY_BUFFER_STATE b) { - if ( ! b ) + if (!b) return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; - if ( b->yy_is_our_buffer ) - xbt_automaton_parser_free((void *) b->yy_ch_buf ); + if (b->yy_is_our_buffer) + xbt_automaton_parser_free((void*)b->yy_ch_buf); - xbt_automaton_parser_free((void *) b ); + xbt_automaton_parser_free((void*)b); } /* Initializes or reinitializes a buffer. @@ -1520,32 +1442,32 @@ static void xbt_automaton_parser__load_buffer_state (void) { int oerrno = errno; - xbt_automaton_parser__flush_buffer(b ); + xbt_automaton_parser__flush_buffer(b); - b->yy_input_file = file; + b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then xbt_automaton_parser__init_buffer was _probably_ - * called from xbt_automaton_parser_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; + /* If b is the current buffer, then xbt_automaton_parser__init_buffer was _probably_ + * called from xbt_automaton_parser_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER) { + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - errno = oerrno; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b ) +void xbt_automaton_parser__flush_buffer(YY_BUFFER_STATE b) { - if ( ! b ) + if (!b) return; b->yy_n_chars = 0; @@ -1559,11 +1481,11 @@ static void xbt_automaton_parser__load_buffer_state (void) b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; + b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - xbt_automaton_parser__load_buffer_state( ); + if (b == YY_CURRENT_BUFFER) + xbt_automaton_parser__load_buffer_state(); } /** Pushes the new state onto the stack. The new state becomes @@ -1574,19 +1496,18 @@ static void xbt_automaton_parser__load_buffer_state (void) */ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) + if (new_buffer == NULL) return; xbt_automaton_parser_ensure_buffer_stack(); /* This block is copied from xbt_automaton_parser__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { + if (YY_CURRENT_BUFFER) { /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); + *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) @@ -1594,7 +1515,7 @@ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from xbt_automaton_parser__switch_to_buffer. */ - xbt_automaton_parser__load_buffer_state( ); + xbt_automaton_parser__load_buffer_state(); (yy_did_buffer_switch_on_eof) = 1; } @@ -1604,16 +1525,16 @@ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) */ void xbt_automaton_parser_pop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) + if (!YY_CURRENT_BUFFER) return; - xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); + xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - xbt_automaton_parser__load_buffer_state( ); + xbt_automaton_parser__load_buffer_state(); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1623,20 +1544,19 @@ void xbt_automaton_parser_pop_buffer_state (void) */ static void xbt_automaton_parser_ensure_buffer_stack (void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ + */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); + (yy_buffer_stack) = + (struct yy_buffer_state**)xbt_automaton_parser_alloc(num_to_alloc * sizeof(struct yy_buffer_state*)); + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()"); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1645,18 +1565,16 @@ static void xbt_automaton_parser_ensure_buffer_stack (void) return; } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_realloc( + (yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*)); + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()"); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1674,27 +1592,25 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size { YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) + if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_buffer()" ); + b = (YY_BUFFER_STATE)xbt_automaton_parser_alloc(sizeof(struct yy_buffer_state)); + if (!b) + YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__scan_buffer()"); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; - xbt_automaton_parser__switch_to_buffer(b ); + xbt_automaton_parser__switch_to_buffer(b); return b; } @@ -1710,7 +1626,7 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) { - return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) ); + return xbt_automaton_parser__scan_bytes(yystr, (int)strlen(yystr)); } /** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parser_lex() will @@ -1720,27 +1636,27 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE xbt_automaton_parser__scan_bytes(yyconst char* yybytes, int _yybytes_len) { YY_BUFFER_STATE b; - char *buf; + char* buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) xbt_automaton_parser_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_bytes()" ); + n = (yy_size_t)(_yybytes_len + 2); + buf = (char*)xbt_automaton_parser_alloc(n); + if (!buf) + YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__scan_bytes()"); - for ( i = 0; i < _yybytes_len; ++i ) + for (i = 0; i < _yybytes_len; ++i) buf[i] = yybytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR; - b = xbt_automaton_parser__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in xbt_automaton_parser__scan_bytes()" ); + b = xbt_automaton_parser__scan_buffer(buf, n); + if (!b) + YY_FATAL_ERROR("bad buffer in xbt_automaton_parser__scan_bytes()"); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -1754,28 +1670,26 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_si #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error(yyconst char* msg) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void)fprintf(stderr, "%s\n", msg); + exit(YY_EXIT_FAILURE); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up xbt_automaton_parser_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \ - (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - xbt_automaton_parser_leng = yyless_macro_arg; \ - } \ - while ( 0 ) +#define yyless(n) \ + do { \ + /* Undo effects of setting up xbt_automaton_parser_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg); \ + xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \ + (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + xbt_automaton_parser_leng = yyless_macro_arg; \ + } while (0) /* Accessor methods (get/set functions) to struct members. */ @@ -1807,7 +1721,7 @@ FILE *xbt_automaton_parser_get_out (void) /** Get the length of the current token. * */ -yy_size_t xbt_automaton_parser_get_leng (void) +int xbt_automaton_parser_get_leng(void) { return xbt_automaton_parser_leng; } @@ -1863,20 +1777,20 @@ static int yy_init_globals (void) * This function is called from xbt_automaton_parser_lex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT xbt_automaton_parser_in = stdin; xbt_automaton_parser_out = stdout; #else - xbt_automaton_parser_in = (FILE *) 0; - xbt_automaton_parser_out = (FILE *) 0; + xbt_automaton_parser_in = NULL; + xbt_automaton_parser_out = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -1890,15 +1804,15 @@ int xbt_automaton_parser_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - xbt_automaton_parser_pop_buffer_state(); - } + while (YY_CURRENT_BUFFER) { + xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER); + YY_CURRENT_BUFFER_LVALUE = NULL; + xbt_automaton_parser_pop_buffer_state(); + } - /* Destroy the stack itself. */ - xbt_automaton_parser_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + xbt_automaton_parser_free((yy_buffer_stack)); + (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * xbt_automaton_parser_lex() is called, initialization will occur. */ @@ -1916,7 +1830,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { int i; - for ( i = 0; i < n; ++i ) + for (i = 0; i < n; ++i) s1[i] = s2[i]; } #endif @@ -1925,7 +1839,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) static int yy_flex_strlen (yyconst char * s ) { int n; - for ( n = 0; s[n]; ++n ) + for (n = 0; s[n]; ++n) ; return n; @@ -1934,7 +1848,7 @@ static int yy_flex_strlen (yyconst char * s ) void *xbt_automaton_parser_alloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *xbt_automaton_parser_realloc (void * ptr, yy_size_t size ) @@ -1947,12 +1861,12 @@ void *xbt_automaton_parser_realloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void xbt_automaton_parser_free (void * ptr ) { - free( (char *) ptr ); /* see xbt_automaton_parser_realloc() for (char *) cast */ + free((char*)ptr); /* see xbt_automaton_parser_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff --git a/src/xbt/automaton/parserPromela.lex b/src/xbt/automaton/parserPromela.lex index 0d4804b612..7aa13e88c1 100644 --- a/src/xbt/automaton/parserPromela.lex +++ b/src/xbt/automaton/parserPromela.lex @@ -15,9 +15,9 @@ #include #include "parserPromela.tab.hacc" - + extern YYSTYPE yylval; - + %} blancs [ \t]+ @@ -60,20 +60,20 @@ commentaire "/*"([^\*\/]*{nouv_ligne}*[^\*\/]*)*"*/" {blancs} { } -{reel} { sscanf(yytext,"%lf",&yylval.real); +{reel} { sscanf(yytext,"%lf",&yylval.real); return (LITT_REEL); } -{entier} { sscanf(yytext,"%d",&yylval.integer); +{entier} { sscanf(yytext,"%d",&yylval.integer); return (LITT_ENT); } {chaine} { yylval.string=(char *)malloc(strlen(yytext)+1); - sscanf(yytext,"%s",yylval.string); + sscanf(yytext,"%s",yylval.string); return (LITT_CHAINE); } [a-zA-Z]{caractere}* { yylval.string=(char *)malloc(strlen(yytext)+1); sscanf(yytext,"%s",yylval.string); return (ID); } - + {numl} { } . { } diff --git a/src/xbt/automaton/parserPromela.yacc b/src/xbt/automaton/parserPromela.yacc index b96bc93dfd..04e093436e 100644 --- a/src/xbt/automaton/parserPromela.yacc +++ b/src/xbt/automaton/parserPromela.yacc @@ -54,11 +54,11 @@ void yyerror(const char *s); %% -automaton : NEVER LEFT_BRACE stateseq RIGHT_BRACE +automaton : NEVER LEFT_BRACE stateseq RIGHT_BRACE ; -stateseq : - | ID COLON { new_state($1, 1);} IF option FI SEMI_COLON stateseq +stateseq : + | ID COLON { new_state($1, 1);} IF option FI SEMI_COLON stateseq ; option : @@ -72,7 +72,7 @@ exp : LEFT_PAR exp RIGHT_PAR { $$ = $2; } | CASE_TRUE { $$ = new_label(4); } | ID { $$ = new_label(3, $1); } ; - + %% diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 9e896f35eb..5ba907f699 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -216,6 +216,7 @@ public: { this->content = std::move(value); this->update(); + this->unsetDefault(); } void setDefaultValue(T value) diff --git a/src/xbt/mmalloc/mmalloc.info b/src/xbt/mmalloc/mmalloc.info index 60d7a8d924..50fb1ba893 100644 --- a/src/xbt/mmalloc/mmalloc.info +++ b/src/xbt/mmalloc/mmalloc.info @@ -94,7 +94,7 @@ called the "malloc descriptor". int mmalloc_errno (void *md); int mmalloc_setkey (void *md, int keynum, void *key); void *mmalloc_getkey (void *md, int keynum); - + void *mmalloc (void *md, size_t size); void *mrealloc (void *md, void *ptr, size_t size); void *mvalloc (void *md, size_t size); diff --git a/src/xbt/mmalloc/mmalloc.texi b/src/xbt/mmalloc/mmalloc.texi index 0a2b9b3064..61d957221f 100644 --- a/src/xbt/mmalloc/mmalloc.texi +++ b/src/xbt/mmalloc/mmalloc.texi @@ -112,7 +112,7 @@ be persistent and exist as a filesystem object after the creating process has gone away. @item -Because multiple heaps can be managed, data used for a +Because multiple heaps can be managed, data used for a specific purpose can be allocated into its own heap, making it easier to allow applications to ``dump'' and ``restore'' initialized malloc-managed memory regions. For example, the ``unexec'' hack popularized @@ -184,7 +184,7 @@ calls with the above patterns if using @code{#define} causes problems. @section Function Descriptions These are the details on the functions that make up the @code{mmalloc} -package. +package. @table @code @item void *mmalloc_attach (int @var{fd}, void *@var{baseaddr}); @@ -223,7 +223,7 @@ On failure returns @code{NULL}. @item void *mmalloc_detach (void *@var{md}); Terminate access to a @code{mmalloc} managed region identified by the descriptor @var{md}, by closing the base file and unmapping all memory -pages associated with the region. +pages associated with the region. Returns @code{NULL} on success. diff --git a/teshsuite/java/semaphoregc/SemaphoreGC.java b/teshsuite/java/semaphoregc/SemaphoreGC.java index 21cad25706..71f93423c1 100644 --- a/teshsuite/java/semaphoregc/SemaphoreGC.java +++ b/teshsuite/java/semaphoregc/SemaphoreGC.java @@ -18,7 +18,7 @@ class SemCreator extends Process { } public void main(String[] args) throws MsgException{ - int j; + int j; Msg.info("Creating 50 new Semaphores, yielding and triggering a GC after each"); for(j = 1; j <= 50; j++) { new Semaphore(0); diff --git a/teshsuite/java/sleephostoff/SleepHostOff.java b/teshsuite/java/sleephostoff/SleepHostOff.java index 16ab628585..c71256b031 100644 --- a/teshsuite/java/sleephostoff/SleepHostOff.java +++ b/teshsuite/java/sleephostoff/SleepHostOff.java @@ -45,7 +45,7 @@ class TestRunner extends Process { host.off(); Msg.info(host.getName()+" has been stopped"); waitFor(0.3); - Msg.info("Test sleep seems ok, cool! (number of Process : " + Process.getCount() + Msg.info("Test sleep seems ok, cool! (number of Process : " + Process.getCount() + ", it should be 1 (i.e. the Test one))"); } } diff --git a/teshsuite/simdag/CMakeLists.txt b/teshsuite/simdag/CMakeLists.txt index b0d6575d43..eb9841950e 100644 --- a/teshsuite/simdag/CMakeLists.txt +++ b/teshsuite/simdag/CMakeLists.txt @@ -1,5 +1,5 @@ foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test - comm-mxn-all2all comm-mxn-independent comm-mxn-scatter comm-p2p-latency-1 + comm-mxn-all2all comm-mxn-independent comm-mxn-scatter comm-p2p-latency-1 comm-p2p-latency-2 comm-p2p-latency-3 comm-p2p-latency-bound comp-only-par comp-only-seq incomplete) add_executable (${x} ${x}/${x}.c) target_link_libraries(${x} simgrid) diff --git a/teshsuite/simdag/platforms/bogus_disk_attachment.xml b/teshsuite/simdag/platforms/bogus_disk_attachment.xml index d13d47015d..b344e45c76 100644 --- a/teshsuite/simdag/platforms/bogus_disk_attachment.xml +++ b/teshsuite/simdag/platforms/bogus_disk_attachment.xml @@ -7,7 +7,7 @@ - + diff --git a/teshsuite/simdag/platforms/four_hosts_floyd.xml b/teshsuite/simdag/platforms/four_hosts_floyd.xml index eaa710ad7a..ab570d7b5f 100644 --- a/teshsuite/simdag/platforms/four_hosts_floyd.xml +++ b/teshsuite/simdag/platforms/four_hosts_floyd.xml @@ -10,7 +10,7 @@ - + diff --git a/teshsuite/simdag/platforms/host_attributes.xml b/teshsuite/simdag/platforms/host_attributes.xml index daedebb2df..4f76188ad9 100644 --- a/teshsuite/simdag/platforms/host_attributes.xml +++ b/teshsuite/simdag/platforms/host_attributes.xml @@ -2,7 +2,7 @@ - + @@ -10,7 +10,7 @@ - + diff --git a/teshsuite/simdag/platforms/two_clusters.xml b/teshsuite/simdag/platforms/two_clusters.xml index afd0e81114..294cab3488 100644 --- a/teshsuite/simdag/platforms/two_clusters.xml +++ b/teshsuite/simdag/platforms/two_clusters.xml @@ -5,11 +5,11 @@ + bb_bw="2.25GBps" bb_lat="500us"/> - + - diff --git a/teshsuite/simdag/platforms/two_clusters_one_name.xml b/teshsuite/simdag/platforms/two_clusters_one_name.xml index dc50aa110b..ee451fa84b 100644 --- a/teshsuite/simdag/platforms/two_clusters_one_name.xml +++ b/teshsuite/simdag/platforms/two_clusters_one_name.xml @@ -8,9 +8,9 @@ - + - diff --git a/teshsuite/simdag/platforms/two_clusters_router_id.xml b/teshsuite/simdag/platforms/two_clusters_router_id.xml index 43d4e46243..f09cdaf5a2 100644 --- a/teshsuite/simdag/platforms/two_clusters_router_id.xml +++ b/teshsuite/simdag/platforms/two_clusters_router_id.xml @@ -5,9 +5,9 @@ + bb_bw="2.25GBps" bb_lat="500us" router_id="alice_cluster_router"/> - + diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 6c75a45a3c..17a029ac5c 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -6,8 +6,8 @@ if(enable_smpi) endif() include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") - foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast - coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong + foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast + coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong type-hvector type-indexed type-struct type-vector bug-17132 timers privatization ) add_executable (${x} ${x}/${x}.c) target_link_libraries(${x} simgrid) @@ -47,13 +47,13 @@ if(enable_smpi) ADD_TESH_FACTORIES(tesh-smpi-macro-partial-shared-communication "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared-communication --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-partial-shared-communication macro-partial-shared-communication.tesh) endif() - foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast - coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong + foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast + coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong type-hvector type-indexed type-struct type-vector bug-17132 timers) ADD_TESH_FACTORIES(tesh-smpi-${x} "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/${x} ${x}.tesh) endforeach() - foreach (ALLGATHER 2dmesh 3dmesh bruck GB loosely_lr NTSLR_NB pair rdb rhv ring SMP_NTS smp_simple spreading_simple + foreach (ALLGATHER 2dmesh 3dmesh bruck GB loosely_lr NTSLR_NB pair rdb rhv ring SMP_NTS smp_simple spreading_simple ompi mpich ompi_neighborexchange mvapich2 mvapich2_smp impi) ADD_TESH(tesh-smpi-coll-allgather-${ALLGATHER} --cfg smpi/allgather:${ALLGATHER} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allgather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allgather coll-allgather.tesh) endforeach() @@ -67,8 +67,8 @@ if(enable_smpi) ADD_TESH(tesh-smpi-coll-allreduce-${ALLREDUCE} --cfg smpi/allreduce:${ALLREDUCE} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce coll-allreduce.tesh) endforeach() - foreach (ALLTOALL 2dmesh 3dmesh pair pair_rma pair_one_barrier pair_light_barrier pair_mpi_barrier rdb ring - ring_light_barrier ring_mpi_barrier ring_one_barrier bruck basic_linear ompi mpich mvapich2 + foreach (ALLTOALL 2dmesh 3dmesh pair pair_rma pair_one_barrier pair_light_barrier pair_mpi_barrier rdb ring + ring_light_barrier ring_mpi_barrier ring_one_barrier bruck basic_linear ompi mpich mvapich2 mvapich2_scatter_dest impi) ADD_TESH(tesh-smpi-coll-alltoall-${ALLTOALL} --cfg smpi/alltoall:${ALLTOALL} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-alltoall --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-alltoall coll-alltoall.tesh) endforeach() @@ -82,9 +82,9 @@ if(enable_smpi) ADD_TESH(tesh-smpi-coll-barrier-${BARRIER} --cfg smpi/barrier:${BARRIER} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-barrier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-barrier coll-barrier.tesh) endforeach() - foreach (BCAST arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter binomial_tree flattree - flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather scatter_rdb_allgather SMP_binary - SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline mvapich2 mvapich2_intra_node + foreach (BCAST arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter binomial_tree flattree + flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather scatter_rdb_allgather SMP_binary + SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline mvapich2 mvapich2_intra_node mvapich2_knomial_intra_node impi) ADD_TESH(tesh-smpi-coll-bcast-${BCAST} --cfg smpi/bcast:${BCAST} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-bcast --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-bcast coll-bcast.tesh) endforeach() diff --git a/teshsuite/smpi/isp/umpire/CMakeLists.txt b/teshsuite/smpi/isp/umpire/CMakeLists.txt index cc7f9c7ae9..6f8fa2832d 100644 --- a/teshsuite/smpi/isp/umpire/CMakeLists.txt +++ b/teshsuite/smpi/isp/umpire/CMakeLists.txt @@ -90,11 +90,11 @@ set(umpire_tests_deadlock_broken dropped-req comm-deadlock ) - + set(umpire_tests_problematic deadlock-config # No deadlock detected by ISP unless MPI_Send blocking activated ) # problematic tests - + # These files are not listed on http://formalverification.cs.utah.edu/ISP_Tests/ set(umpire_src_other abort1.c @@ -132,11 +132,11 @@ set(umpire_src_other intercomm_merge-deadlock.c lost-request2.c lost-request3.c - lost-request.c + lost-request.c no-error4-any_src.c no-error4.c no-error-derived-comms.c - + no-error-persistent-all-completions.c no-error-persistent.c no-error-persistent-test.c @@ -145,14 +145,14 @@ set(umpire_src_other no-error-probe-any_src.c no-error-probe-any_tag.c no-error-probe.c - + no-error-wait2.c # Does not compile. no-error-waitall-any_src2.c no-error-waitall-any_src3.c no-error-waitall-any_src.c no-error-waitall.c no-error-waitany2.c - + op-no-error.c op-no-free.c partial-recv-exhaustive.c @@ -212,7 +212,7 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite) set(umpire_tesh ${umpire_tesh} ${test}) set(files_to_clean ${files_to_clean} ${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh) endforeach(test) - + # TODO, what should we do about ${umpire_tests_missed_deadlock}? foreach (test ${umpire_tests_passing}) diff --git a/tools/MSG_visualization/trace2fig.pl b/tools/MSG_visualization/trace2fig.pl index bac9cedbae..7a8231eb55 100755 --- a/tools/MSG_visualization/trace2fig.pl +++ b/tools/MSG_visualization/trace2fig.pl @@ -13,7 +13,7 @@ use warnings; use XFig; use POSIX; -my($grid_Y_size)=225; +my($grid_Y_size)=225; my($grid_X_size)=100550; # Can be changed to improve readability in function of the total execution time my($color_suspended)=1; @@ -86,10 +86,10 @@ sub read_link { } if($line =~ /^17\s/) { my($event,$date,$type,$father,$channel,$dst,$key,$trash) = split(/\t+/,$line); - my($numkey)=hex "$key"; + my($numkey)=hex "$key"; while (defined($link{$numkey}{dst})) {$numkey++;} $link{$numkey}{dst}=$dst; - $link{$numkey}{dst_date}=$date; + $link{$numkey}{dst_date}=$date; } } close INPUT; @@ -114,7 +114,7 @@ sub build_cat_list { my($tree,$cat_list)=@_; my($root) = shift @$tree; my($u); - + push @$cat_list,$root; foreach $u (@$tree) { @@ -201,7 +201,7 @@ sub draw_cat { my($cat,$e,$link); my($max_string_length)=0; foreach $cat (keys %$Cat) { - next unless (defined($$Cat{$cat}{Y_min}) && + next unless (defined($$Cat{$cat}{Y_min}) && defined($$Cat{$cat}{Y_max})); my($text) = new XFig ('text'); # $text->{'text'} = "$$Cat{$$Cat{$cat}{father}}{name}"."$$Cat{$cat}{name}"; @@ -273,9 +273,9 @@ sub draw_cat { print STDERR "$link: $src ($src_date) -> $dst ($dst_date)\n"; print STDERR "$$Cat{$src}{name} -> $$Cat{$dst}{name}\n"; - $line->{'points'} = [ [$src_date*$grid_X_size, + $line->{'points'} = [ [$src_date*$grid_X_size, ($$Cat{$src}{Y_min}+$$Cat{$src}{Y_max})/2*$grid_Y_size], - [$dst_date*$grid_X_size, + [$dst_date*$grid_X_size, ($$Cat{$dst}{Y_min}+$$Cat{$dst}{Y_max})/2*$grid_Y_size] ]; $line->{'forwardarrow'} = ['1', '1', '1.00', '60.00', '120.00']; $fig->add ($line); @@ -293,7 +293,7 @@ sub draw_cat { next unless (defined($$Cat{$cat}{Y_min_host}) && defined($$Cat{$cat}{Y_max_host})); my($line) = new XFig ('polyline'); - $line->{'depth'} = 150; + $line->{'depth'} = 150; $line->{'subtype'} = 1; # line $line->{'points'} = [ [$min_x_for_host, $$Cat{$cat}{Y_min_host}*$grid_Y_size], [$max_date*$grid_X_size+150, $$Cat{$cat}{Y_min_host}*$grid_Y_size], @@ -330,7 +330,7 @@ sub draw_cat { my($line) = new XFig ('polyline'); - $line->{'depth'} = 50; + $line->{'depth'} = 50; $line->{'subtype'} = 1; # line $line->{'points'} = [ [$min_x,$min_Y + ($i-1)*$height ], [$min_x + $width,$min_Y + ($i-1)*$height], @@ -362,15 +362,15 @@ sub draw_cat { $fig->add ($text); $i++; } - + # Time axis my($line) = new XFig ('polyline'); - $line->{'depth'} = 0; + $line->{'depth'} = 0; $line->{'subtype'} = 1; # line $line->{'points'} = [ [0,0],[$max_date * $grid_X_size+150,0] ]; $line->{'forwardarrow'} = ['1', '1', '1.00', '60.00', '120.00']; $fig->add ($line); - + my($digits)=POSIX::floor(log($max_date)/log(10)); my($exponent) = 10**$digits; my($mantissa)= $max_date / $exponent; @@ -388,7 +388,7 @@ sub draw_cat { for($x=0; $x < $max_date; $x += $incr) { print "$x\n"; $line = new XFig ('polyline'); - $line->{'depth'} = 0; + $line->{'depth'} = 0; $line->{'subtype'} = 1; # line $line->{'points'} = [ [$x * $grid_X_size,0],[$x * $grid_X_size, -100] ]; $line->{'forwardarrow'} = 0; @@ -404,9 +404,9 @@ sub draw_cat { # Empty line so that the text of the time axis can be seen on the pdf $line = new XFig ('polyline'); - $line->{'depth'} = 999; + $line->{'depth'} = 999; $line->{'subtype'} = 1; # line - $line->{'thickness'} = 0; + $line->{'thickness'} = 0; $line->{'points'} = [ [0,0],[0, -400] ]; $fig->add ($line); } @@ -424,7 +424,7 @@ sub main { shift @$cat_list; # print "@$cat_list \n"; set_cat_position($Cat,$cat_list); - + my($fig)=create_fig("toto.fig"); draw_cat($fig,$Cat,$Link); $fig->writefile (); diff --git a/tools/cmake/CTestConfig.cmake b/tools/cmake/CTestConfig.cmake index 42b8753cea..3b87fa919a 100644 --- a/tools/cmake/CTestConfig.cmake +++ b/tools/cmake/CTestConfig.cmake @@ -40,7 +40,7 @@ SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE "3000000") set(PATTERN_CTEST_IGNORED "") if(enable_coverage) - set(PATTERN_CTEST_IGNORED + set(PATTERN_CTEST_IGNORED "/tools/" "/buildtools/" "/include/" @@ -48,7 +48,7 @@ if(enable_coverage) "/src/bindings/" ) if(NOT release) - set(PATTERN_CTEST_IGNORED + set(PATTERN_CTEST_IGNORED ${PATTERN_CTEST_IGNORED} "/examples/" ) diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index bbceacb482..aea9490209 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -86,7 +86,7 @@ set(EXTRA_DIST teshsuite/lua/lua_platforms.tesh examples/smpi/mc/only_send_deterministic.tesh examples/smpi/mc/non_deterministic.tesh - + examples/java/.classpath examples/java/.project ) @@ -303,11 +303,11 @@ set(SURF_SRC src/kernel/lmm/lagrange.cpp src/kernel/lmm/maxmin.hpp src/kernel/lmm/maxmin.cpp - + src/kernel/resource/Action.cpp src/kernel/resource/Model.cpp src/kernel/resource/Resource.cpp - + src/kernel/routing/ClusterZone.cpp src/kernel/routing/DijkstraZone.cpp src/kernel/routing/DragonflyZone.cpp @@ -320,7 +320,7 @@ set(SURF_SRC src/kernel/routing/TorusZone.cpp src/kernel/routing/RoutedZone.cpp src/kernel/routing/VivaldiZone.cpp - + src/kernel/EngineImpl.cpp src/kernel/EngineImpl.hpp @@ -365,7 +365,7 @@ set(PLUGINS_SRC src/plugins/vm/VmLiveMigration.cpp src/plugins/vm/VmLiveMigration.hpp ) - + set(SIMIX_GENERATED_SRC src/simix/popping_generated.cpp ) set(SIMIX_SRC src/kernel/future.cpp @@ -401,7 +401,7 @@ set(SIMIX_SRC src/kernel/activity/SynchroIo.hpp src/kernel/activity/SynchroRaw.cpp src/kernel/activity/SynchroRaw.hpp - + ${SIMIX_GENERATED_SRC} ) @@ -423,9 +423,9 @@ set(S4U_SRC src/s4u/s4u_activity.cpp src/s4u/s4u_conditionVariable.cpp src/s4u/s4u_comm.cpp - src/s4u/s4u_engine.cpp - src/s4u/s4u_exec.cpp - src/s4u/s4u_host.cpp + src/s4u/s4u_engine.cpp + src/s4u/s4u_exec.cpp + src/s4u/s4u_host.cpp src/s4u/s4u_link.cpp src/s4u/s4u_mailbox.cpp src/s4u/s4u_mutex.cpp @@ -595,7 +595,7 @@ set(MC_SRC src/mc/remote/RemotePtr.hpp src/mc/remote/mc_protocol.h src/mc/remote/mc_protocol.cpp - + src/mc/AddressSpace.hpp src/mc/Frame.hpp src/mc/Frame.cpp @@ -685,15 +685,15 @@ set(headers_to_install include/simgrid/s4u/Actor.hpp include/simgrid/s4u/Comm.hpp include/simgrid/s4u/ConditionVariable.hpp - include/simgrid/s4u/Engine.hpp + include/simgrid/s4u/Engine.hpp include/simgrid/s4u/Exec.hpp - include/simgrid/s4u/Host.hpp - include/simgrid/s4u/Link.hpp + include/simgrid/s4u/Host.hpp + include/simgrid/s4u/Link.hpp include/simgrid/s4u/Mailbox.hpp include/simgrid/s4u/Mutex.hpp include/simgrid/s4u/NetZone.hpp - include/simgrid/s4u/Storage.hpp - include/simgrid/s4u/VirtualMachine.hpp + include/simgrid/s4u/Storage.hpp + include/simgrid/s4u/VirtualMachine.hpp include/simgrid/s4u.hpp include/simgrid/kernel/resource/Action.hpp @@ -711,7 +711,7 @@ set(headers_to_install include/simgrid/kernel/routing/NetZoneImpl.hpp include/simgrid/kernel/routing/RoutedZone.hpp include/simgrid/kernel/routing/TorusZone.hpp - include/simgrid/kernel/routing/VivaldiZone.hpp + include/simgrid/kernel/routing/VivaldiZone.hpp include/smpi/mpi.h include/smpi/smpi.h @@ -806,7 +806,7 @@ set(simgrid_sources ${XBT_SRC} ) -if(${SIMGRID_HAVE_JEDULE}) +if(${SIMGRID_HAVE_JEDULE}) set(simgrid_sources ${simgrid_sources} ${JEDULE_SRC}) else() set(EXTRA_DIST ${EXTRA_DIST} ${JEDULE_SRC}) @@ -892,10 +892,10 @@ set(DOC_SOURCES doc/doxygen/module-index.doc doc/doxygen/ns3.doc doc/doxygen/options.doc - doc/doxygen/outcomes.doc - doc/doxygen/outcomes_logs.doc - doc/doxygen/outcomes_MC.doc - doc/doxygen/outcomes_vizu.doc + doc/doxygen/outcomes.doc + doc/doxygen/outcomes_logs.doc + doc/doxygen/outcomes_MC.doc + doc/doxygen/outcomes_vizu.doc doc/doxygen/platform.doc doc/doxygen/platform_lua.doc doc/doxygen/scenario.doc @@ -982,7 +982,7 @@ set(txt_files TODO ) -# The list of cmake build directories is constructed from the following list. +# The list of cmake build directories is constructed from the following list. # Add your CMakeLists file here to see your subdir built. set(CMAKEFILES_TXT examples/java/CMakeLists.txt @@ -1006,7 +1006,7 @@ set(CMAKEFILES_TXT teshsuite/smpi/CMakeLists.txt teshsuite/surf/CMakeLists.txt teshsuite/xbt/CMakeLists.txt - + teshsuite/smpi/isp/umpire/CMakeLists.txt teshsuite/smpi/mpich3-test/CMakeLists.txt teshsuite/smpi/mpich3-test/attr/CMakeLists.txt @@ -1038,7 +1038,7 @@ set(CMAKEFILES_TXT teshsuite/smpi/mpich3-test/topo/CMakeLists.txt teshsuite/smpi/mpich3-test/rma/CMakeLists.txt teshsuite/smpi/mpich3-test/perf/CMakeLists.txt - + tools/CMakeLists.txt tools/graphicator/CMakeLists.txt tools/tesh/CMakeLists.txt diff --git a/tools/cmake/Distrib.cmake b/tools/cmake/Distrib.cmake index 8a8c3d0490..02751db4dd 100644 --- a/tools/cmake/Distrib.cmake +++ b/tools/cmake/Distrib.cmake @@ -118,8 +118,8 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/smpirun.1 COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/smpiff.1 COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/smpif90.1 - - + + COMMAND ${CMAKE_COMMAND} -E echo "uninstall man ok" WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}") @@ -303,10 +303,10 @@ add_custom_target(distcheck COMMAND ${CMAKE_COMMAND} -E echo "XXX Configure" COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_inst -Denable_lto=OFF .. - + COMMAND ${CMAKE_COMMAND} -E echo "XXX Build" COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM} -j 4 - + COMMAND ${CMAKE_COMMAND} -E echo "XXX Test" COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ctest --output-on-failure -j 4 diff --git a/tools/cmake/Documentation.cmake b/tools/cmake/Documentation.cmake index 780d7d2c5e..a2eeb0d672 100644 --- a/tools/cmake/Documentation.cmake +++ b/tools/cmake/Documentation.cmake @@ -17,7 +17,7 @@ endif() find_path(FIG2DEV_PATH NAMES fig2dev PATHS NO_DEFAULT_PATHS) if(enable_documentation) - ADD_CUSTOM_TARGET(documentation + ADD_CUSTOM_TARGET(documentation COMMENT "Generating the SimGrid documentation..." DEPENDS ${DOC_SOURCES} ${DOC_FIGS} ${source_doxygen} COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_HOME_DIRECTORY}/doc/html @@ -27,7 +27,7 @@ if(enable_documentation) message(STATUS "Doxygen version: ${DOXYGEN_VERSION}") - # This is a workaround for older cmake versions (such as 2.8.7 on Ubuntu 12.04). These cmake versions do not provide + # This is a workaround for older cmake versions (such as 2.8.7 on Ubuntu 12.04). These cmake versions do not provide # the DOXYGEN_VERSION variable and hence, building the documentation will always fail. This code is the same as used # in the cmake library, version 3. if(DOXYGEN_EXECUTABLE) @@ -98,7 +98,7 @@ add_custom_target(gforge-sync add_dependencies(gforge-sync documentation) else(enable_documentation) - ADD_CUSTOM_TARGET(documentation + ADD_CUSTOM_TARGET(documentation COMMENT "The generation of the SimGrid documentation was disabled in cmake" ) endif(enable_documentation) @@ -106,14 +106,14 @@ endif(enable_documentation) if (Java_FOUND) find_path(JAVADOC_PATH NAMES javadoc PATHS NO_DEFAULT_PATHS) mark_as_advanced(JAVADOC_PATH) - + ADD_CUSTOM_COMMAND(TARGET documentation COMMAND ${CMAKE_COMMAND} -E echo "XX Javadoc pass" COMMAND ${JAVADOC_PATH}/javadoc -quiet -d ${CMAKE_HOME_DIRECTORY}/doc/html/javadoc/ ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/*.java ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/*/*.java WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc ) endif() - + #### Generate the manpages if( NOT MANPAGE_DIR) set( MANPAGE_DIR ${CMAKE_BINARY_DIR}/manpages ) diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 2b86e58f5f..8f9f21bfa1 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -5,7 +5,7 @@ ## ## These flags do break some classical CMake tests, so you don't ## want to do so before the very end of the configuration. -## +## ## Other compiler flags (C/C++ standard version) are tested and set ## by the beginning of the configuration, directly in ~/CMakeList.txt @@ -49,7 +49,7 @@ if(enable_compile_warnings) endif() # the one specific to C but refused by C++ - set(warnCFLAGS "${warnCFLAGS} -Wmissing-prototypes") + set(warnCFLAGS "${warnCFLAGS} -Wmissing-prototypes") if(CMAKE_Fortran_COMPILER_ID MATCHES "GCC|PGI") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall") @@ -126,12 +126,12 @@ if(enable_lto) # User wants LTO. Try if we can do that else() if(NOT enable_compile_optimizations) message(STATUS "LTO disabled: Compile-time optimizations turned off.") - else() + else() if(enable_model-checking) message(STATUS "LTO disabled when compiling with model-checking.") else() message(STATUS "LTO does not seem usable -- try updating your build chain.") - endif() + endif() endif() endif() else() @@ -194,7 +194,7 @@ endif() # Avoid a failure seen with gcc 7.2.0 and ns3 3.27 if(enable_ns3) - set_source_files_properties(src/surf/network_ns3.cpp PROPERTIES COMPILE_FLAGS " -Wno-unused-local-typedef") + set_source_files_properties(src/surf/network_ns3.cpp PROPERTIES COMPILE_FLAGS " -Wno-unused-local-typedef") endif() set(TESH_OPTION "") @@ -259,13 +259,13 @@ if(MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc") set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++") - + # JNI searches for stdcalls set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--add-stdcall-alias") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--add-stdcall-alias") set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -Wl,--add-stdcall-alias") set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -Wl,--add-stdcall-alias") - + # Specify the data model that we are using (yeah it may help Java) if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") @@ -273,5 +273,5 @@ if(MINGW) else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") - endif() + endif() endif() diff --git a/tools/cmake/Java.cmake b/tools/cmake/Java.cmake index fecf92b3e5..5419109684 100644 --- a/tools/cmake/Java.cmake +++ b/tools/cmake/Java.cmake @@ -96,7 +96,7 @@ endif() 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() @@ -117,9 +117,9 @@ if(enable_lib_in_jar) 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} ) @@ -165,11 +165,11 @@ endif(APPLE) 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}) diff --git a/tools/cmake/MaintainerMode.cmake b/tools/cmake/MaintainerMode.cmake index e279ee15fe..468dfadc47 100644 --- a/tools/cmake/MaintainerMode.cmake +++ b/tools/cmake/MaintainerMode.cmake @@ -42,24 +42,24 @@ if(enable_maintainer_mode AND NOT WIN32) endif() # Let's generate header files required by SMPI when the call location tracing -# has been activated. +# has been activated. if(enable_maintainer_mode AND NOT WIN32) add_custom_command(OUTPUT ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces.h ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces_fortran.h - + COMMENT "Generating header files for call-location tracing with SMPI" # Make sure there is no space after the redirection operator (>). I received # error messages in that case on my Debian system. COMMAND "${CMAKE_HOME_DIRECTORY}/tools/smpi/generate_smpi_defines.pl" "${CMAKE_HOME_DIRECTORY}/include/smpi/smpi.h >${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces.h" COMMAND "${CMAKE_HOME_DIRECTORY}/tools/smpi/generate_smpi_defines.pl" "-f" "${CMAKE_HOME_DIRECTORY}/include/smpi/smpi.h >${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces_fortran.h" ) - + add_custom_target(smpi_generated_headers_call_location_tracing DEPENDS ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces.h ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces_fortran.h ) - + SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces.h;${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces_fortran.h" ) diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 66886a7ce2..8d65b90e60 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -7,7 +7,7 @@ if(APPLE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # When installed, use system path set(CMAKE_SKIP_BUILD_RPATH FALSE) # When executing from build tree, take the lib from the build path if exists set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # When executing from build tree, take the lib from the system path if exists - + # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib # (useful when unpacking the native libraries from the jarfile) set(CMAKE_INSTALL_RPATH "@loader_path/.;@rpath/.") diff --git a/tools/cmake/MakeLibWin.cmake b/tools/cmake/MakeLibWin.cmake index 428fba4f2f..596f09c28f 100644 --- a/tools/cmake/MakeLibWin.cmake +++ b/tools/cmake/MakeLibWin.cmake @@ -3,15 +3,15 @@ add_library(simgrid SHARED ${simgrid_sources}) if(MSVC) - set_target_properties(simgrid PROPERTIES - COMPILE_FLAGS "/DDLL_EXPORT" + set_target_properties(simgrid PROPERTIES + COMPILE_FLAGS "/DDLL_EXPORT" VERSION ${libsimgrid_version} ) else() - set_target_properties(simgrid PROPERTIES - COMPILE_FLAGS "-DDLL_EXPORT" - LINK_FLAGS "-shared" - VERSION ${libsimgrid_version} - PREFIX "lib" SUFFIX ".dll" + set_target_properties(simgrid PROPERTIES + COMPILE_FLAGS "-DDLL_EXPORT" + LINK_FLAGS "-shared" + VERSION ${libsimgrid_version} + PREFIX "lib" SUFFIX ".dll" IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll") set(SIMGRID_DEP "-lm") diff --git a/tools/cmake/Modules/FindLibunwind.cmake b/tools/cmake/Modules/FindLibunwind.cmake index 8b6dbd3998..e4ca67f210 100644 --- a/tools/cmake/Modules/FindLibunwind.cmake +++ b/tools/cmake/Modules/FindLibunwind.cmake @@ -45,7 +45,7 @@ SET(HAVE_LIBUNWIND 1) # # Search for the header file -# +# find_path(PATH_LIBUNWIND_H "libunwind.h" HINTS @@ -56,7 +56,7 @@ find_path(PATH_LIBUNWIND_H "libunwind.h" if(PATH_LIBUNWIND_H) string(REGEX REPLACE "/libunwind.h" "" PATH_LIBUNWIND_H "${PATH_LIBUNWIND_H}") message(" Found libunwind.h in ${PATH_LIBUNWIND_H}") - include_directories(${PATH_LIBUNWIND_H}) + include_directories(${PATH_LIBUNWIND_H}) else() message(" NOT FOUND libunwind.h") SET(HAVE_LIBUNWIND 0) @@ -80,7 +80,7 @@ foreach(component ${LIBUNWIND_COMPONENTS}) string(REGEX REPLACE "/lib${component}.*[.]${LIB_EXE}$" "" PATH_LIBUNWIND_LIB_${component} "${PATH_LIBUNWIND_LIB_${component}}") message(" Found lib${component}.${LIB_EXE} in ${PATH_LIBUNWIND_LIB_${component}}") link_directories(${PATH_LIBUNWIND_LIB_${component}}) - + if(${component} STREQUAL "unwind" AND APPLE) # Apple forbids to link directly against its libunwind implementation # So let's comply to that stupid restriction and link against the System framework @@ -100,7 +100,7 @@ unset(LIBUNWIND_COMPONENTS) # # Conclude and cleanup -# +# if(HAVE_LIBUNWIND) message(STATUS "Dependencies induced by libunwind: ${LIBUNWIND_LIBRARIES}") else() diff --git a/tools/cmake/Modules/FindLuaSimgrid.cmake b/tools/cmake/Modules/FindLuaSimgrid.cmake index 1ac9d00295..00b9fb801b 100644 --- a/tools/cmake/Modules/FindLuaSimgrid.cmake +++ b/tools/cmake/Modules/FindLuaSimgrid.cmake @@ -1,5 +1,5 @@ # Search for the Lua 5.3 include files and libraries -# +# # Input variable: # LUA_HINT: path to Lua installation -- only needed for non-standard installs # Output variable: @@ -40,7 +40,7 @@ find_library(LUA_LIBRARY /opt/csw /opt ) -if (NOT LUA_LIBRARY) +if (NOT LUA_LIBRARY) message(FATAL_ERROR "Error: Lua library not found. Please install that package (and set LUA_HINT) or disable Lua.") endif() if (NOT LUA_INCLUDE_DIR OR NOT EXISTS "${LUA_INCLUDE_DIR}/lua.h") @@ -53,7 +53,7 @@ file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_VERSION_MINOR[ \t]+\"[0123456789]+\"") string(REGEX REPLACE "^#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([^\"]+)\"" "\\1" LUA_VERSION_MINOR "${lua_version_str}") unset(lua_version_str) - + # Check that we have a sufficient version of Lua if(LUA_VERSION_MAJOR EQUAL 5 AND LUA_VERSION_MINOR EQUAL 3) set(SIMGRID_HAVE_LUA 1) diff --git a/tools/cmake/Modules/FindNS3.cmake b/tools/cmake/Modules/FindNS3.cmake index fdec6b8ca5..d036843925 100644 --- a/tools/cmake/Modules/FindNS3.cmake +++ b/tools/cmake/Modules/FindNS3.cmake @@ -64,13 +64,13 @@ if(NS3_INCLUDE_DIR) # Compute NS3_PATH string(REGEX REPLACE "(.*)/lib" "\\1" NS3_PATH "${NS3_LIBRARY_PATH}") - + message(STATUS "NS-3 found (v${NS3_VERSION}; incl:${NS3_INCLUDE_DIR}; lib: ${NS3_LIBRARY_PATH}).") - if (NOT NS3_LIBRARY_PATH STREQUAL "/usr/lib") + if (NOT NS3_LIBRARY_PATH STREQUAL "/usr/lib") string(REGEX MATCH "${NS3_LIBRARY_PATH}" MatchResult "$ENV{LD_LIBRARY_PATH}") if(NOT MatchResult) - message(STATUS "Warning: NS3 not installed in system path, and not listed in LD_LIBRARY_PATH." + message(STATUS "Warning: NS3 not installed in system path, and not listed in LD_LIBRARY_PATH." " You want to: export LD_LIBRARY_PATH=${NS3_LIBRARY_PATH}\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}") endif() endif() diff --git a/tools/cmake/Modules/FindPAPI.cmake b/tools/cmake/Modules/FindPAPI.cmake index afb95bbe37..e283f428cb 100644 --- a/tools/cmake/Modules/FindPAPI.cmake +++ b/tools/cmake/Modules/FindPAPI.cmake @@ -29,10 +29,10 @@ find_path(PAPI_PREFIX message(STATUS "Looking for libpapi") find_library(PAPI_LIBRARY NAMES libpapi papi - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib64 lib # HINTS gets searched before PATHS - HINTS - ${PAPI_PREFIX}/lib + HINTS + ${PAPI_PREFIX}/lib ) if(PAPI_LIBRARY) message(STATUS "Looking for libpapi - found at ${PAPI_LIBRARY}") @@ -44,7 +44,7 @@ message(STATUS "Looking for papi.h") find_path(PAPI_INCLUDE_DIRS NAMES papi.h # HINTS gets searched before PATHS - HINTS ${PAPI_PREFIX}/include + HINTS ${PAPI_PREFIX}/include ) if(PAPI_INCLUDE_DIRS) message(STATUS "Looking for papi.h - found at ${PAPI_INCLUDE_DIRS}") diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index b1c99ef8e2..d596f3628c 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -97,9 +97,9 @@ if(Boost_UNIT_TEST_FRAMEWORK_FOUND) TARGET unit_tmgr APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}" - ) - - + ) + + else() set(EXTRA_DIST ${EXTRA_DIST} src/surf/trace_mgr_test.cpp) endif() @@ -122,7 +122,7 @@ if((NOT enable_memcheck) AND (NOT enable_address_sanitizer) AND (NOT enable_unde SET_TESTS_PROPERTIES(tuto-msg-0 tuto-msg-1 tuto-msg-2 tuto-msg-3 tuto-msg-4 PROPERTIES FIXTURES_REQUIRED tuto-msg-clean) FOREACH(TUTOTEST tuto-msg-0 tuto-msg-1 tuto-msg-2 tuto-msg-3 tuto-msg-4) - SET_TESTS_PROPERTIES(${TUTOTEST} + SET_TESTS_PROPERTIES(${TUTOTEST} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib") ENDFOREACH() endif() diff --git a/tools/cmake/UnitTesting.cmake b/tools/cmake/UnitTesting.cmake index cd3f9a457c..f07898fc8c 100644 --- a/tools/cmake/UnitTesting.cmake +++ b/tools/cmake/UnitTesting.cmake @@ -28,7 +28,7 @@ foreach(file ${FILES_CONTAINING_UNITTESTS}) get_filename_component(ext ${file} EXT) set(EXTRACTED_TEST_SOURCE_FILES ${EXTRACTED_TEST_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/src/${basename}_unit${ext}) endforeach() - + set(EXTRACTED_TEST_SOURCE_FILES ${EXTRACTED_TEST_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/src/simgrid_units_main.c) set_source_files_properties(${EXTRACTED_TEST_SOURCE_FILES} PROPERTIES GENERATED true) @@ -50,5 +50,5 @@ set_property( TARGET testall APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}" - ) + ) diff --git a/tools/cmake/src/internal_config.h.in b/tools/cmake/src/internal_config.h.in index aac7ce0a3e..3a43feab49 100644 --- a/tools/cmake/src/internal_config.h.in +++ b/tools/cmake/src/internal_config.h.in @@ -1,6 +1,6 @@ /* internal_config.h -- characteristics of the platform, as probed by Cmake */ -/* Warning: The file internal_config.h is AUTOMATICALLY GENERATED by Cmake. +/* Warning: The file internal_config.h is AUTOMATICALLY GENERATED by Cmake. * Edit the template instead: tools/cmake/src/internal_config.h.in */ /* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */ diff --git a/tools/doxygen/fig2dev_postprocessor.pl b/tools/doxygen/fig2dev_postprocessor.pl index d14ce0933e..065093cd5e 100755 --- a/tools/doxygen/fig2dev_postprocessor.pl +++ b/tools/doxygen/fig2dev_postprocessor.pl @@ -13,8 +13,8 @@ my $line; while($line=) { chomp $line; - if($line=~/IMG/) {$print=1;} + if($line=~/IMG/) {$print=1;} if($print) {print $line."\n";} - if($line=~/\/MAP/) {$print=0;} + if($line=~/\/MAP/) {$print=0;} } #perl -pe 's/imagemap/simgrid_modules/g'| perl -pe 's/) { parse_file("../include/xbt/sysdep.h"); close FILES; -# Display the tree, looking for disconnected elems +# Display the tree, looking for disconnected elems my %used; sub display_subtree { my $name=shift; my $indent=shift; - + $used{$name} = 1; unless ($name eq "XBT_LOG_ROOT_CAT") { # do not display the root print "$indent - $name: ".($desc{$name}|| "(undocumented)")."\n"; diff --git a/tools/git-hooks/clang-format.pre-commit b/tools/git-hooks/clang-format.pre-commit index 65ff57fca1..bd57456d85 100755 --- a/tools/git-hooks/clang-format.pre-commit +++ b/tools/git-hooks/clang-format.pre-commit @@ -1,17 +1,17 @@ #!/usr/bin/env bash # Copyright (c) 2015, David Martin. All rights reserved. # Copyright (c) 2017, The SimGrid team. All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. -# +# # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE diff --git a/tools/internal/check_dist_archive b/tools/internal/check_dist_archive index e31e692b19..937fbdedda 100755 --- a/tools/internal/check_dist_archive +++ b/tools/internal/check_dist_archive @@ -103,7 +103,7 @@ EOF fi } -colordiff=$(type -p colordiff || true) +colordiff=$(type -p colordiff || true) colorless() { if [ -x "$colordiff" ]; then "$colordiff" | less -R -F -X diff --git a/tools/internal/indent b/tools/internal/indent index 3587410b2b..8ea74dd282 100755 --- a/tools/internal/indent +++ b/tools/internal/indent @@ -8,7 +8,7 @@ declare -a OPTIONS OPTIONS=( - -kr # Use Kernighan & Ritchie coding style. + -kr # Use Kernighan & Ritchie coding style. -l120 # Set maximum line length for non-comment lines to 120. -nut # Use spaces instead of tabs. -i2 # Set indentation level to 2 spaces. diff --git a/tools/internal/spell_comments.pl b/tools/internal/spell_comments.pl index 6c19744fb9..41991bd300 100755 --- a/tools/internal/spell_comments.pl +++ b/tools/internal/spell_comments.pl @@ -47,14 +47,14 @@ foreach my $file (@ARGV) { open(PIN, "ispell -d american -p $DICTFILE -l < $TEMPFILE | sort -uf |") || die; my @badwords; while (my $err = ) { - chomp $err; + chomp $err; push(@badwords, $err) if ($err =~ /\w/ && length($err)>0); } close(PIN) || die; if (@badwords) { print "$file: ".scalar(@badwords)." errors: '".join("','",@badwords)."'\n"; - $total += scalar(@badwords); + $total += scalar(@badwords); } } diff --git a/tools/internal/travis-sonarqube.sh b/tools/internal/travis-sonarqube.sh index fc62cd1f14..054088cb3e 100755 --- a/tools/internal/travis-sonarqube.sh +++ b/tools/internal/travis-sonarqube.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# Install and run SonarQube on travis. +# Install and run SonarQube on travis. # # Use it as a wrapper to your build command, eg: ./travis-sonarqube.sh make VERBOSE=1 @@ -44,7 +44,7 @@ fi # generate the gcov files ctest -D ExperimentalCoverage -# and finally execute the actual SonarQube analysis +# and finally execute the actual SonarQube analysis # (the SONAR_TOKEN is set from the travis web interface, to not expose it with an ongoing "set -x") # See https://docs.travis-ci.com/user/sonarqube/ for more info on tokens # don't show the token in the logs diff --git a/tools/internal/update_copyright_header b/tools/internal/update_copyright_header index e68449192d..f36ddced77 100755 --- a/tools/internal/update_copyright_header +++ b/tools/internal/update_copyright_header @@ -89,7 +89,7 @@ for file; do continue fi - if grep -q "Copyright.*SimGrid" $file ; then + if grep -q "Copyright.*SimGrid" $file ; then if head -n 1 "$file" | grep -q '^#!'; then script=1 else @@ -128,7 +128,7 @@ for file; do cat "$tmp_head" "$tmp_copy" "$tmp_foot" > $file else echo "Pass: there is no SimGrid Copyright header." - fi ; # + fi ; # done cat <
- - +
+ @@ -28,7 +28,7 @@ Testing with valgrind and gcov. Click on the graphs for details. Test Results - + - + @@ -56,7 +56,7 @@ Testing with valgrind and gcov. Click on the graphs for details. Test Results : Address Sanitizer (info) - + - + @@ -81,7 +81,7 @@ Testing with valgrind and gcov. Click on the graphs for details. Test Results : Undefined Sanitizer (info) - +
Valgrind Results
@@ -45,7 +45,7 @@ Testing with valgrind and gcov. Click on the graphs for details.
Sloccount Results
@@ -73,7 +73,7 @@ Testing with valgrind and gcov. Click on the graphs for details.
Test Results : Thread Sanitizer (info)
diff --git a/tools/jenkins/Flags.sh b/tools/jenkins/Flags.sh index 597c14b4e0..40ac3013dc 100755 --- a/tools/jenkins/Flags.sh +++ b/tools/jenkins/Flags.sh @@ -53,35 +53,35 @@ 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 +then buildjava="ON" else buildjava="OFF" fi if [ $2 = "MC" ] -then +then buildmc="ON" else buildmc="OFF" fi if [ $3 = "SMPI" ] -then +then buildsmpi="ON" else buildsmpi="OFF" fi if [ $4 = "DEBUG" ] -then +then builddebug="ON" else builddebug="OFF" fi -echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" +echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \ -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \ diff --git a/tools/jenkins/Sanitizers.sh b/tools/jenkins/Sanitizers.sh index 353299dca0..3608d24294 100755 --- a/tools/jenkins/Sanitizers.sh +++ b/tools/jenkins/Sanitizers.sh @@ -49,10 +49,10 @@ fi for pkg in xsltproc do if command -v $pkg - then + then echo "$pkg is installed. Good." - else - die "please install $pkg before proceeding" + else + die "please install $pkg before proceeding" fi done diff --git a/tools/jenkins/build.sh b/tools/jenkins/build.sh index bf88895307..37fbdb659a 100755 --- a/tools/jenkins/build.sh +++ b/tools/jenkins/build.sh @@ -12,14 +12,14 @@ export LC_ALL=C echo "XXXX Cleanup previous attempts. Remaining content of /tmp:" rm -rf /tmp/simgrid-java* -rm -rf /tmp/jvm-* +rm -rf /tmp/jvm-* find /builds/workspace/SimGrid-Multi/ -name "hs_err_pid*.log" | xargs rm -f ls /tmp df -h echo "XXXX Let's go" # Help older cmakes -if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ; +if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ; then export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 fi diff --git a/tools/jenkins/jacoco.xml b/tools/jenkins/jacoco.xml index 3d504c353f..dd4ac04527 100644 --- a/tools/jenkins/jacoco.xml +++ b/tools/jenkins/jacoco.xml @@ -5,11 +5,11 @@ - + - + @@ -19,9 +19,9 @@ - + - + diff --git a/tools/lualib.patch b/tools/lualib.patch index 275caa0f96..b9a8d34121 100644 --- a/tools/lualib.patch +++ b/tools/lualib.patch @@ -12,11 +12,11 @@ index 5ee5601..93830a3 100644 +++ b/Makefile @@ -52,7 +52,7 @@ R= $V.1 all: $(PLAT) - + $(PLATS) clean: - cd src && $(MAKE) $@ + cd src && $(MAKE) $@ V=$(V) R=$(R) - + test: dummy src/lua -v diff --git a/src/Makefile b/src/Makefile @@ -25,16 +25,16 @@ index d71c75c..64bda79 100644 +++ b/src/Makefile @@ -7,7 +7,7 @@ PLAT= none - + CC= gcc -std=gnu99 -CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) +CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) LIBS= -lm $(SYSLIBS) $(MYLIBS) - + @@ -29,6 +29,7 @@ MYOBJS= PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris - + LUA_A= liblua.a +LUA_SO= liblua.so CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ @@ -42,17 +42,17 @@ index d71c75c..64bda79 100644 ltm.o lundump.o lvm.o lzio.o @@ -43,7 +44,7 @@ LUAC_T= luac LUAC_O= luac.o - + ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) ALL_A= $(LUA_A) - + # Targets start here. @@ -59,6 +60,11 @@ $(LUA_A): $(BASE_O) $(AR) $@ $(BASE_O) $(RANLIB) $@ - + +$(LUA_SO): $(CORE_O) $(LIB_O) + $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) + ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) @@ -60,4 +60,4 @@ index d71c75c..64bda79 100644 + $(LUA_T): $(LUA_O) $(LUA_A) $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - + diff --git a/tools/sg_unit_extractor.pl b/tools/sg_unit_extractor.pl index 8b2083fffc..dabc3dcea1 100755 --- a/tools/sg_unit_extractor.pl +++ b/tools/sg_unit_extractor.pl @@ -9,7 +9,7 @@ use strict; use Getopt::Long qw(GetOptions); my $progname="sg_unit_extractor"; -# Get the args +# Get the args sub usage($) { my $ret; @@ -36,25 +36,25 @@ map {process_one($_)} @ARGV; sub process_one($) { my $infile = shift; my $outfile; - + $infile =~ s|src/|| unless (-e $infile); - + $outfile = $infile; $outfile =~ s/\.c$/_unit.c/; $outfile =~ s/\.cpp$/_unit.cpp/; $outfile =~ s|.*/([^/]*)$|$1| if $outfile =~ m|/|; $outfile = "$outdir$outfile"; - - print "$progname: processing $infile (generating $outfile)...\n"; - + + print "$progname: processing $infile (generating $outfile)...\n"; + # Get the unit data my ($unit_source,$suite_name,$suite_title)=("","",""); my (%tests); # to detect multiple definition my (@tests); # actual content - + open IN, "$infile" || die "$progname: Cannot open input file '$infile': $!\n"; $infile =~ s|$root|| if defined($root); - + my $takeit=0; my $line=0; my $beginline=0; @@ -82,7 +82,7 @@ sub process_one($) { if (m/XBT_TEST_UNIT\(\w*"([^"]*)"\w*,([^,]*),(.*?)\)/) { #"{ die "$progname: multiply defined unit in file $infile: $1\n" if (defined($tests{$1})); - + my @t=($1,$2,$3); push @tests,\@t; $tests{$1} = 1; @@ -102,7 +102,7 @@ sub process_one($) { } die "$progname: no suite defined in $infile\n" unless (length($suite_name)); - + # Write the test my ($GENERATED)=("/*******************************/\n". @@ -133,7 +133,7 @@ sub process_one($) { # print OUT "# 93 \"sg_unit_extractor.pl\"\n"; print OUT <) { last if /SGU: END FILE/; } @@ -235,26 +235,26 @@ EOF my ($name,$func,$title) = @{$_}; $newmain .= " void $func(void);\n" } @tests; - + $newmain .= " /* SGU: END FILE */\n\n"; if ($old_ =~ /SGU: BEGIN FILE/ || $old_ =~ /SGU: END PROTOTYPES/) { $newmain .= $old_; } - + # pass remaining prototypes, search declarations while () { $newmain .= $_ unless /SGU: END PROTOTYPES/; last if /SGU: BEGIN SUITES DECLARATION/; } - + ### Done with prototypes. And now, the actual code - + # search my prototype while () { last if (/SGU: END SUITES DECLARATION/ || /SGU: BEGIN FILE $infile/); $newmain .= $_; } - if (/SGU: BEGIN FILE $infile/) { # found an old section for this file. Kill it + if (/SGU: BEGIN FILE $infile/) { # found an old section for this file. Kill it while () { last if /SGU: END FILE/; } @@ -270,18 +270,18 @@ EOF my ($name,$func,$title) = @{$_}; $newmain .= " xbt_test_suite_push(suite, \"$name\", $func, $title);\n"; } @tests; - + $newmain .= " /* SGU: END FILE */\n\n"; if ($old_ =~ /SGU: BEGIN FILE/ || $old_ =~ /SGU: END SUITES DECLARATION/) { $newmain .= $old_; } - - # pass the remaining + + # pass the remaining while () { $newmain .= $_; } close IN || die "$progname: Cannot close main file '${outdir}simgrid_units_main.c': $!\n"; - + # write it back to main open OUT,">${outdir}simgrid_units_main.c" || die "$progname: Cannot open main file '${outdir}simgrid_units_main.c': $!\n"; print OUT $newmain; diff --git a/tools/simgrid.supp b/tools/simgrid.supp index 287d7bf513..b2b0ff401a 100644 --- a/tools/simgrid.supp +++ b/tools/simgrid.supp @@ -181,7 +181,7 @@ } { - ignore unwind cruft + ignore unwind cruft Memcheck:Param rt_sigprocmask(set) ... @@ -189,16 +189,16 @@ ... } { - ignore unwind cruft + ignore unwind cruft Memcheck:Param msync(start) ... obj:/usr/lib/x86_64-linux-gnu/libunwind.so.* ... } - + { - ignore unwind invalid reads + ignore unwind invalid reads Memcheck:Addr8 fun:_Ux86_64_setcontext } diff --git a/tools/simgrid_update_xml.pl b/tools/simgrid_update_xml.pl index 75adbe294d..7b3ceb7781 100755 --- a/tools/simgrid_update_xml.pl +++ b/tools/simgrid_update_xml.pl @@ -16,11 +16,11 @@ eval 'exec perl -S $0 ${1+"$@"}' =head1 NAME simgrid_update_xml - updates simgrid XML files to latest version - + =head1 SYNOPSIS B I - + =head1 DESCRIPTION simgrid_update_xml updates the simgrid XML file passed as argument. The file @@ -39,7 +39,7 @@ changes in each version. =over 4 -=item +=item The version attribute of platform were added to allow file versioning. @@ -52,13 +52,13 @@ from MFlop/s to Flop/s =item B Introduced in SimGrid 3.4 -=over +=over -=item +=item -Several tags were renamed: +Several tags were renamed: - CPU -> HOST + CPU -> HOST NETWORK_LINK -> LINK ROUTE_ELEMENT -> LINK_CTN PLATFORM_DESCRIPTION -> PLATFORM @@ -74,7 +74,7 @@ Several tags were renamed: The AS tag were introduced. Every platform should now contain an englobing AS tag. -=item +=item Routes are now symmetric by default. @@ -109,16 +109,16 @@ The DOCTYPE points to the right URL: http://simgrid.gforge.inria.fr/simgrid/simg Units are now mandatory in attributes. USE THE SCRIPT sg_xml_unit_converter.py TO CONVERT THIS - - speed. Old default: 'f' or 'flops'. Also defined: - 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf' + - speed. Old default: 'f' or 'flops'. Also defined: + 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf' 'yottaflops', 'zettaflops', 'exaflops', 'petaflops', 'teraflops', 'gigaflops', 'megaflops', 'kiloflops' - + - bandwidth. Old default: 'Bps' bytes per second (or 'bps' but 1 Bps = 8 bps) Also defined in bytes: 'TiBps', 'GiBps', 'MiBps', 'KiBps', 'TBps', 'GBps', 'MBps', 'kBps', 'Bps' - And the same in bits: 'Tibps', 'Gibps', 'Mibps', 'Kibps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps' - + And the same in bits: 'Tibps', 'Gibps', 'Mibps', 'Kibps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps' + - latency. Old default: 's' second. Also defined: - 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond + 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond =back @@ -145,7 +145,7 @@ Rename a few tags, but in a backward-compatible manner: the old names are still =item Rename the FULLDUPLEX sharing into SPLITDUPLEX. - + =back =back @@ -153,14 +153,14 @@ Rename the FULLDUPLEX sharing into SPLITDUPLEX. =head1 AUTHORS The SimGrid team (simgrid-devel@lists.gforge.inria.fr) - + =head1 COPYRIGHT AND LICENSE Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. - + This program is free software; you may redistribute it and/or modify it under the terms of GNU LGPL (v2.1) license. - + =cut @@ -184,7 +184,7 @@ while (defined($line = )) { # eat the header, whatever form it has next if ($line =~ s/<\?xml[^>]*>// && ! $line =~ /\S/); # just in case several tags are on the same line next if ($line =~ s/]*>// && ! $line =~ /\S/); - + if ($line =~ s///) { $fromversion = 0; print "$filename was using version 0\n"; @@ -200,7 +200,7 @@ while (defined($line = )) { next if !$line =~ /\S/; print "$filename was using version $fromversion\n"; } - + if ($fromversion == 0) { while ($line =~ m|^(.*?))) { $line =~ s/\bnetwork_link\b/link/g; $line =~ s/\broute_element\b/link:ctn/g; } - + if ($fromversion < 3) { $line =~ s/\blink:ctn\b/link_ctn/g; $line =~ s/\btrace:connect\b/trace_connect/g; diff --git a/tools/smpi/generate_smpi_defines.pl b/tools/smpi/generate_smpi_defines.pl index 64d1710a98..0bd941b171 100755 --- a/tools/smpi/generate_smpi_defines.pl +++ b/tools/smpi/generate_smpi_defines.pl @@ -1,7 +1,7 @@ #!/usr/bin/env perl # Copyright 2016 Vincent Danjean # Christian Heinrich -# +# # Call this script like this: # C/C++ : ./generate_smpi_defines.pl ../../include/smpi/smpi.h # FORTRAN: ./generate_smpi_defines.pl -f ../../include/smpi/smpi.h @@ -12,7 +12,7 @@ # with MPI+TAU). use strict; use warnings; -use Getopt::Std; +use Getopt::Std; my %options=(); getopts("fc", \%options); @@ -61,7 +61,7 @@ while (defined($line = <>)) { } $incall=1; $wholemacro = $line; - } elsif ($incall && $line =~ /^\s+\S/) { + } elsif ($incall && $line =~ /^\s+\S/) { # Did we already start parsing an MPI_CALL macro? If so, just concatenate $wholemacro .= ' '.$line; } elsif ($incall) { diff --git a/tools/stack-cleaner/README b/tools/stack-cleaner/README index e31ca86a49..510dd0ce7b 100644 --- a/tools/stack-cleaner/README +++ b/tools/stack-cleaner/README @@ -19,5 +19,5 @@ Each of them modify the generated/given X86_64 assembly by prepending stack-clea The modification of the assembly is done by the clean-stack-filter program. -If the underlying compiler is clang, it might be necessary to add the -no-integrated-as flag in order to force the +If the underlying compiler is clang, it might be necessary to add the -no-integrated-as flag in order to force the usage of an external assembler. diff --git a/tools/tesh/background.tesh b/tools/tesh/background.tesh index 3ef568ecde..2336e9d4b4 100644 --- a/tools/tesh/background.tesh +++ b/tools/tesh/background.tesh @@ -1,10 +1,10 @@ ! output ignore $ cmake -E remove bgtesh.pl bgtesh.data -< use strict; +< use strict; < sleep(1); < open (FILE, ") { < print; < } diff --git a/tools/tesh/set-output-sort.tesh b/tools/tesh/set-output-sort.tesh index d1d3cde689..cfff84a4d4 100644 --- a/tools/tesh/set-output-sort.tesh +++ b/tools/tesh/set-output-sort.tesh @@ -3,67 +3,67 @@ p This tests whether TESH correctly sorts command output < p Test sorting and filtering of output -< +< < $ true -< +< < ! output sort < $ true -< +< < $ printf 'profiling: foo\n' -< +< < $ printf 'profiling: foo' -< +< < ! output sort < $ printf 'profiling: foo\n' -< +< < ! output sort < $ printf 'profiling: foo' -< +< < $ printf 'a\nb\nc\nd\n' < > a < > b < > c < > d -< +< < $ printf 'a\nb\nc\nd' < > a < > b < > c < > d -< +< < ! output sort < $ printf 'c\nd\nb\na\n' < > a < > b < > c < > d -< +< < ! output sort < $ printf 'c\nd\nb\na' < > a < > b < > c < > d -< +< < $ printf 'a\nprofiling: foo\nprofiling: bar\nb\nc\nd\nprofiling: baz\n' < > a < > b < > c < > d -< +< < $ printf 'a\nprofiling: foo\nprofiling: bar\nb\nc\nd\nprofiling: baz' < > a < > b < > c < > d -< +< < ! output sort < $ printf 'c\nprofiling: foo\nprofiling: bar\nd\nb\na\nprofiling: baz\n' < > a < > b < > c < > d -< +< < ! output sort < $ printf 'c\nprofiling: foo\nprofiling: bar\nd\nb\na\nprofiling: baz' < > a @@ -113,7 +113,7 @@ $ cat < $ cat < > 123456789012345678 A line < > 123456789012345678 B line -$ ${bindir:=.}/tesh +$ ${bindir:=.}/tesh p Check user-defined prefix length for "output sort" ! output sort 5