/[escript]/trunk/escript/src/Utils.cpp
ViewVC logotype

Diff of /trunk/escript/src/Utils.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4476 by caltinay, Thu Mar 7 04:28:11 2013 UTC revision 4477 by caltinay, Thu Jun 20 02:41:28 2013 UTC
# Line 19  Line 19 
19    
20  // added for saveCSV  // added for saveCSV
21  #include <boost/python.hpp>  #include <boost/python.hpp>
22  #include <boost/scoped_ptr.hpp>  #include <boost/scoped_array.hpp>
23  #include "Data.h"  #include "Data.h"
24    
25  #include "Utils.h"  #include "Utils.h"
# Line 477  bool append) Line 477  bool append)
477      MPI_File mpi_fileHandle_p;      MPI_File mpi_fileHandle_p;
478      MPI_Status mpi_status;      MPI_Status mpi_status;
479      MPI_Info mpi_info = MPI_INFO_NULL;      MPI_Info mpi_info = MPI_INFO_NULL;
480      char* fname_c=new char[filename.size()+1];      boost::scoped_array<char> fname_p(new char[filename.size()+1]);
481      strcpy(fname_c,filename.c_str());      strcpy(fname_p.get(), filename.c_str());
     boost::scoped_ptr<char> fname_p(fname_c);  
482            
483      int amode = MPI_MODE_CREATE|MPI_MODE_WRONLY|MPI_MODE_UNIQUE_OPEN;      int amode = MPI_MODE_CREATE|MPI_MODE_WRONLY|MPI_MODE_UNIQUE_OPEN;
484      if (append)      if (append)
# Line 527  bool append) Line 526  bool append)
526      }      }
527    
528      std::string contents=os.str();      std::string contents=os.str();
529      char* con=new char[contents.size()+1];      boost::scoped_array<char> buff(new char[contents.size()+1]);
530      strcpy(con, contents.c_str());      strcpy(buff.get(), contents.c_str());
     boost::scoped_ptr<char> buff(con);  
531      ierr=MPI_File_write_ordered(mpi_fileHandle_p, buff.get(), contents.size(), MPI_CHAR, &mpi_status);      ierr=MPI_File_write_ordered(mpi_fileHandle_p, buff.get(), contents.size(), MPI_CHAR, &mpi_status);
532      if (ierr != MPI_SUCCESS)      if (ierr != MPI_SUCCESS)
533      {      {

Legend:
Removed from v.4476  
changed lines
  Added in v.4477

  ViewVC Help
Powered by ViewVC 1.1.26