Sorry for the mixup, I forgot to commit between the two change sets.
/** 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();
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(); }
#define SIMGRID_PUBLIC_CONFIG_H
#include <xbt/base.h>
-/** 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@
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)
size_t offset, size_t buff_size);
std::vector<std::pair<size_t, size_t>> merge_private_blocks(std::vector<std::pair<size_t, size_t>> src,
std::vector<std::pair<size_t, size_t>> dst);
-
-
+
#endif
#endif
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 {
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.
}
/* 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 */}) {
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.
@Override
public String toString (){
- return this.getName();
+ return this.getName();
}
public native String getName();
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;
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
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);
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
* \verbatim
Host jacquelin;
-try {
+try {
jacquelin = Host.getByName("Jacquelin");
} catch(HostNotFoundException e) {
System.err.println(e.toString());
...
\endverbatim
*
- */
+ */
public class Host {
/**
* This attribute represents a bind between a java host object and
* a native host. Even if this attribute is public you must never
- * access to it. It is set automatically during the call of the
+ * 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;
@Override
public String toString (){
- return this.name;
+ return this.name;
}
/**
*
* @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
public void setData(Object data) {
this.data = data;
- }
+ }
public Object getData() {
return this.data;
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();
* (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,
static {
nativeInit();
}
-}
+}
public class HostFailureException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>HostFailureException</code> without a detail message. */
+ /** Constructs an <code>HostFailureException</code> without a detail message. */
public HostFailureException() {
super();
}
public class HostNotFoundException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>HostNotFoundException</code> without a detail message. */
+ /** Constructs an <code>HostNotFoundException</code> without a detail message. */
public HostNotFoundException() {
super();
}
/**
* 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 {
public JniException() {
super();
}
- /** Constructs an <code>JniException</code> with a detail message. */
+ /** Constructs an <code>JniException</code> with a detail message. */
public JniException(String s) {
super(s);
}
/** 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() ;
public MsgException() {
super();
}
- /** Constructs an <code>MsgException</code> with a detail message. */
+ /** Constructs an <code>MsgException</code> with a detail message. */
public MsgException(String msg) {
super(msg);
}
* 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 {
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");
* 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 {
* @param name The name of the process.
*
* @exception HostNotFoundException if no host with this name exists.
- *
+ *
*
*/
public Process(String hostname, String name) throws HostNotFoundException {
*
* @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.
* @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");
*
* @return The function returns the PID of the next created process.
*
- */
+ */
public static native int killAll();
/** Simply kills the receiving process.
/**
* 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.
*/
/**
* Returns the host of the process.
* @return The host instance of the process.
- */
+ */
public Host getHost() {
return this.host;
}
* @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,
*
* @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);
*
* @return The current process.
*
- */
+ */
public static native Process getCurrentProcess();
/**
* Migrates a process to another host.
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.
/**
* 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.
* This static method returns the current amount of processes running
*
* @return The count of the running processes
- */
+ */
public static native int getCount();
}
public class ProcessNotFoundException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>ProcessNotFoundException</code> without a detail message. */
+ /** Constructs an <code>ProcessNotFoundException</code> without a detail message. */
public ProcessNotFoundException() {
super();
}
*/
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
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
* 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);
* 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) {
/** 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
*/
* 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 */
@Override
public String toString (){
- return this.name;
+ return this.name;
}
*
* @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;
}
*
* @return The size (in bytes) of the storage element.
*
- */
+ */
public native long getSize();
/**
*
* @return The free size (in bytes) of the storage element.
*
- */
+ */
public native long getFreeSize();
/**
*
* @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
*
*
* @return An array containing all the storages installed.
*
- */
+ */
public static native Storage[] all();
/**
public class StorageNotFoundException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>StorageNotFoundException</code> without a detail message. */
+ /** Constructs an <code>StorageNotFoundException</code> without a detail message. */
public StorageNotFoundException() {
super();
}
*
* @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");
*
* @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");
* 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
*/
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();
* the other ones.
*
* @param priority The new priority of the task.
- */
+ */
public native void setPriority(double priority);
/** Set the computation amount needed to process the task
- *
+ *
* Warning if the execution is already started and ongoing, this call does nothing.
* @param flopsAmount the amount of computation needed to process the task
*/
public native void setFlopsAmount(double flopsAmount);
/**
* Set the amount of bytes to exchange the task
- *
+ *
* Warning if the communication is already started and ongoing, this call does nothing.
* @param bytesAmount the size of the task
*/
public native void 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 */
* * 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
*
* @param mailbox where to send the message
* @param timeout
- * @param maxrate
+ * @param maxrate
* @throws TransferFailureException
* @throws HostFailureException
* @throws TimeoutException
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
* 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;
public class TaskCancelledException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>TaskCancelledException</code> without a detail message. */
+ /** Constructs an <code>TaskCancelledException</code> without a detail message. */
public TaskCancelledException() {
super();
}
public class TimeoutException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>TimeoutFailureException</code> without a detail message. */
+ /** Constructs an <code>TimeoutFailureException</code> without a detail message. */
public TimeoutException() {
super();
}
public class TransferFailureException extends MsgException {
private static final long serialVersionUID = 1L;
- /** Constructs an <code>TransferFailureException</code> without a detail message. */
+ /** Constructs an <code>TransferFailureException</code> without a detail message. */
public TransferFailureException() {
super();
}
/**
- * Constructs an <code>TransferFailureException</code> with a detail message.
+ * Constructs an <code>TransferFailureException</code> with a detail message.
*
* @param s the detail message.
*/
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;
/**
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);
}
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();
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();
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
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
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
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
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
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
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
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
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
/**
* Add a value to a variable of a link at a given timestamp.
- *
+ *
* @param time
* @param link
* @param variable
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
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
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
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
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
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
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
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
/**
* Set the user state to the given value.
* (the queue is totally flushed and reinitialized with the given state).
- *
+ *
* @param host The name of the host to be considered.
* @param state The name of the state previously declared.
* @param value The new value of the state.
public static final native void hostSetState (String host, String state, String value);
/**
- * Push a new value for a state of a given host.
- *
+ * Push a new value for a state of a given host.
+ *
* @param host The name of the host to be considered.
* @param state The name of the state previously declared.
* @param value The value to be pushed.
public static final native void hostPushState (String host, String state, String value);
/**
- * Pop the last value of a state of a given host.
- *
+ * 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
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
}
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)
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)
# 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")
# 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)
fd.write('#include <functional>\n')
fd.write('#include <simgrid/simix.hpp>\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<class R, class... T>
---- 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
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 *)
(* 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 *)
(* 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 *)
\/ ~ \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 *)
\/ Wait(p, comm_r)
\/ Test(p, comm_r, ret_r)
\/ Local(p)
-
+
Spec == Init /\ [][Next]_<<network,memory>>
-------------------------------
(* 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)
\/ (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
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
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.
-
+
___________________________________________________________________________________________
{
/* 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 ?
}
/*
static std::unordered_map<std::string, std::deque<std::string>*> 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)
{
#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<int>(private_sleep(static_cast<double>(tp->tv_sec + tp->tv_nsec / 1000000000.0)));
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);
}
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);
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);
}
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);
return MPI_ERR_ARG;
}
}
-
+
MPI_Aint extent = oldtype->get_extent();
int i;
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];
//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);
;;
*)
PROC_ARGS="${PROC_ARGS:+$PROC_ARGS }$1"
- shift
+ shift
;;
esac
done
HOSTFILETMP=1
HOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
perl -ne 'print "$1\n" if /.*<host.*?id="(.*?)".*?\/>.*/' ${PLATFORM} > ${HOSTFILE}
- perl -ne 'if (/.*<cluster.*?prefix="(.*?)".*?radical="(.*?)".*?suffix="(.*?)".*/) {
- my ($pre,$rad,$post)=($1,$2,$3);
- for my $elm (split(",",$rad)) {
- if ($elm=~/^([^-]*?)-([^-]*)$/) {
- for (my $i=$1; $i<=$2;$i++) {
- print "$pre$i$post\n";
+ perl -ne 'if (/.*<cluster.*?prefix="(.*?)".*?radical="(.*?)".*?suffix="(.*?)".*/) {
+ my ($pre,$rad,$post)=($1,$2,$3);
+ for my $elm (split(",",$rad)) {
+ if ($elm=~/^([^-]*?)-([^-]*)$/) {
+ for (my $i=$1; $i<=$2;$i++) {
+ print "$pre$i$post\n";
}
} else {
print "$pre$elm$post\n";
##----------------------------------------------------------
## generate application.xml with hostnames from hostfile:
-## the name of host_i (1<=i<=p, where -np p) is the line i in hostfile (where -hostfile hostfile), or "host$i" if
+## the name of host_i (1<=i<=p, where -np p) is the line i in hostfile (where -hostfile hostfile), or "host$i" if
## hostfile has less than i lines.
##----------------------------------------------------------
else
echo " <argument value=\"$(echo $hosttraces|cut -d' ' -f1)\"/>" >> ${APPLICATIONTMP}
fi
- else
+ else
echo ${XML_ARGS} >> ${APPLICATIONTMP}
fi
echo " </actor>" >> ${APPLICATIONTMP}
echo "Generated hostfile ${HOSTFILE} kept."
fi
if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then
- echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept."
+ echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept."
fi
fi
void update_remains_lazy(double now) override;
std::list<Cpu*> cpus();
-
+
void suspend() override;
void resume() override;
};
*/
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;
-<!--
+<!--
DTD of SimGrid platform and deployment files.
More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
that a <host>, <peer>, <cluster> or <cabinet> can deliver per second.
- In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
-
+
- In <host> and <link>, attributes availability and state are gone.
It was redundent with state and availability traces, and with peak values.
-
- - In <cluster>, cannot set the availability nor state traces.
+
+ - In <cluster>, cannot set the availability nor state traces.
This was too complex and unused.
- The DOCTYPE points to the right URL (this file):
http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
-
+
- Kill <gpu>. Was not doing anything.
- A warning is emitted for unit-less values (they are still accepted).
* New in DTD version 1 (in SimGrid 3.3):
- DTD is now versionned with the version attribute of platform
- - Unit change:
+ - Unit change:
- Link bandwidth: from Mb/s to b/s
- CPU speed: from MFlop/s to Flop/s
if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); 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
ETag_surfxml_ASroute();
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
FAIL("Premature EOF: `</peer>' expected.");
YY_BREAK
-/* <!--
- * DTD of SimGrid platform and deployment files.
- * More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
- * To upgrade your files, use the tool simgrid_update_xml
- * * Things that will change in upcoming version 5 (TODO):
- * - The following tags will be removed:
- * - <include> spits an error since v3.18
- * - <random> does nothing since a very long time
- * - <as>, <asroute>, <bypassZoneRoute> and <process>, deprecated in DTD4.1
- * - FULLDUPLEX sharing will be removed, deprecated in DTD4.2 (v3.19)
- * * New in DTD version 4.2 (in SimGrid 3.19): backward compatible change (v4 files are valid v4.2 files)
- * - SPLITDUPLEX is the new spelling of the deprecated FULLDUPLEX
- * * New in DTD version 4.1 (in SimGrid 3.16): backward compatible change (v4 files are valid v4.1 files)
- * - <zone> can be used as a synonym for the now deprecated <as>
- * - <zoneRoute> can be used as a synonym for the now deprecated <asroute>
- * - <bypassZoneRoute> an be used as a synonym for the now deprecated <bypassAsRoute>
- * - <actor> can be used as a synonym for the now deprecated <process>
- * * New in DTD version 4 (in SimGrid 3.13):
- * - Rename (power->speed) the attributes describing the amount of flop
- * that a <host>, <peer>, <cluster> or <cabinet> can deliver per second.
- * - In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
- *
- * - In <host> and <link>, attributes availability and state are gone.
- * It was redundent with state and availability traces, and with peak values.
- *
- * - In <cluster>, cannot set the availability nor state traces.
- * This was too complex and unused.
- * - The DOCTYPE points to the right URL (this file):
- * http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
- *
- * - Kill <gpu>. Was not doing anything.
- * - A warning is emitted for unit-less values (they are still accepted).
- * - speed. Default: 'f' or 'flops'. Also defined:
- * 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf'
- * 'yottaflops', 'zettaflops', 'exaflops', 'petaflops', 'teraflops', 'gigaflops', 'megaflops', 'kiloflops'
- * - bandwidth. Default: 'Bps' bytes per second
- * In bytes and powers of 2 (1 KiBps = 1024 Bps): 'EiBps', 'PiBps', 'TiBps', 'GiBps', 'MiBps', 'KiBps'
- * In bits and powers of 2 (1 Bps = 8 bps) : 'Eibps', 'Pibps', 'Tibps', 'Gibps', 'Mibps', 'Kibps'
- * In bytes and powers of 10 (1 KBps = 1000 Bps) : 'EBps', 'PBps', 'TBps', 'GBps', 'MBps', 'kBps', 'Bps'
- * In bits and powers of 10 : 'Ebps', 'Pbps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps'
- * (Exa and Peta notations were introduced in SimGrid v3.14)
- * - latency. Default: 's' second. Also defined:
- * 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond
- * * New in DTD version 3 (in SimGrid 3.5):
- * - The AS tag were introduced. Every platform should now
- * contain an englobing AS tag.
- * - Routes are now symmetric by default.
- * - Renamed tags (for sake of XML sanity):
- * - LINK:CTN -> LINK_CTN
- * - TRACE:CONNECT -> TRACE_CONNECT
- * * New in DTD version 2 (in SimGrid 3.4):
- * - Renamed tags:
- * - CPU -> HOST
- * - NETWORK_LINK -> LINK
- * - ROUTE_ELEMENT -> LINK:CTN (changed again in v3)
- * - PLATFORM_DESCRIPTION -> PLATFORM
- * * New in DTD version 1 (in SimGrid 3.3):
- * - DTD is now versionned with the version attribute of platform
- * - Unit change:
- * - Link bandwidth: from Mb/s to b/s
- * - CPU speed: from MFlop/s to Flop/s
- * --> */
+/* <!--
+ * DTD of SimGrid platform and deployment files.
+ * More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
+ * To upgrade your files, use the tool simgrid_update_xml
+ * * Things that will change in upcoming version 5 (TODO):
+ * - The following tags will be removed:
+ * - <include> spits an error since v3.18
+ * - <random> does nothing since a very long time
+ * - <as>, <asroute>, <bypassZoneRoute> and <process>, deprecated in DTD4.1
+ * - FULLDUPLEX sharing will be removed, deprecated in DTD4.2 (v3.19)
+ * * New in DTD version 4.2 (in SimGrid 3.19): backward compatible change (v4 files are valid v4.2 files)
+ * - SPLITDUPLEX is the new spelling of the deprecated FULLDUPLEX
+ * * New in DTD version 4.1 (in SimGrid 3.16): backward compatible change (v4 files are valid v4.1 files)
+ * - <zone> can be used as a synonym for the now deprecated <as>
+ * - <zoneRoute> can be used as a synonym for the now deprecated <asroute>
+ * - <bypassZoneRoute> an be used as a synonym for the now deprecated <bypassAsRoute>
+ * - <actor> can be used as a synonym for the now deprecated <process>
+ * * New in DTD version 4 (in SimGrid 3.13):
+ * - Rename (power->speed) the attributes describing the amount of flop
+ * that a <host>, <peer>, <cluster> or <cabinet> can deliver per second.
+ * - In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
+ * - In <host> and <link>, attributes availability and state are gone.
+ * It was redundent with state and availability traces, and with peak values.
+ * - In <cluster>, cannot set the availability nor state traces.
+ * This was too complex and unused.
+ * - The DOCTYPE points to the right URL (this file):
+ * http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
+ * - Kill <gpu>. Was not doing anything.
+ * - A warning is emitted for unit-less values (they are still accepted).
+ * - speed. Default: 'f' or 'flops'. Also defined:
+ * 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf'
+ * 'yottaflops', 'zettaflops', 'exaflops', 'petaflops', 'teraflops', 'gigaflops', 'megaflops', 'kiloflops'
+ * - bandwidth. Default: 'Bps' bytes per second
+ * In bytes and powers of 2 (1 KiBps = 1024 Bps): 'EiBps', 'PiBps', 'TiBps', 'GiBps', 'MiBps', 'KiBps'
+ * In bits and powers of 2 (1 Bps = 8 bps) : 'Eibps', 'Pibps', 'Tibps', 'Gibps', 'Mibps', 'Kibps'
+ * In bytes and powers of 10 (1 KBps = 1000 Bps) : 'EBps', 'PBps', 'TBps', 'GBps', 'MBps', 'kBps', 'Bps'
+ * In bits and powers of 10 : 'Ebps', 'Pbps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps'
+ * (Exa and Peta notations were introduced in SimGrid v3.14)
+ * - latency. Default: 's' second. Also defined:
+ * 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond
+ * * New in DTD version 3 (in SimGrid 3.5):
+ * - The AS tag were introduced. Every platform should now
+ * contain an englobing AS tag.
+ * - Routes are now symmetric by default.
+ * - Renamed tags (for sake of XML sanity):
+ * - LINK:CTN -> LINK_CTN
+ * - TRACE:CONNECT -> TRACE_CONNECT
+ * * New in DTD version 2 (in SimGrid 3.4):
+ * - Renamed tags:
+ * - CPU -> HOST
+ * - NETWORK_LINK -> LINK
+ * - ROUTE_ELEMENT -> LINK:CTN (changed again in v3)
+ * - PLATFORM_DESCRIPTION -> PLATFORM
+ * * New in DTD version 1 (in SimGrid 3.3):
+ * - DTD is now versionned with the version attribute of platform
+ * - Unit change:
+ * - Link bandwidth: from Mb/s to b/s
+ * - CPU speed: from MFlop/s to Flop/s
+ * --> */
case 401:
/* rule 401 can match eol */
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
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
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);
}
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);
}
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);
}
#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
#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. */
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;
#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.
*/
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.
* 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
/* 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 ...
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 );
#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)
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;
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,
extern YYSTYPE yylval;
-#line 548 "automaton_lexer.yy.c"
+#line 533 "automaton_lexer.yy.c"
#define INITIAL 0
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 );
/* 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
#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.
*/
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
{ 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
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];
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;
}
/* 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
*(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
*/
/* 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
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.
*
* @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;
}
* @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.
{
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;
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
*/
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)
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;
}
*/
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;
}
}
*/
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*));
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*));
{
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;
}
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
*
* @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.
#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. */
/** 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;
}
* 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
{
/* 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. */
{
int i;
- for ( i = 0; i < n; ++i )
+ for (i = 0; i < n; ++i)
s1[i] = s2[i];
}
#endif
static int yy_flex_strlen (yyconst char * s )
{
int n;
- for ( n = 0; s[n]; ++n )
+ for (n = 0; s[n]; ++n)
;
return n;
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 )
* 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"
#include <stdio.h>
#include "parserPromela.tab.hacc"
-
+
extern YYSTYPE yylval;
-
+
%}
blancs [ \t]+
{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} { }
. { }
%%
-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 :
| CASE_TRUE { $$ = new_label(4); }
| ID { $$ = new_label(3, $1); }
;
-
+
%%
{
this->content = std::move(value);
this->update();
+ this->unsetDefault();
}
void setDefaultValue(T value)
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);
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
@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});
@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.
}
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);
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))");
}
}
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)
<storage_type id="single_HDD" model="SSD" size="4kB">
<model_prop id="Bwrite" value="30MBps" />
<model_prop id="Bread" value="100MBps" />
- <model_prop id="Bconnection" value="150MBps" />
+ <model_prop id="Bconnection" value="150MBps" />
</storage_type>
<storage id="cdisk" typeId="single_HDD" attach="plouf" />
<link id="link1" bandwidth="125MBps" latency="50us"/>
<link id="link2" bandwidth="125MBps" latency="50us"/>
<link id="link3" bandwidth="125MBps" latency="50us"/>
- <link id="link4" bandwidth="125MBps" latency="50us"/>
+ <link id="link4" bandwidth="125MBps" latency="50us"/>
<route src="host1" dst="host2">
<link_ctn id="link1"/>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4.1">
<zone id="AS0" routing="Full">
- <host id="alice" speed="1Gf"/> <!-- connected to an in-file speed trace -->
+ <host id="alice" speed="1Gf"/> <!-- connected to an in-file speed trace -->
<host id="bob" speed="1Gf"/> <!-- connected to an out-file speed trace -->
<host id="carol" speed="500Mf" state_file="carol.fail"/> <!-- out-file state trace as attribute -->
<host id="dave" speed="1Gf">
<prop id="disk" value="80E9"/>
<prop id="OS" value="Linux 2.6.22-14"/>
</host>
- <host id="erin" speed="500Mf" availability_file="erin.avail"/> <!--uses someone else's trace -->
+ <host id="erin" speed="500Mf" availability_file="erin.avail"/> <!--uses someone else's trace -->
</zone>
<trace id="myTrace" periodicity="1.0">
<cluster id="bob_cluster" prefix="bob" suffix=".hamburger.edu" radical="0-1" speed="1Gf" bw="125MBps" lat="50us"
bb_bw="2.25GBps" bb_lat="500us"/>
<cluster id="alice_cluster" prefix="alice" suffix=".crepe.fr" radical="0-1" speed="1Gf" bw="125MBps" lat="50us"
- bb_bw="2.25GBps" bb_lat="500us"/>
+ bb_bw="2.25GBps" bb_lat="500us"/>
- <link id="backbone" bandwidth="1.25GBps" latency="500us"/>
+ <link id="backbone" bandwidth="1.25GBps" latency="500us"/>
- <zoneRoute src="bob_cluster" dst="alice_cluster" gw_src="bobbob_cluster_router.hamburger.edu"
+ <zoneRoute src="bob_cluster" dst="alice_cluster" gw_src="bobbob_cluster_router.hamburger.edu"
gw_dst="alicealice_cluster_router.crepe.fr">
<link_ctn id="backbone"/>
</zoneRoute>
<cluster id="bob_cluster_1" prefix="bob" suffix=".hamburger.edu" radical="2-3" speed="1Gf" bw="125MBps" lat="50us"
bb_bw="2.25GBps" bb_lat="500us"/>
- <link id="backbone" bandwidth="1.25GBps" latency="500us"/>
+ <link id="backbone" bandwidth="1.25GBps" latency="500us"/>
- <zoneRoute src="bob_cluster" dst="bob_cluster_1" gw_src="bobbob_cluster_router.hamburger.edu"
+ <zoneRoute src="bob_cluster" dst="bob_cluster_1" gw_src="bobbob_cluster_router.hamburger.edu"
gw_dst="bobbob_cluster_1_router.hamburger.edu">
<link_ctn id="backbone"/>
</zoneRoute>
<cluster id="bob_cluster" prefix="bob" suffix=".hamburger.edu" radical="0-4" speed="1Gf" bw="125MBps" lat="50us"
bb_bw="2.25GBps" bb_lat="500us" router_id="bob_cluster_router"/>
<cluster id="alice_cluster" prefix="alice" suffix=".crepe.fr" radical="0-4" speed="1Gf" bw="125MBps" lat="50us"
- bb_bw="2.25GBps" bb_lat="500us" router_id="alice_cluster_router"/>
+ bb_bw="2.25GBps" bb_lat="500us" router_id="alice_cluster_router"/>
- <link id="backbone" bandwidth="1.25GBps" latency="500us"/>
+ <link id="backbone" bandwidth="1.25GBps" latency="500us"/>
<zoneRoute src="bob_cluster" dst="alice_cluster" gw_src="bob_cluster_router" gw_dst="alice_cluster_router">
<link_ctn id="backbone"/>
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)
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()
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()
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()
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
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
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
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})
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;
}
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;
my($tree,$cat_list)=@_;
my($root) = shift @$tree;
my($u);
-
+
push @$cat_list,$root;
foreach $u (@$tree) {
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}";
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);
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],
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],
$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;
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;
# 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);
}
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 ();
set(PATTERN_CTEST_IGNORED "")
if(enable_coverage)
- set(PATTERN_CTEST_IGNORED
+ set(PATTERN_CTEST_IGNORED
"/tools/"
"/buildtools/"
"/include/"
"/src/bindings/"
)
if(NOT release)
- set(PATTERN_CTEST_IGNORED
+ set(PATTERN_CTEST_IGNORED
${PATTERN_CTEST_IGNORED}
"/examples/"
)
teshsuite/lua/lua_platforms.tesh
examples/smpi/mc/only_send_deterministic.tesh
examples/smpi/mc/non_deterministic.tesh
-
+
examples/java/.classpath
examples/java/.project
)
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
src/kernel/routing/TorusZone.cpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/VivaldiZone.cpp
-
+
src/kernel/EngineImpl.cpp
src/kernel/EngineImpl.hpp
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
src/kernel/activity/SynchroIo.hpp
src/kernel/activity/SynchroRaw.cpp
src/kernel/activity/SynchroRaw.hpp
-
+
${SIMIX_GENERATED_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
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
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
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
${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})
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
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
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
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
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}")
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
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
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)
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)
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 )
##
## 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
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")
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()
# 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 "")
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")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
- endif()
+ endif()
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()
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}
)
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})
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"
)
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/.")
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")
#
# Search for the header file
-#
+#
find_path(PATH_LIBUNWIND_H "libunwind.h"
HINTS
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)
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
#
# Conclude and cleanup
-#
+#
if(HAVE_LIBUNWIND)
message(STATUS "Dependencies induced by libunwind: ${LIBUNWIND_LIBRARIES}")
else()
# 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:
/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")
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)
# 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()
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}")
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}")
TARGET unit_tmgr
APPEND PROPERTY
INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}"
- )
-
-
+ )
+
+
else()
set(EXTRA_DIST ${EXTRA_DIST} src/surf/trace_mgr_test.cpp)
endif()
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()
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)
TARGET testall
APPEND PROPERTY
INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}"
- )
+ )
/* 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. */
while($line=<STDIN>) {
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/<IMG/<IMG style=border:0px/g'
# -l -- only filenames, nothing else
# $1 -- argument to this script, name of the routing model (e.g., "Floyd")
# . -- search in the examples folder and search EVERYTHING
-# --include -- but only include results that end in ".xml"
+# --include -- but only include results that end in ".xml"
grep -R -l "$1" examples/ --include "*.xml"
exit 0
# Search for calls to macros defining new channels, and prepare the tree representation
my %ancestor;
my %desc;
-# $ancestor{"toto"} is the ancestor of the toto channel as declared by XBT_LOG_NEW_SUBCATEGORY and
+# $ancestor{"toto"} is the ancestor of the toto channel as declared by XBT_LOG_NEW_SUBCATEGORY and
# XBT_LOG_NEW_DEFAULT_SUBCATEGORY ie, when the channel toto is initialized (does not work under windows)
# $desc{"toto"} is its description
$data =~ s/([^"]*"[^"]*")\)//s || die "unparsable macro: $data";
my ($name,$anc,$desc) = cleanup_ctn($1);
-
+
# build the tree, checking for name conflict
die "ERROR: Category name conflict: $name used several times (in $ancestor{$name} and $anc, last time in $filename)\n"
if defined ($ancestor{$name}) && $ancestor{$name} ne $anc && defined ($desc{$name}) && $desc{$name} ne $desc;
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";
#!/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
fi
}
-colordiff=$(type -p colordiff || true)
+colordiff=$(type -p colordiff || true)
colorless() {
if [ -x "$colordiff" ]; then
"$colordiff" | less -R -F -X
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.
open(PIN, "ispell -d american -p $DICTFILE -l < $TEMPFILE | sort -uf |") || die;
my @badwords;
while (my $err = <PIN>) {
- 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);
}
}
#!/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
# 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
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
cat "$tmp_head" "$tmp_copy" "$tmp_foot" > $file
else
echo "Pass: there is no SimGrid Copyright header."
- fi ; #
+ fi ; #
done
cat <<EOF
for pkg in xsltproc gcovr ant cover2cover.py
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
for pkg in valgrind pcregrep
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
#set html description and write it in a file
echo "
-Testing with valgrind and gcov. Click on the graphs for details.
+Testing with valgrind and gcov. Click on the graphs for details.
<br><br>
-<table id=\"configuration-matrix\">
- <tr class=\"matrix-row\">
+<table id=\"configuration-matrix\">
+ <tr class=\"matrix-row\">
<td class=\"matrix-header\">
Valgrind Results
</td>
Test Results
</td>
</tr>
- <tr class=\"matrix-row\">
+ <tr class=\"matrix-row\">
<td class=\"matrix-cell\">
<a href=\"https://ci.inria.fr/simgrid/job/SimGrid-DynamicAnalysis-Valgrind/label=simgrid-debian8-64-dynamic-analysis/valgrindResult/\">
<img src=\"https://ci.inria.fr/simgrid/job/SimGrid-DynamicAnalysis/lastCompletedBuild/label=simgrid-debian8-64-dynamic-analysis/artifact/valgrind_graph.png\" title=\"$VALGRIND_RES\">
</a>
</td>
</tr>
- <tr class=\"matrix-row\">
+ <tr class=\"matrix-row\">
<td class=\"matrix-header\">
Sloccount Results
</td>
Test Results : Address Sanitizer (<a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\">info</a>)
</td>
</tr>
- <tr class=\"matrix-row\">
+ <tr class=\"matrix-row\">
<td class=\"matrix-cell\">
<a href=\"https://ci.inria.fr/simgrid/job/SimGrid-DynamicAnalysis-Coverage/label=simgrid-debian8-64-dynamic-analysis/sloccountResult\">
<img src=\"https://ci.inria.fr/simgrid/job/SimGrid-DynamicAnalysis-Coverage/label=simgrid-debian8-64-dynamic-analysis/sloccountResult/trend\">
</a>
</td>
</tr>
- <tr class=\"matrix-row\">
+ <tr class=\"matrix-row\">
<td class=\"matrix-header\">
Test Results : Thread Sanitizer (<a href=\"https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual\">info</a>)
</td>
Test Results : Undefined Sanitizer (<a href=\"http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html\">info</a>)
</td>
</tr>
- <tr class=\"matrix-row\">
+ <tr class=\"matrix-row\">
<td class=\"matrix-cell\">
<a href=\"https://ci.inria.fr/simgrid/view/Tous/job/SimGrid-DynamicAnalysis-Sanitizers/label=simgrid-debian8-64-dynamic-analysis-2/lastCompletedBuild/testReport/ThreadSanitizer/junit/\">
<img src=\"https://ci.inria.fr/simgrid/view/Tous/job/SimGrid-DynamicAnalysis-Sanitizers/label=simgrid-debian8-64-dynamic-analysis-2/groupedTests/trendGraph/ThreadSanitizer/png?width=500&height=250\">
#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} \
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
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
</taskdef>
<jacoco:report>
-
+
<executiondata>
<file file="${builddir}/jacoco.exec"/>
</executiondata>
-
+
<structure name="Example Project">
<classfiles>
<fileset dir="${builddir}"/>
<fileset dir="${examplesrcdir}"/>
</sourcefiles>
</structure>
-
+
<xml destfile="${builddir}/report.xml"/>
-
+
</jacoco:report>
</project>
+++ 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
+++ 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 \
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)
+
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
+
use Getopt::Long qw(GetOptions);
my $progname="sg_unit_extractor";
-# Get the args
+# Get the args
sub usage($) {
my $ret;
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;
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;
}
die "$progname: no suite defined in $infile\n" unless (length($suite_name));
-
+
# Write the test
my ($GENERATED)=("/*******************************/\n".
# print OUT "# 93 \"sg_unit_extractor.pl\"\n";
print OUT <<EOF;
int main(int argc, char *argv[]) {
- xbt_test_suite_t suite;
+ xbt_test_suite_t suite;
char selection[STRLEN];
int verbosity = 0;
int i;
/* SGU: BEGIN SUITES DECLARATION */
/* SGU: END SUITES DECLARATION */
-
+
xbt_init(&argc,argv);
-
+
/* Search for the tests to do */
selection[0]='\\0';
for (i=1;i<argc;i++) {
}
}
/* Got all my tests to do */
-
+
res = xbt_test_run(selection, verbosity);
xbt_test_exit();
return res;
last if (/SGU: END PROTOTYPES/ || /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 (<IN>) {
last if /SGU: END FILE/;
}
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 (<IN>) {
$newmain .= $_ unless /SGU: END PROTOTYPES/;
last if /SGU: BEGIN SUITES DECLARATION/;
}
-
+
### Done with prototypes. And now, the actual code
-
+
# search my prototype
while (<IN>) {
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 (<IN>) {
last if /SGU: END FILE/;
}
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 (<IN>) {
$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;
}
{
- ignore unwind cruft
+ ignore unwind cruft
Memcheck:Param
rt_sigprocmask(set)
...
...
}
{
- 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
}
=head1 NAME
simgrid_update_xml - updates simgrid XML files to latest version
-
+
=head1 SYNOPSIS
B<simgrid_update_xml> I<xml_file>
-
+
=head1 DESCRIPTION
simgrid_update_xml updates the simgrid XML file passed as argument. The file
=over 4
-=item
+=item
The version attribute of platform were added to allow file versioning.
=item B<Version 2:> 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
The AS tag were introduced. Every platform should now contain an englobing AS
tag.
-=item
+=item
Routes are now symmetric by default.
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
=item
Rename the FULLDUPLEX sharing into SPLITDUPLEX.
-
+
=back
=back
=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
# 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/<!DOCTYPE[^>]*>// && ! $line =~ /\S/);
-
+
if ($line =~ s/<platform(_description)? *>//) {
$fromversion = 0;
print "$filename was using version 0\n";
next if !$line =~ /\S/;
print "$filename was using version $fromversion\n";
}
-
+
if ($fromversion == 0) {
while ($line =~ m|^(.*?)<cpu(.*?)power="([^"]*)"(.*)$|) {
$line = "$1TOTOTUTUTATA${2}TOTOTUTUTATA".($3*1000000)."TOTOTUTUTATA${4}";
$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;
#!/usr/bin/env perl
# Copyright 2016 Vincent Danjean <vincent.danjean@inria.fr>
# Christian Heinrich <franz-christian.heinrich@inria.fr>
-#
+#
# 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
# with MPI+TAU).
use strict;
use warnings;
-use Getopt::Std;
+use Getopt::Std;
my %options=();
getopts("fc", \%options);
}
$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) {
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.
! output ignore
$ cmake -E remove bgtesh.pl bgtesh.data
-< use strict;
+< use strict;
< sleep(1);
< open (FILE, "<bgtesh.data") || die "Cannot open bgtesh.data: $!\n";
-<
+<
< while (<FILE>) {
< print;
< }
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
< $ cat
< > 123456789012345678 A line
< > 123456789012345678 B line
-$ ${bindir:=.}/tesh
+$ ${bindir:=.}/tesh
p Check user-defined prefix length for "output sort"
! output sort 5