Changeset 9f1c84
- Timestamp:
- Sep 13, 2025, 2:44:01 PM (6 weeks ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 9259c3
- Parents:
- 5d18f3
- git-author:
- Frederik Heber <frederik.heber@…> (09/01/25 20:22:38)
- git-committer:
- Frederik Heber <frederik.heber@…> (09/13/25 14:44:01)
- Location:
- ThirdParty/vmg/src
- Files:
-
- 3 edited
-
comm/comm_mpi.cpp (modified) (9 diffs)
-
comm/comm_mpi.hpp (modified) (1 diff)
-
discretization/boundary_value_setter.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ThirdParty/vmg/src/comm/comm_mpi.cpp
r5d18f3 r9f1c84 53 53 #include <cstring> 54 54 #include <sstream> 55 #include <iomanip> 55 56 56 57 #include "base/helper.hpp" … … 736 737 if (comm != MPI_COMM_NULL) { 737 738 738 MPI_File file;739 739 std::string conv_information = Helper::ReplaceWhitespaces(information, "_"); 740 740 … … 742 742 begin_global, end_global, begin_local, end_local); 743 743 744 file = CreateSerialOutputFile(grid, comm, output_count, conv_information.c_str(),744 MPI_File *file = CreateSerialOutputFile(grid, comm, output_count, conv_information.c_str(), 745 745 begin_global, end_global, begin_local, end_local); 746 746 747 747 char *char_buf = Helper::GetCharArray(serial_data.str()); 748 MPI_File_write( file, char_buf, serial_data.str().size(), MPI_CHAR, MPI_STATUS_IGNORE);748 MPI_File_write(*file, char_buf, serial_data.str().size(), MPI_CHAR, MPI_STATUS_IGNORE); 749 749 delete [] char_buf; 750 750 751 FinalizeSerialOutputFile(file); 751 FinalizeSerialOutputFile(*file); 752 753 free(file); 752 754 753 755 } … … 761 763 int rank; 762 764 MPI_File file; 763 char parallel_filename[513], serial_filename[513];764 765 std::stringstream buf; 765 766 MPI_Comm_rank(comm, &rank); 767 768 sprintf(parallel_filename, "%s%04d.pvti", OutputPath().c_str(), output_count); 769 sprintf(serial_filename, "%04d_%d.vti", output_count, rank); 770 771 MPI_File_open(comm, parallel_filename, MPI_MODE_WRONLY|MPI_MODE_CREATE, MPI_INFO_NULL, &file); 766 std::stringstream parallel_filename, serial_filename; 767 768 MPI_Comm_rank(comm_global, &rank); 769 770 parallel_filename << OutputPath() << std::setfill('0') << std::setw(4) << output_count << std::setw(0) << ".pvti"; 771 serial_filename << std::setfill('0') << std::setw(4) << output_count << "_" << rank << std::setw(0) << ".pvti"; 772 // sprintf(parallel_filename, "%s%04d.pvti", OutputPath().c_str(), output_count); 773 // sprintf(serial_filename, "%04d_%d.vti", output_count, rank); 774 775 MPI_File_open(comm_global, parallel_filename.str().c_str(), MPI_MODE_WRONLY|MPI_MODE_CREATE|MPI_MODE_SEQUENTIAL, MPI_INFO_NULL, &file); 772 776 MPI_File_set_size(file, 0); 773 777 … … 807 811 buf << begin_local[i] << " " << end_local[i] << " "; 808 812 809 buf << "\" Source=\"" << serial_filename << "\"/>" << std::endl;813 buf << "\" Source=\"" << serial_filename.str() << "\"/>" << std::endl; 810 814 } 811 815 … … 833 837 } 834 838 835 MPI_File CommMPI::CreateSerialOutputFile(const Grid& grid, MPI_Comm& comm,839 MPI_File* CommMPI::CreateSerialOutputFile(const Grid& grid, MPI_Comm& comm, 836 840 const int& output_count, const char* information, 837 841 const Index& begin_global, const Index& end_global, … … 840 844 char serial_filename[513]; 841 845 int rank; 842 MPI_File file;846 MPI_File *file = (MPI_File *)malloc(sizeof(MPI_File)); 843 847 std::stringstream buf; 844 848 … … 847 851 sprintf(serial_filename, "%s%04d_%d.vti", OutputPath().c_str(), output_count, rank); 848 852 849 MPI_File_open(MPI_COMM_SELF, serial_filename, MPI_MODE_WRONLY|MPI_MODE_CREATE, MPI_INFO_NULL, &file);853 MPI_File_open(MPI_COMM_SELF, serial_filename, MPI_MODE_WRONLY|MPI_MODE_CREATE, MPI_INFO_NULL, file); 850 854 851 855 buf << "<?xml version=\"1.0\"?>" << std::endl … … 874 878 875 879 char* char_buf = Helper::GetCharArray(buf.str()); 876 MPI_File_write( file, char_buf, buf.str().size(), MPI_CHAR, MPI_STATUS_IGNORE);880 MPI_File_write(*file, char_buf, buf.str().size(), MPI_CHAR, MPI_STATUS_IGNORE); 877 881 delete [] char_buf; 878 882 -
ThirdParty/vmg/src/comm/comm_mpi.hpp
r5d18f3 r9f1c84 159 159 const Index& begin_local, const Index& end_local); 160 160 161 MPI_File CreateSerialOutputFile(const Grid& grid, MPI_Comm& comm,161 MPI_File* CreateSerialOutputFile(const Grid& grid, MPI_Comm& comm, 162 162 const int& output_count, const char* information, 163 163 const Index& begin_global, const Index& end_global, -
ThirdParty/vmg/src/discretization/boundary_value_setter.cpp
r5d18f3 r9f1c84 62 62 } 63 63 64 MG::GetComm()->PrintGrid(rhs_gml, "DEBUG GREEN BOUNDARY");64 // MG::GetComm()->PrintGrid(rhs_gml, "DEBUG GREEN BOUNDARY"); 65 65 } 66 66
Note:
See TracChangeset
for help on using the changeset viewer.
