Fixes test-smpi-mpich3-attr-raw.
integer MPI_MAX_DATAREP_STRIN, MPI_MAX_INFO_KEY
integer MPI_MAX_INFO_VAL, MPI_MAX_OBJECT_NAME, MPI_MAX_PORT_NAME
integer MPI_ANY_SOURCE, MPI_PROC_NULL, MPI_ANY_TAG, MPI_UNDEFINED
- integer MPI_TAG_UB, MPI_TAG_LB
integer MPI_SOURCE, MPI_TAG, MPI_ERROR
integer MPI_VERSION, MPI_SUBVERSION
parameter(MPI_MAX_PROCESSOR_NAME=100)
parameter(MPI_SOURCE=1)
parameter(MPI_TAG=2)
parameter(MPI_ERROR=3)
- parameter(MPI_TAG_UB=0)
- parameter(MPI_TAG_LB=0)
parameter(MPI_VERSION=1)
parameter(MPI_SUBVERSION=1)
integer MPI_MODE_NOSTORE, MPI_MODE_NOPUT, MPI_MODE_NOPRECEDE
integer MPI_ERR_REQUEST, MPI_ERR_INTERN, MPI_ERR_COUNT
integer MPI_ERR_RANK, MPI_ERR_OTHER, MPI_ERR_UNKNOWN
integer MPI_ERR_TAG, MPI_ERR_TRUNCATE, MPI_ERR_GROUP, MPI_ERR_OP
- integer MPI_LASTUSEDCODE, MPI_ERR_LASTCODE
+ integer MPI_ERR_LASTCODE
integer MPI_IDENT, MPI_SIMILAR, MPI_UNEQUAL, MPI_CONGRUENT
- integer MPI_WTIME_IS_GLOBAL
parameter(MPI_SUCCESS=0)
parameter(MPI_ERR_COMM=1)
parameter(MPI_ERR_ARG=2)
parameter(MPI_ERR_OP=11)
parameter(MPI_ERR_OTHER=12)
parameter(MPI_ERR_UNKNOWN=13)
- parameter(MPI_LASTUSEDCODE=0)
parameter(MPI_ERR_LASTCODE=74)
parameter(MPI_IDENT=0)
parameter(MPI_SIMILAR=1)
parameter(MPI_UNEQUAL=2)
parameter(MPI_CONGRUENT=3)
- parameter(MPI_WTIME_IS_GLOBAL=1)
+
integer MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN
parameter(MPI_NULL_COPY_FN =0)
integer MPI_COMM_NULL_DUP_FN, MPI_COMM_DUP_FN
parameter(MPI_COMM_NULL_DUP_FN =0)
parameter(MPI_COMM_DUP_FN =0)
- integer MPI_APPNUM, MPI_HOST, MPI_IO
- parameter(MPI_APPNUM=0)
- parameter(MPI_HOST=0)
- parameter(MPI_IO=0)
+
+
+
integer MPI_ROOT, MPI_INFO_NULL,MPI_COMM_TYPE_SHARED
parameter(MPI_ROOT=0)
parameter(MPI_INFO_NULL=0)
parameter(MPI_COMM_TYPE_SHARED=1)
+! Attribute keys
+ integer MPI_IO, MPI_HOST, MPI_WTIME_IS_GLOBAL, MPI_APPNUM
+ integer MPI_TAG_UB, MPI_TAG_LB
+ integer MPI_UNIVERSE_SIZE, MPI_LASTUSEDCODE
+ parameter(MPI_IO=-1)
+ parameter(MPI_HOST=-2)
+ parameter(MPI_WTIME_IS_GLOBAL=-3)
+ parameter(MPI_APPNUM=-4)
+ parameter(MPI_TAG_UB=-5)
+ parameter(MPI_TAG_LB=-6)
+ parameter(MPI_UNIVERSE_SIZE=-7)
+ parameter(MPI_LASTUSEDCODE=-8)
+
! These should be ordered as in smpi_f77.c
integer MPI_COMM_NULL, MPI_COMM_WORLD, MPI_COMM_SELF
- integer MPI_UNIVERSE_SIZE
parameter(MPI_COMM_NULL=-1)
parameter(MPI_COMM_SELF=-2)
parameter(MPI_COMM_WORLD=0)
- parameter(MPI_UNIVERSE_SIZE=0)
-
integer MPI_GROUP_NULL, MPI_GROUP_EMPTY
parameter(MPI_GROUP_NULL=-1)
#define MPI_SIMILAR 1
#define MPI_UNEQUAL 2
#define MPI_CONGRUENT 3
-#define MPI_WTIME_IS_GLOBAL 1
-#define MPI_TAG_UB 1000000
-#define MPI_HOST 0
-#define MPI_IO 0
+
+
#define MPI_BSEND_OVERHEAD 0
+/* Attribute keys */
+#define MPI_IO -1
+#define MPI_HOST -2
+#define MPI_WTIME_IS_GLOBAL -3
+#define MPI_APPNUM -4
+#define MPI_TAG_UB -5
+#define MPI_TAG_LB -6
+#define MPI_UNIVERSE_SIZE -7
+#define MPI_LASTUSEDCODE -8
#define MPI_MODE_NOSTORE 0x1
#define MPI_MODE_NOPUT 0x2
#define MPI_MODE_NOSUCCEED 0x8
#define MPI_MODE_NOCHECK 0x10
-
#define MPI_KEYVAL_INVALID 0
#define MPI_NULL_COPY_FN NULL
#define MPI_NULL_DELETE_FN NULL
-#define MPI_APPNUM 0
-#define MPI_LASTUSEDCODE MPI_SUCCESS
#define MPI_ERR_LASTCODE 74
#define MPI_CXX_BOOL MPI_DATATYPE_NULL
#define MPI_COMM_NULL ((MPI_Comm)NULL)
XBT_PUBLIC_DATA( MPI_Comm ) MPI_COMM_WORLD;
-XBT_PUBLIC_DATA( int ) MPI_UNIVERSE_SIZE;
#define MPI_COMM_SELF smpi_process_comm_self()
struct s_smpi_mpi_request;
extern smpi_privatisation_region_t smpi_privatisation_regions;
extern int smpi_loaded_page;
+extern int smpi_universe_size;
int SIMIX_process_get_PID(smx_process_t self);
"Logging specific to SMPI (comm)");
xbt_dict_t smpi_comm_keyvals = NULL;
-int comm_keyval_id=MPI_TAG_UB+1;//avoid collisions
+int comm_keyval_id = 0;//avoid collisions
/* Support for cartesian topology was added, but there are 2 other types of
* topology, graph et dist graph. In order to support them, we have to add a
xbt_free(elem);
return MPI_SUCCESS;
}
-
static smpi_process_data_t *process_data = NULL;
int process_count = 0;
+int smpi_universe_size = 0;
int* index_to_process_data = NULL;
extern double smpi_total_benched_time;
xbt_os_timer_t global_timer;
MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED;
-int MPI_UNIVERSE_SIZE;
MPI_Errhandler *MPI_ERRORS_RETURN = NULL;
MPI_Errhandler *MPI_ERRORS_ARE_FATAL = NULL;
process_count = SIMIX_process_count();
smpirun=1;
}
+ smpi_universe_size = process_count;
process_data = xbt_new0(smpi_process_data_t, process_count);
for (i = 0; i < process_count; i++) {
process_data[i] = xbt_new(s_smpi_process_data_t, 1);
if(smpirun){
group = smpi_group_new(process_count);
MPI_COMM_WORLD = smpi_comm_new(group, NULL);
+ MPI_Attr_put(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, (void *)(MPI_Aint)process_count);
xbt_bar_t bar=xbt_barrier_init(process_count);
- MPI_UNIVERSE_SIZE = smpi_comm_size(MPI_COMM_WORLD);
for (i = 0; i < process_count; i++) {
smpi_group_set_mapping(group, i, i);
process_data[i]->finalization_barrier = bar;
}
int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
+ static int one = 1;
+ static int zero = 0;
+ static int tag_ub = 1000000;
+ static int last_used_code = MPI_ERR_LASTCODE;
+
if (comm==MPI_COMM_NULL){
- *flag=0;
+ *flag = 0;
return MPI_ERR_COMM;
- } else if(keyval == MPI_TAG_UB||keyval == MPI_HOST||keyval == MPI_IO
- ||keyval == MPI_WTIME_IS_GLOBAL||keyval == MPI_APPNUM
- ||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE){
+ }
+
+ switch (keyval) {
+ case MPI_HOST:
+ case MPI_IO:
+ case MPI_APPNUM:
+ *flag = 1;
+ *(int**)attr_value = &zero;
+ return MPI_SUCCESS;
+
+ case MPI_UNIVERSE_SIZE:
+ *flag = 1;
+ *(int**)attr_value = &smpi_universe_size;
+ return MPI_SUCCESS;
+
+ case MPI_LASTUSEDCODE:
+ *flag = 1;
+ *(int**)attr_value = &last_used_code;
+ return MPI_SUCCESS;
+
+ case MPI_TAG_UB:
*flag=1;
- //FIXME : not ideal and leaky, but should not be called too much
- int* res = xbt_new(int, 1);
- *res=keyval;
- *(int**)attr_value=res;
+ *(int**)attr_value = &tag_ub;
+ return MPI_SUCCESS;
+
+ case MPI_WTIME_IS_GLOBAL:
+ *flag = 1;
+ *(int**)attr_value = &one;
return MPI_SUCCESS;
- } else
- return smpi_comm_attr_get(comm, keyval, attr_value, flag);
+
+ default:
+ return smpi_comm_attr_get(comm, keyval, attr_value, flag);
+ }
}
int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
int PMPI_Win_unlock(int rank, MPI_Win win){
NOT_YET_IMPLEMENTED
}
-