create_hpc_bat.lsf 878 B

1234567891011121314151617181920212223242526
  1. slash = "/";
  2. if (operatingsystem == "windows") {slash = "\\";}
  3. rootdir = pwd;
  4. ######################################################
  5. # Get local hostname
  6. if (operatingsystem == "windows") {
  7. hpc_get_hostname; # variables input: rootdir; output: hostname or break;
  8. } else { hostname = "test";}
  9. #######################################################
  10. fname = rootdir+slash+hostname+"exec.bat";
  11. if (fileexists(fname)){rm(fname);}
  12. paths_string = rootdir+endl; # paths are separated by a new line symbol
  13. hpc_scan_paths; #input: paths_string with initial path;
  14. #output: paths_string with all paths;
  15. #can change working directory
  16. cd(rootdir);
  17. paths = splitstring(paths_string,endl);
  18. for(i=1:length(paths)) {
  19. if (paths{i} != ""){
  20. curdir = paths{i};
  21. hpc_curdir_check; # input: curdir, fname; output: none or break;
  22. }
  23. }
  24. write(fname,"exit /b 0");
  25. cd(rootdir);