Skip to content

Commit

Permalink
fmk - putting in a shebang to submit script for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckenna committed Oct 10, 2024
1 parent 1af7fc8 commit b84abd1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
7 changes: 7 additions & 0 deletions modules/performFEM/OpenSees/createOpenSeesDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ int main(int argc, const char **argv) {
exit(802); // no random variables allowed
}

// put in shebang fow linux
bool isWindows = (osType.compare("Windows") == 0);
bool isRunningLocal = (runType.compare("runningLocal") == 0);
if (!(isWindows && isRunningLocal)) {
workflowDriverFile << "#!/bin/bash\n";
}

std::string dpreproCommand;
std::string openSeesCommand;
std::string pythonCommand;
Expand Down
12 changes: 10 additions & 2 deletions modules/performFEM/OpenSeesPy/createOpenSeesPyDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,20 @@ int createDriver(int argc, const char **argv) {
workflowDriver.append(std::string(".bat"));

std::ofstream workflowDriverFile(workflowDriver, std::ios::binary);

if (!workflowDriverFile.is_open()) {
std::cerr << "createOpenSeesPyDriver:: could not create workflow driver file: " << workflowDriver << "\n";
exit(802); // no random variables is allowed
}

// put in shebang fow linux
bool isWindows = (osType.compare("Windows") == 0);
bool isRunningLocal = (runType.compare("runningLocal") == 0);
if (!(isWindows && isRunningLocal)) {
workflowDriverFile << "#!/bin/bash\n";
}


std::string dpreproCommand;
std::string openSeesCommand;
std::string pythonCommand;
Expand Down Expand Up @@ -325,4 +333,4 @@ int main(int argc, const char **argv) {

return 0;

}
}
7 changes: 7 additions & 0 deletions modules/performFEM/surrogateGP/createGpDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ int main(int argc, const char **argv) {
exit(802); // no random variables is allowed
}

// put in shebang fow linux
bool isWindows = (osType.compare("Windows") == 0);
bool isRunningLocal = (runType.compare("runningLocal") == 0);
if (!(isWindows && isRunningLocal)) {
workflowDriverFile << "#!/bin/bash\n";
}

std::string dpreproCommand;
std::string openSeesCommand;
std::string gpCommand;
Expand Down

0 comments on commit b84abd1

Please sign in to comment.