MPI_Status statusAcc;
int length = outAccString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outAccString.c_str(), length);
MPI_File_write_shared(outAcc, buf, length, MPI_CHAR, &statusAcc);
MPI_Status status;
int length = outputString.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outputString.c_str(), length);
MPI_File_write_shared(out, buf2, length, MPI_CHAR, &status);
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[consfile.length()];\r
- memcpy(inFileName, consfile.c_str(), consfile.length());
+ //char* inFileName = new char[consfile.length()];
+ //memcpy(inFileName, consfile.c_str(), consfile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, consfile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
MPI_File_read(inMPI, buffer, size, MPI_CHAR, &status);
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[quanfile.length()];\r
- memcpy(inFileName, quanfile.c_str(), quanfile.length());
+ //char* inFileName = new char[quanfile.length()];
+ //memcpy(inFileName, quanfile.c_str(), quanfile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, quanfile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
- char* FileName = new char[file.length()];\r
- memcpy(FileName, file.c_str(), file.length());
+ //char* FileName = new char[file.length()];
+ //memcpy(FileName, file.c_str(), file.length());
+
+ char FileName[1024];
+ strcpy(FileName, file.c_str());
if (pid == 0) {
MPI_File_open(MPI_COMM_SELF, FileName, outMode, MPI_INFO_NULL, &outQuan); //comm, filename, mode, info, filepointer
int length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write(outQuan, buf, length, MPI_CHAR, &status);
MPI_File_close(&outQuan);
}
- delete FileName;
+ //delete FileName;
#else
ofstream outQuan;
openOutputFile(file, outQuan);