Konstantin Ladutenko 6 年之前
父节点
当前提交
686e0c4bd0
共有 5 个文件被更改,包括 50 次插入28 次删除
  1. 10 17
      create_hpc_bat.lsf
  2. 11 1
      efficiency-plasmon-plot.py
  3. 17 0
      hpc_file_check.lsf
  4. 3 3
      plasmon-modal-efficiency.py
  5. 9 7
      rsync.sh

+ 10 - 17
create_hpc_bat.lsf

@@ -5,6 +5,10 @@ slash = "/";
 if (operatingsystem == "windows") {slash = "\\";}
 
 curdir = pwd;
+######################################################
+# Get local hostname
+#
+######################################################
 if (fileexists("temppath.txt")) {
     temppath = read("temppath.txt");
     len = length(temppath);
@@ -22,29 +26,18 @@ if (fileexists("temppath.txt")) {
 } else {
     break;
 }
+######################################################
 files = splitstring(dir,endl);
 isCreated = false;
 fname = curdir+slash+hostname+"exec.bat";
 if (fileexists(fname)){rm(fname);}
 for(i=1:length(files)) {
-    if(fileextension(files{i}) == "fsp") {
-        lockfile =  files{i}+".lock";
-        if (!fileexists(lockfile)){
-            load(files{i});
-            status = layoutmode;
-            if (status == 1) {
-                write(fname,"IF EXIST \""+lockfile+"\" exit /b 1");
-                write(fname,"copy /y NUL "+lockfile+" >NUL");
-                write(fname,"\"C:\Program Files\Lumerical\FDTD\bin\fdtd-engine\" -t 32 "+files{i});
-                write(fname,"echo del "+curdir+slash+lockfile);
-                write(fname,"del "+curdir+slash+lockfile);
-                write(fname,"exit /b 1");
-                break;
-            }
-        }
-    }
+    file_to_check = files{i};
+    ?file_to_check+" --"+num2str(length(file_to_check))+"ext: "+fileextension(file_to_check);
+    if(fileextension(file_to_check) == "") {?"!!!!!! dir";}
+    hpc_file_check; # uses variables: file_to_check, fname
 }
 write(fname,"exit /b 0");
-
+cd(curdir);
 redrawon;
 

+ 11 - 1
efficiency-plasmon-plot.py

@@ -172,7 +172,17 @@ file_ext="pdf"
 #dirname="sub-Au-R100-Si-wl450-800-sep10nm.fsp.results"
 #dirname="bg-Au-sub-Au-dipole-W.fsp.results"
 #dirname="bg-Au-sub-Si-dipole-W.fsp.results"
-dirname="bg-Au-sub-dipole-W.fsp.results"
+#dirname="bg-Au-sub-dipole-W.fsp.results"
+# dirname=""
+# dirname=""
+# dirname=""
+# dirname=""
+# dirname=""
+# dirname=""
+# dirname=""
+dirname="bg-Au-sub-Si-dipole-Au.fsp.results"
+#dirname="bg-Au-sub-dipole-Au.fsp.results"
+#dirname="bg-Au-sub-Au-dipole-Au.fsp.results"
 #dirname="Au-McPeak-R0.fsp.results"
 #dirname="Au-McPeak-R100-Si-Green-1500.fsp.results"
 #dirname="Au-McPeak-R100-Si-Green-1500-l.fsp.results"

+ 17 - 0
hpc_file_check.lsf

@@ -0,0 +1,17 @@
+if(fileextension(file_to_check) == "fsp") {
+    lockfile =  file_to_check+".lock";
+    if (!fileexists(lockfile)){
+        ?"==fsp== "+file_to_check;
+        load(file_to_check);
+        status = layoutmode;
+        if (status == 1) {
+            write(fname,"IF EXIST \""+lockfile+"\" exit /b 1");
+            write(fname,"copy /y NUL "+lockfile+" >NUL");
+            write(fname,"\"C:\Program Files\Lumerical\FDTD\bin\fdtd-engine\" -t 32 "+files{i});
+            write(fname,"echo del "+curdir+slash+lockfile);
+            write(fname,"del "+curdir+slash+lockfile);
+            write(fname,"exit /b 1");
+            break;
+        }
+    }
+}

+ 3 - 3
plasmon-modal-efficiency.py

@@ -282,7 +282,7 @@ def main (monitor_index):
     #dirname="bigourdan-Au-sub-dipole-W-2mon.fsp.1D.monitor_2.results"
     #data = read_data(dirname)
     #filename = 'bigourdan-Au-sub-dipole-W-2mon.fsp.1D.mat'
-    filename="bg-Au-sub-dipole-W.fsp.1D.mat"
+    filename="bg-Au-sub-dipole-Au.fsp.1D.mat"
 
     data2 = read_data_mat(filename)
     r,data = data2[monitor_index]
@@ -300,8 +300,8 @@ def main (monitor_index):
     # #dirname="bigourdan-Au-sub-Cyl-dipole-W.fsp.1D.monitor_1.results"
     # dirname="bigourdan-Au-sub-Cyl-dipole-W-2mon.fsp.1D.monitor_2.results"
     # data = read_data(dirname)
-    filename = 'bg-Au-sub-Au-dipole-W.fsp.1D.mat'
-    #filename = 'bg-Au-sub-Si-dipole-W.fsp.1D.mat'
+    #filename = 'bg-Au-sub-Au-dipole-Au.fsp.1D.mat'
+    filename = 'bg-Au-sub-Si-dipole-Au.fsp.1D.mat'
     data2 = read_data_mat(filename)
     r,data = data2[monitor_index]
     WLs = []

+ 9 - 7
rsync.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+find . -type d -exec \cp -rf *.lsf {} \;
+find . -type d -exec \cp -rf *.bat {} \;
 #remote="/run/user/1000/gvfs/smb-share\:server\=192.168.5.18\,share\=hpc_d/k.ladutenko/0-tig-smuthi"
 #remote="/run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/0-tig-smuthi"
 echo $remote/setup.py
@@ -6,28 +8,28 @@ mounted=`ls /run/user/1000/gvfs/ | wc -l`
 # if [ $mounted = 0 ]; then
 #     echo Mounting SMB share:
 gio mount smb://192.168.5.30/users
-gio mount smb://192.168.5.18/hpc_d
+# gio mount smb://192.168.5.18/hpc_d
 #     echo Done!
 # fi
 
-if [ ! -f /run/user/1000/gvfs/smb-share\:server\=192.168.5.18\,share\=hpc_d/k.ladutenko/0-tig-smuthi/setup.py ]; then
-    echo "Mounting SMB share failed! If no other errors, you can try to mount it again."
-#    exit 1
-fi
 if [ ! -f /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/0-tig-smuthi/setup.py ]; then
     echo "Mounting SMB share failed! If no other errors, you can try to mount it again."
 #    exit 1
 fi
+# if [ ! -f /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/0-tig-smuthi/setup.py ]; then
+#     echo "Mounting SMB share failed! If no other errors, you can try to mount it again."
+# #    exit 1
+# fi
 
 # rsync -auz --progress --no-perms --no-owner --no-group --no-times --exclude .git --exclude docs --exclude build_docs --exclude *~ /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/T-matrix/smuthi/tig-smuthi/ $remote
 
 #rsync -auz --progress --no-perms --no-owner --no-group --exclude .git --exclude docs --exclude build_docs --exclude *~ --exclude '*.lock' --exclude *results* --exclude smuthi_nfmds_bin /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/dipole-on-surf/ /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/dipole-on-surf
 echo Ok
 
-rsync -auz --progress --no-perms --no-owner --no-group --exclude .git --exclude docs --exclude build_docs --exclude *~ --exclude '*.lock' --exclude '*results*' /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/dipole-on-surf/ /run/user/1000/gvfs/smb-share\:server\=192.168.5.18\,share\=hpc_d/k.ladutenko/dipole-on-surf
+rsync -auz --progress --no-perms --no-owner --no-group --exclude .git --exclude docs --exclude build_docs --exclude *~ --exclude '*.lock' --exclude '*results*' /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/dipole-on-surf/ /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/dipole-on-surf
 
 #gio mount smb://192.168.5.30/users
 #ls /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/
-rsync -auz --progress --no-perms --no-owner --no-group --exclude .git --exclude docs --exclude build_docs --exclude *~ --exclude '*.lock' --exclude '*results*' /run/user/1000/gvfs/smb-share\:server\=192.168.5.18\,share\=hpc_d/k.ladutenko/dipole-on-surf/ /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/dipole-on-surf
+rsync -auz --progress --no-perms --no-owner --no-group --exclude .git --exclude docs --exclude build_docs --exclude *~ --exclude '*.lock' --exclude '*results*' /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/dipole-on-surf/ /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/dipole-on-surf
 
 #rsync -auz --progress --no-perms --no-owner --no-group --exclude .git --exclude docs --exclude build_docs --exclude *~ --exclude *results* /run/user/1000/gvfs/smb-share\:server\=192.168.5.30\,share\=users/z.ladutenko/dipole-on-surf/ /home/tig/KOsty/Documents/Simulations/Belov/Bogdanov/dipole-on-surf