On Thu, Mar 10, 2011 at 11:52 AM, Roy Stogner <[email protected]> wrote: > > On Thu, 10 Mar 2011, John Peterson wrote: > >> The attached patch makes PetscMatrix::print_personal() print to file. >> Would you try it out and see if that works for you? > > Could you change this to use mkstemp to get the temporary file? > Running multiple libMesh apps from the same working directory is > probably pretty rare, but it happens, and when it does there'd be a > race condition for "libmesh_temp_petsc_matrix.081702".
Yeah, you probably saw I had the mkstemp call in there. I commented it out since I wasn't sure what would happen in parallel... But I just read in the docs of PetscViewerASCIIOpen() that "If a multiprocessor communicator is used (such as PETSC_COMM_WORLD), then only the first processor in the group opens the file. All other processors send their data to the first processor to print." so I think it's probably safe. > That temp-file-to-ofstream copy is a wonderful, horrifying hack, by > the way. I'm pretty sure it's legal C++, so please let me know if you find out otherwise... -- John ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
