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
[SMPI] Added 2 FIXME's for PMPI_Is_thread_main()
[simgrid.git]
/
src
/
smpi
/
bindings
/
smpi_pmpi.cpp
diff --git
a/src/smpi/bindings/smpi_pmpi.cpp
b/src/smpi/bindings/smpi_pmpi.cpp
index
ff6a248
..
c8129b9
100644
(file)
--- a/
src/smpi/bindings/smpi_pmpi.cpp
+++ b/
src/smpi/bindings/smpi_pmpi.cpp
@@
-3,13
+3,14
@@
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "private.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
-#include "private.h"
#include "smpi_comm.hpp"
#include "smpi_datatype_derived.hpp"
#include "smpi_process.hpp"
#include "smpi_status.hpp"
#include "smpi_comm.hpp"
#include "smpi_datatype_derived.hpp"
#include "smpi_process.hpp"
#include "smpi_status.hpp"
+#include "src/simix/ActorImpl.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, "Logging specific to SMPI (pmpi)");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, "Logging specific to SMPI (pmpi)");
@@
-38,11
+39,9
@@
int PMPI_Init(int *argc, char ***argv)
smpi_process()->mark_as_initialized();
int rank = smpi_process()->index();
TRACE_smpi_init(rank);
smpi_process()->mark_as_initialized();
int rank = smpi_process()->index();
TRACE_smpi_init(rank);
+ TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("init"));
+ TRACE_smpi_comm_out(rank);
TRACE_smpi_computing_init(rank);
TRACE_smpi_computing_init(rank);
- instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
- extra->type = TRACING_INIT;
- TRACE_smpi_collective_in(rank, __FUNCTION__, extra);
- TRACE_smpi_collective_out(rank, __FUNCTION__);
smpi_bench_begin();
}
smpi_bench_begin();
}
@@
-55,14
+54,12
@@
int PMPI_Finalize()
{
smpi_bench_end();
int rank = smpi_process()->index();
{
smpi_bench_end();
int rank = smpi_process()->index();
- instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
- extra->type = TRACING_FINALIZE;
- TRACE_smpi_collective_in(rank, __FUNCTION__, extra);
+ TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("finalize"));
smpi_process()->finalize();
smpi_process()->finalize();
- TRACE_smpi_co
llective_out(rank, __FUNCTION__
);
- TRACE_smpi_finalize(
smpi_process()->index()
);
+ TRACE_smpi_co
mm_out(rank
);
+ TRACE_smpi_finalize(
rank
);
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
@@
-87,7
+84,7
@@
int PMPI_Get_library_version (char *version,int *len){
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
-int PMPI_Init_thread(int
*argc, char ***argv, int required, int *
provided)
+int PMPI_Init_thread(int
* argc, char*** argv, int /*required*/, int*
provided)
{
if (provided != nullptr) {
*provided = MPI_THREAD_SINGLE;
{
if (provided != nullptr) {
*provided = MPI_THREAD_SINGLE;
@@
-107,19
+104,23
@@
int PMPI_Query_thread(int *provided)
int PMPI_Is_thread_main(int *flag)
{
int PMPI_Is_thread_main(int *flag)
{
+ // FIXME: The MPI standard seems to say that fatal errors need to be triggered
+ // if MPI has been finalized or not yet been initialized
if (flag == nullptr) {
return MPI_ERR_ARG;
} else {
if (flag == nullptr) {
return MPI_ERR_ARG;
} else {
- *flag = smpi_process()->index() == 0;
+ *flag = smpi_process()->index() == 0; // FIXME: I don't think this is correct: This just returns true if the process ID is 1,
+ // regardless of whether this process called MPI_Thread_Init() or not.
return MPI_SUCCESS;
}
}
return MPI_SUCCESS;
}
}
-int PMPI_Abort(MPI_Comm
comm, int errorcode
)
+int PMPI_Abort(MPI_Comm
/*comm*/, int /*errorcode*/
)
{
smpi_bench_end();
// FIXME: should kill all processes in comm instead
{
smpi_bench_end();
// FIXME: should kill all processes in comm instead
- simcall_process_kill(SIMIX_process_self());
+ smx_actor_t process = SIMIX_process_self();
+ simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
@@
-184,7
+185,8
@@
int PMPI_Initialized(int* flag) {
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
-int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr){
+int PMPI_Alloc_mem(MPI_Aint size, MPI_Info /*info*/, void* baseptr)
+{
void *ptr = xbt_malloc(size);
if(ptr==nullptr)
return MPI_ERR_NO_MEM;
void *ptr = xbt_malloc(size);
if(ptr==nullptr)
return MPI_ERR_NO_MEM;