A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
send test program
[simgrid.git]
/
src
/
smpi
/
smpi_bench.c
diff --git
a/src/smpi/smpi_bench.c
b/src/smpi/smpi_bench.c
index
88c0aa6
..
3633815
100644
(file)
--- a/
src/smpi/smpi_bench.c
+++ b/
src/smpi/smpi_bench.c
@@
-91,7
+91,7
@@
static void* shm_map(int fd, size_t size, shared_data_t* data) {
xbt_die("Could not truncate fd %d to %zu: %s", fd, size, strerror(errno));
}
}
xbt_die("Could not truncate fd %d to %zu: %s", fd, size, strerror(errno));
}
}
- mem = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_
PRIVATE
, fd, 0);
+ mem = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_
SHARED
, fd, 0);
if(mem == MAP_FAILED) {
xbt_die("Could not map fd %d: %s", fd, strerror(errno));
}
if(mem == MAP_FAILED) {
xbt_die("Could not map fd %d: %s", fd, strerror(errno));
}
@@
-171,18
+171,22
@@
void smpi_bench_end(void)
unsigned int smpi_sleep(unsigned int secs)
{
unsigned int smpi_sleep(unsigned int secs)
{
+ smpi_bench_end();
smpi_execute((double) secs);
smpi_execute((double) secs);
+ smpi_bench_begin();
return secs;
}
int smpi_gettimeofday(struct timeval *tv, struct timezone *tz)
{
return secs;
}
int smpi_gettimeofday(struct timeval *tv, struct timezone *tz)
{
- double now = SIMIX_get_clock();
-
+ double now;
+ smpi_bench_end();
+ now = SIMIX_get_clock();
if (tv) {
if (tv) {
- tv->tv_sec = (time_t)
now;
- tv->tv_usec = (suseconds_t)
(now
* 1e6);
+ tv->tv_sec = (time_t)now;
+ tv->tv_usec = (suseconds_t)
((now - tv->tv_sec)
* 1e6);
}
}
+ smpi_bench_begin();
return 0;
}
return 0;
}
@@
-368,7
+372,8
@@
int smpi_shared_known_call(const char* func, const char* input) {
TRY {
xbt_dict_get(calls, loc); /* Succeed or throw */
known = 1;
TRY {
xbt_dict_get(calls, loc); /* Succeed or throw */
known = 1;
- } CATCH(ex) {
+ }
+ CATCH(ex) {
if(ex.category == not_found_error) {
known = 0;
xbt_ex_free(ex);
if(ex.category == not_found_error) {
known = 0;
xbt_ex_free(ex);