| 193 | |
| 194 | |
| 195 | void |
| 196 | amrex::UtilCreateDirectoryDestructive(const std::string &path, bool callbarrier) |
| 197 | { |
| 198 | BL_PROFILE("UtilCreateDirectoryDestructive()") |
| 199 | if(ParallelContext::IOProcessorSub()) |
| 200 | { |
| 201 | if(amrex::FileExists(path)) |
| 202 | { |
| 203 | if (amrex::Verbose() > 1) { |
| 204 | amrex::Print() << "amrex::UtilCreateCleanDirectoryDestructive(): " << path |
| 205 | << " exists. I am destroying it. " << '\n'; |
| 206 | } |
| 207 | FileSystem::RemoveAll(path); |
| 208 | } |
| 209 | if( ! amrex::UtilCreateDirectory(path, 0755)) |
| 210 | { |
| 211 | amrex::CreateDirectoryFailed(path); |
| 212 | } |
| 213 | } |
| 214 | if(callbarrier) |
| 215 | { |
| 216 | // Force other processors to wait until directory is built. |
| 217 | ParallelDescriptor::Barrier("amrex::UtilCreateCleanDirectoryDestructive"); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | void |
| 222 | amrex::UtilRenameDirectoryToOld (const std::string &path, bool callbarrier) |
nothing calls this directly
no test coverage detected