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
attempt to remove oudated coccinelle stuff
[simgrid.git]
/
src
/
smpi
/
smpi_mpi_dt.c
diff --git
a/src/smpi/smpi_mpi_dt.c
b/src/smpi/smpi_mpi_dt.c
index
8746df9
..
bb63c6b
100644
(file)
--- a/
src/smpi/smpi_mpi_dt.c
+++ b/
src/smpi/smpi_mpi_dt.c
@@
-1,7
+1,7
@@
/* smpi_mpi_dt.c -- MPI primitives to handle datatypes */
/* FIXME: a very incomplete implementation */
/* smpi_mpi_dt.c -- MPI primitives to handle datatypes */
/* FIXME: a very incomplete implementation */
-/* Copyright (c) 2009-201
4
. The SimGrid Team.
+/* Copyright (c) 2009-201
5
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-35,7
+35,7
@@
int type_keyval_id=0;//avoid collisions
NULL, /* pointer on extended struct*/ \
0 /* in_use counter */ \
}; \
NULL, /* pointer on extended struct*/ \
0 /* in_use counter */ \
}; \
-MPI_Datatype name = &mpi_##name;
+
const
MPI_Datatype name = &mpi_##name;
#define CREATE_MPI_DATATYPE_NULL(name) \
static s_smpi_mpi_datatype_t mpi_##name = { \
#define CREATE_MPI_DATATYPE_NULL(name) \
static s_smpi_mpi_datatype_t mpi_##name = { \
@@
-49,7
+49,7
@@
MPI_Datatype name = &mpi_##name;
NULL, /* pointer on extended struct*/ \
0 /* in_use counter */ \
}; \
NULL, /* pointer on extended struct*/ \
0 /* in_use counter */ \
}; \
-MPI_Datatype name = &mpi_##name;
+
const
MPI_Datatype name = &mpi_##name;
//The following are datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC.
typedef struct {
//The following are datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC.
typedef struct {
@@
-187,7
+187,7
@@
int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t)
memcpy((*new_t)->substruct, datatype->substruct, sizeof(s_smpi_mpi_struct_t));
}
if(datatype->name)
memcpy((*new_t)->substruct, datatype->substruct, sizeof(s_smpi_mpi_struct_t));
}
if(datatype->name)
- (*new_t)->name = strdup(datatype->name);
+ (*new_t)->name =
xbt_
strdup(datatype->name);
if(datatype->attributes !=NULL){
(*new_t)->attributes=xbt_dict_new();
xbt_dict_cursor_t cursor = NULL;
if(datatype->attributes !=NULL){
(*new_t)->attributes=xbt_dict_new();
xbt_dict_cursor_t cursor = NULL;
@@
-237,7
+237,7
@@
void smpi_datatype_get_name(MPI_Datatype datatype, char* name, int* length){
}
void smpi_datatype_set_name(MPI_Datatype datatype, char* name){
}
void smpi_datatype_set_name(MPI_Datatype datatype, char* name){
- datatype->name = strdup(name);;
+ datatype->name =
xbt_
strdup(name);;
}
int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
@@
-406,6
+406,7
@@
void smpi_datatype_create(MPI_Datatype* new_type, int size,int lb, int ub, int h
}
void smpi_datatype_free(MPI_Datatype* type){
}
void smpi_datatype_free(MPI_Datatype* type){
+ xbt_assert((*type)->in_use >= 0);
if((*type)->attributes !=NULL){
xbt_dict_cursor_t cursor = NULL;
int* key;
if((*type)->attributes !=NULL){
xbt_dict_cursor_t cursor = NULL;
int* key;
@@
-1778,4
+1779,3
@@
int smpi_mpi_unpack(void* inbuf, int insize, int* position, void* outbuf, int ou
*position += outcount * size;
return MPI_SUCCESS;
}
*position += outcount * size;
return MPI_SUCCESS;
}
-