Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
improve the doc of the context factories
[simgrid.git] / src / smpi / smpi_f77.cpp
index 8786829..bc4438d 100644 (file)
@@ -303,11 +303,11 @@ void mpi_comm_size_(int* comm, int* size, int* ierr) {
    *ierr = MPI_Comm_size(smpi_comm_f2c(*comm), size);
 }
 
-double mpi_wtime_(void) {
+double mpi_wtime_() {
    return MPI_Wtime();
 }
 
-double mpi_wtick_(void) {
+double mpi_wtick_() {
   return MPI_Wtick();
 }
 
@@ -600,9 +600,8 @@ void mpi_test_ (int * request, int *flag, MPI_Status * status, int* ierr){
 }
 
 void mpi_testall_ (int* count, int * requests,  int *flag, MPI_Status * statuses, int* ierr){
-  MPI_Request* reqs;
   int i;
-  reqs = xbt_new(MPI_Request, *count);
+  MPI_Request* reqs = xbt_new(MPI_Request, *count);
   for(i = 0; i < *count; i++) {
     reqs[i] = smpi_request_f2c(requests[i]);
   }
@@ -613,6 +612,7 @@ void mpi_testall_ (int* count, int * requests,  int *flag, MPI_Status * statuses
         requests[i]=MPI_FORTRAN_REQUEST_NULL;
     }
   }
+  xbt_free(reqs);
 }
 
 void mpi_get_processor_name_(char *name, int *resultlen, int* ierr){
@@ -778,10 +778,11 @@ void mpi_info_set_( int *info, char *key, char *value, int* ierr, unsigned int k
   }
   char* tvalue = xbt_new(char,valuelen+1);
   strncpy(tvalue, value, valuelen);
-
   tvalue[valuelen]='\0'; 
+
   *ierr =  MPI_Info_set( smpi_info_f2c(*info), tkey, tvalue);
   xbt_free(tkey);
+  xbt_free(tvalue);
 }
 
 void mpi_info_get_ (int* info,char *key,int* valuelen, char *value, int *flag, int* ierr, unsigned int keylen ){
@@ -1754,3 +1755,28 @@ void mpi_comm_get_parent_ ( int* parent, int* ierr){
     *parent = smpi_comm_c2f(tmp);
   }
 }
+
+void mpi_file_close_ ( int* file, int* ierr){
+  *ierr= MPI_File_close(reinterpret_cast<MPI_File*>(*file));
+}
+
+void mpi_file_delete_ ( char* filename, int* info, int* ierr){
+  *ierr= MPI_File_delete(filename, smpi_info_f2c(*info));
+}
+
+void mpi_file_open_ ( int* comm, char* filename, int* amode, int* info, int* fh, int* ierr){
+  *ierr= MPI_File_open(smpi_comm_f2c(*comm), filename, *amode, smpi_info_f2c(*info), reinterpret_cast<MPI_File*>(*fh));
+}
+
+void mpi_file_set_view_ ( int* fh, long long int* offset, int* etype, int* filetype, char* datarep, int* info, int* ierr){
+  *ierr= MPI_File_set_view(reinterpret_cast<MPI_File>(*fh) , reinterpret_cast<MPI_Offset>(*offset), smpi_type_f2c(*etype), smpi_type_f2c(*filetype), datarep, smpi_info_f2c(*info));
+}
+
+void mpi_file_read_ ( int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr){
+  *ierr=  MPI_File_read(reinterpret_cast<MPI_File>(*fh), buf, *count, smpi_type_f2c(*datatype), status);
+}
+
+void mpi_file_write_ ( int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr){
+  *ierr=  MPI_File_write(reinterpret_cast<MPI_File>(*fh), buf, *count, smpi_type_f2c(*datatype), status);
+}
+