#define MPI_THREAD_MULTIPLE 3
//FIXME: check values
#define MPI_MAX_PROCESSOR_NAME 100
+#define MPI_MAX_NAME_STRING 100
#define MPI_MAX_ERROR_STRING 100
#define MPI_MAX_DATAREP_STRIN 100
#define MPI_MAX_INFO_KEY 100
MPI_CALL(XBT_PUBLIC(int), MPI_Comm_rank, (MPI_Comm comm, int *rank));
MPI_CALL(XBT_PUBLIC(int), MPI_Comm_size, (MPI_Comm comm, int *size));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_name, (MPI_Comm comm, char* name, int* len));
MPI_CALL(XBT_PUBLIC(int), MPI_Get_processor_name, (char *name, int *resultlen));
MPI_CALL(XBT_PUBLIC(int), MPI_Get_count,
(MPI_Status * status, MPI_Datatype datatype,
void smpi_comm_destroy(MPI_Comm comm);
MPI_Group smpi_comm_group(MPI_Comm comm);
int smpi_comm_size(MPI_Comm comm);
+void smpi_comm_get_name(MPI_Comm comm, char* name, int* len);
int smpi_comm_rank(MPI_Comm comm);
MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key);
return smpi_group_rank(smpi_comm_group(comm), smpi_process_index());
}
+void smpi_comm_get_name (MPI_Comm comm, char* name, int* len)
+{
+ if(comm == MPI_COMM_WORLD) {
+ strcpy(name, "WORLD");
+ *len = 5;
+ } else {
+ *len = snprintf(name, MPI_MAX_NAME_STRING, "%p", comm);
+ }
+}
+
MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
{
int system_tag = 666;
return PMPI_Comm_size(comm, size);
}
+int MPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
+{
+ return PMPI_Comm_get_name(comm, name, len);
+}
+
int MPI_Comm_group(MPI_Comm comm, MPI_Group * group)
{
return PMPI_Comm_group(comm, group);
return retval;
}
+int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
+{
+ int retval;
+
+ smpi_bench_end();
+ if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (name == NULL || len == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ smpi_comm_get_name(comm, name, len);
+ retval = MPI_SUCCESS;
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
{
int retval;