Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initialize fortran data structures in all cases.
[simgrid.git] / src / smpi / bindings / smpi_f77.cpp
index c8f0680..23db44a 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
 
 /* 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.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
@@ -13,7 +13,7 @@
 
 static int running_processes = 0;
 
-static void smpi_init_fortran_types(){
+void smpi_init_fortran_types(){
    if(simgrid::smpi::F2C::lookup() == nullptr){
      MPI_COMM_WORLD->add_f();
      MPI_BYTE->add_f();//MPI_BYTE
@@ -79,9 +79,6 @@ void mpi_init_(int* ierr) {
 void mpi_finalize_(int* ierr) {
    *ierr = MPI_Finalize();
    running_processes--;
-   if(running_processes==0){
-      simgrid::smpi::F2C::delete_lookup();
-   }
 }
 
 void mpi_abort_(int* comm, int* errorcode, int* ierr) {
@@ -239,8 +236,8 @@ void mpi_win_delete_attr_(int* win, int* comm_keyval, int* ierr){
 }
 
 void mpi_win_create_keyval_(void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr){
-  *ierr = MPI_Win_create_keyval(reinterpret_cast<MPI_Win_copy_attr_function*>(copy_fn),  reinterpret_cast<MPI_Win_delete_attr_function*>(delete_fn),
-         keyval,  extra_state) ;
+  *ierr = MPI_Win_create_keyval(reinterpret_cast<MPI_Win_copy_attr_function*>(copy_fn),
+                                reinterpret_cast<MPI_Win_delete_attr_function*>(delete_fn), keyval, extra_state);
 }
 
 void mpi_win_free_keyval_(int* keyval, int* ierr){