Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a check so that process_init exits cleanly when improperly called.
authordegomme <augustin.degomme@unibas.ch>
Tue, 18 Oct 2016 15:19:21 +0000 (17:19 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 18 Oct 2016 15:23:46 +0000 (17:23 +0200)
src/smpi/smpi_global.cpp

index 72a8992..a804bcb 100644 (file)
@@ -99,6 +99,10 @@ static char *get_mailbox_name_small(char *str, int index)
 void smpi_process_init(int *argc, char ***argv)
 {
 
 void smpi_process_init(int *argc, char ***argv)
 {
 
+  if (process_data == nullptr){
+    printf("SimGrid was not initialized properly before entering MPI_Init. Aborting, please check compilation process and use smpirun\n");
+    exit(1);
+  }
   if (argc != nullptr && argv != nullptr) {
     smx_actor_t proc = SIMIX_process_self();
     proc->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);
   if (argc != nullptr && argv != nullptr) {
     smx_actor_t proc = SIMIX_process_self();
     proc->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);