cherierm [Tue, 6 Nov 2007 12:38:11 +0000 (12:38 +0000)]
This change allow to avoid the Visual C++ compiler Warning that occur when you try to compare an signed integer with a signed integer (xbt_dynar_length() function returns an unsigned long and the iterators or the indexes are generally integers).
cherierm [Tue, 6 Nov 2007 12:30:06 +0000 (12:30 +0000)]
This change avoid the redefinitions of log categories. To do this, the parent category of a subcategory must be declared extern instead
public data (see the definition of the macro XBT_LOG_NEW_SUBCATEGORY). An other change corrects the definition of the macro
XBT_LOG_NEW_ROOT_SUBCATEGORY. Indeed, Ansi C (Visual C++ compiler standard language) doesn't allow to initialize a structure during
its declaration with non constant values.
mquinson [Wed, 31 Oct 2007 17:51:35 +0000 (17:51 +0000)]
Update the platform files: the root tag is now called 'platform', not 'platform_description'. Everyone knows that XML is a descriptive language, right?
mquinson [Sat, 27 Oct 2007 15:02:13 +0000 (15:02 +0000)]
Ooops. When restarting the logging action with dynamic buffer because we overflowed the static one, use the copy of the vaargs, not the original ones (which were already used by static action)
mquinson [Sat, 27 Oct 2007 11:43:08 +0000 (11:43 +0000)]
Fixup the bypassing example: pretend we've found v2 XML, and split the bypassing function in two (one for the platform and one for the application) to make sure that the platform isn't declared twice (once in MSG_create_environment and once in MSG_launch_application) since it fools things
mquinson [Sat, 27 Oct 2007 11:06:55 +0000 (11:06 +0000)]
Avoid segfault when trying to retrieve the name of the current thread while being in the maestro before initialization (where SIMIX_process_self returns NULL)
mquinson [Sat, 27 Oct 2007 09:44:36 +0000 (09:44 +0000)]
Better Java philosophy: create a new type of tasks to mean terminaison instead of relying of some magic value of the classical computation task (plus reduce the verbosity of the slaves)
mquinson [Sat, 27 Oct 2007 09:07:26 +0000 (09:07 +0000)]
Factorize the current_property_set symbol of simix (for process properties) and surf (for host and link properties); mark it 'extern' in include/surf/surf.h, and declare it strongly (ie, initialize it) in surf/surfxml_parse.c so that the poor macosx linker don't get fooled
mquinson [Sat, 27 Oct 2007 08:24:36 +0000 (08:24 +0000)]
Kill the useless _MSG_process_create_with_env_from_SIMIX(). _MSG_process_create_from_SIMIX() is part of the private API of MSG (I mean internal to the lib), so it can be changed without pissing of users
mquinson [Sat, 27 Oct 2007 07:34:39 +0000 (07:34 +0000)]
I think I now better understand the surf internals: each resource can be *either* a cpu or a link, so we can merge all the get_??_properties into only one method. No object will need both of them. This could be further improved by moving this to a function in surf directly instead of leaving this in models, but it would be the first attribute being handled that way, so I prefer keeping the pseudo object philosophy in place in surf
quasar [Fri, 26 Oct 2007 16:45:56 +0000 (16:45 +0000)]
* Cleanup the DTD by renaming:
<cpu> to <host>
<network_link> to <link>
<route_element> to <link:ctn>
"name" attributes to "id"
* Modify the DTD to add properties to <process>, <host> and <link>
In the DTD, these are <prop name=... value=...> subtags, and this
can be retrieved as a xbt_dict from the source code (see below)
* Add the following functions to the user API to retrieve (as
xbt_dict) the properties defined in XML:
xbt_dict_t SD_link_get_properties(SD_link_t link);
const char* SD_link_get_property_value(SD_link_t l,char* name);
and, on the same model,
SD_workstation_get_{properties,property_value}()
MSG_process_get_{properties,property_value}()
MSG_host_get_{properties,property_value}()
gras_process_get_{properties,property_value}()
gras_os_host_get_{properties,property_value}()
* Modify the parser to work in one pass only.
Some more work may be done so that surf does the parsing after the
models have declared the callbacks.
* Enforce the order in the DTD: routes must come after the last CPU,
router and link
cherierm [Fri, 26 Oct 2007 08:56:35 +0000 (08:56 +0000)]
This change the semantic of the timed function. The behavior depends now of the value of the parameters delay or timeout. If these parameters are negative, the timed function have the behavior of a blocking function. For example the following call : xbt_os_mutex_timedacquire(mutex,-1) is equivalent to xbt_os_mutex_acquire(mutex). If you set these parameters to zero
the timed function have the behavior of a try function. For example, to try to lock a mutex you must call the xbt_os_mutex_timedacquire() function with the parameter delay/timeout set to zero.
Finally, if you specify a delay more than zero, the timed function try to acquire the lock until the delay was expired, which is the normal behavior of the function.
Remark : the changes of the other files are the consequence of this new semantic : because the timed functions also implement the behavior of the try functions, theirs declarations and theirs definitions are removed.
cherierm [Thu, 25 Oct 2007 11:57:20 +0000 (11:57 +0000)]
Most of this change is the consequence of the refactoring of the name of the function connected to the mutex object and of the unsupported semaphore function on MAC OS X.
The file synchro.h rename the functions xbt_mutex_acquire() and xbt_mutex_release() to xbt_mutex_acquire() an respectively xbt_mutex_release().
This file also contains the declaration of two new functions xbt_mutex_tryacquire() and xbt_mutex_timedacquire(). The first
is the non blocking version of the function xbt_mutex_acquire() (if the lock is already owned by an other thread the function immediately
returns). The second function xbt_mutex_timedacquire() attempts to get the mutex during a specified delay (timeout), if the lock is not available
during this delay the function returns (throws a timeout exception). These functions (for the real life) are defined in the file xbt_rl_synchro.c and (for the simulation) in the file xbt_sg_synchro.c.
The header xbt_os_thread.h declare two new functions xbt_os_mutex_tryacquire() and xbt_os_mutex_timedaquire(). These functions represent
the implementation of the xbt_mutex_tryacquire() and xbt_mutex_timeacquire() for the real live.
These functions are implemented in the source code file xbt_os_thread.c.
The change in the files dynar.c and xbt_queue.c, philosopher.c and parallel_log_crashtest.c is the consequence of the refactoring of the functions previously described.
cherierm [Thu, 25 Oct 2007 11:55:34 +0000 (11:55 +0000)]
The configuration file visualc.h is change to declare the _WIN32_WINNT macro before the inclusion of the windows.h header (this permits to use the TryEnterCriticalSection() only available if the previous macro is more or equals to 0x400).