Skip to content
This repository has been archived by the owner on Sep 21, 2018. It is now read-only.

Commit

Permalink
Dislocation engineering release
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee James O'Riordan committed Jul 15, 2016
1 parent 7e14b53 commit 3003fd7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CUDA_HOME = /usr/local/cuda
CUDA_HOME = /apps/free/cuda/7.5.18/
GPU_ARCH = sm_30
OS:= $(shell uname)
ifeq ($(OS),Darwin)
Expand Down
9 changes: 4 additions & 5 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#!/bin/bash
i=0
EMAIL=[email protected]
EMAIL=$1
count=0
NAME=$1
PARAMS=$2
NAME=$2
PARAMS=$3
declare -a JOBS=(-1 -1 -1 -1 -1 -1 -1 -1)
function run_gpue_test {
echo $1
Expand All @@ -54,15 +54,14 @@ function run_gpue {
cd ./$NAME$A
pwd >> result.log
echo $1 >>result.log
mail -s "#Started GPU Job# $A" [email protected] < result.log
mail -s "#Started GPU Job# $A" ${EMAIL} < result.log
./gpue $1 2>&1> result.log
mkdir -p ./images
#python ./py/vis.py >> result.log
cp *.png ./images
cd ./images
ls | grep wfc_evr | grep _abs | grep png | sort -k3 -t _ -n > list1.txt;mencoder mf://@list1.txt -mf w=1280:h=1024:fps=24:type=png -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vmax_b_frames=2:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2:vbitrate=10000000 -o wfc_${PWD##*/}.avi
rm -rf ./*.png
#python ./py/hist3d.py
rm wfc*
mail -s "#Completed GPU Job# $A" $EMAIL < $(echo $(cat result.log; cat ./Params.dat))
cd ../../../../..
Expand Down
15 changes: 10 additions & 5 deletions bin/run_params.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@
# vortex creation.
# -X, -Y are omega_x and omega_y (omega_perp when both are equal)
# -k is the potential kick mode. 0 is off, 1 is periodic, 2 is single.
# -O is the kicking potential rotation angle.
# -O is the kicking potential/kill vortex relative phase rotation angle.
# -S is the kicking potential lattice spacing scaling.
# -W turns on or off the wavefunction output printing.
# -V, -U are the x and y shifts of the kicking potential.
# -a, turns on the graph calculation code. Necessary for vortex annihilation
# -K, selects vortex with specified UID for termination. Plot adjacency matrix of initial state to determine which index (graph_0 --- need to do simulation before you get this; will be updated at some point)
# -D, sets offset for kill vortex distance radially

-x 1024 -y 1024 -T 1e-5 -t 1e-5 -n 1e6 -g 0 -e 2e5 -p 1000 -r 1 -w 0.995 -o 100 -d 4 -l 1 -s 1 -i 1.0 -P 10000.0 -G 1.0 -L 0 -X 6.28318 -Y 6.28318 -k 0 -O 10.0 -W 1 -U 0 -V 0 -S 3.0
-x 1024 -y 1024 -T 1e-5 -t 1e-5 -n 1e6 -g 0 -e 2e5 -p 1000 -r 1 -w 0.995 -o 100 -d 4 -l 1 -s 1 -i 1.0 -P 15000.0 -G 1.0 -L 0 -X 6.28318 -Y 6.28318 -k 0 -O 10.0 -W 1 -U 0 -V 0 -S 3.0
-x 1024 -y 1024 -T 1e-5 -t 1e-5 -n 1e6 -g 0 -e 2e5 -p 1000 -r 1 -w 0.995 -o 100 -d 4 -l 1 -s 1 -i 1.0 -P 20000.0 -G 1.0 -L 0 -X 6.28318 -Y 6.28318 -k 0 -O 10.0 -W 1 -U 0 -V 0 -S 3.0
-x 1024 -y 1024 -T 1e-5 -t 1e-5 -n 1e6 -g 0 -e 2e5 -p 1000 -r 1 -w 0.995 -o 100 -d 4 -l 1 -s 1 -i 1.0 -P 25000.0 -G 1.0 -L 0 -X 6.28318 -Y 6.28318 -k 0 -O 10.0 -W 1 -U 0 -V 0 -S 3.0

# Sample simulation data sets
-x 256 -y 256 -T 1e-5 -t 1e-5 -n 1e6 -g 2.01e5 -e 2e5 -p 1000 -r 0 -w 0.65 -o 100 -d 0 -l 1 -s 1 -i 1.0 -P 10000.0 -G 1.0 -L 10 -X 6.28318 -Y 6.28318 -k 0 -O 0.0 -W 1 -U 0 -V 0 -S 3.0 -a 1 -K 1 -D 0.0
-x 512 -y 512 -T 1e-5 -t 1e-5 -n 1e6 -g 2.01e5 -e 2e5 -p 1000 -r 0 -w 0.75 -o 100 -d 1 -l 1 -s 1 -i 1.0 -P 15000.0 -G 1.0 -L 20 -X 6.28318 -Y 6.28318 -k 0 -O 10.0 -W 1 -U 0 -V 0 -S 3.0 -a 1 -K 2 -D 1.0
-x 1024 -y 1024 -T 1e-5 -t 1e-5 -n 1e6 -g 2.01e5 -e 2e5 -p 1000 -r 0 -w 0.85 -o 100 -d 2 -l 1 -s 1 -i 1.0 -P 20000.0 -G 1.0 -L 30 -X 6.28318 -Y 6.28318 -k 0 -O 20.0 -W 1 -U 0 -V 0 -S 3.0 -a 1 -K 3 -D -4.5
-x 2048 -y 2048 -T 1e-5 -t 1e-5 -n 1e6 -g 2.01e5 -e 2e5 -p 1000 -r 0 -w 0.95 -o 100 -d 3 -l 1 -s 1 -i 1.0 -P 25000.0 -G 1.0 -L 0 -X 6.28318 -Y 6.28318 -k 0 -O 0.0 -W 1 -U 0 -V 0 -S 3.0 -a 0 -K 0 -D 0
13 changes: 1 addition & 12 deletions py/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
import os
CPUs = 4# os.environ['SLURM_JOB_CPUS_PER_NODE']
CPUs = os.environ['SLURM_JOB_CPUS_PER_NODE']
print "Number of cores: " + str(CPUs)
from numpy import genfromtxt
import math as m
Expand Down Expand Up @@ -320,13 +320,6 @@ def overlap(dataName, initValue, finalValue, increment):
print i, np.sum(b)

if __name__ == '__main__':
try:
delaunay('vort_arr_',0)
stats.lsFit(0,evMaxVal,incr)
hist3d.plot_hist_pcolor(0,evMaxVal,incr,'b')
vort_traj('traj_plot',200)
except:
print "Unhandled error occurred. Blame Lee."
opPot('V_opt_0',200)
opPot('V_0',200)
opPot('K_0',200)
Expand All @@ -345,10 +338,6 @@ def overlap(dataName, initValue, finalValue, increment):
while evImgList:
i=evImgList.pop()
ev_proc.append(Process(target=image_gen_single,args=("wfc_ev",i,200,0b101000)))
#ev_proc.append(Process(target=mpld3.show,))
ev_proc.append(Process(target=delaunay,args=("vort_lsq_",'.csv',i)))
ev_proc.append(Process(target=voronoi,args=("vort_lsq_",'.csv',i)))
ev_proc.append(Process(target=hist_gen,args=("hist_ev",i,128)))
proc = gnd_proc + ev_proc
while proc:
#if (mp.cpu_count()/2) > len(mp.active_children()):
Expand Down
2 changes: 1 addition & 1 deletion py/vort.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def idx_min_dist(self,vortex, isSelf=False): #Closest vtx to self
return (ret_idx,r)

###############################################################################
def remove(self,pos): #Remove vortices outside articificial boundary
def remove(self,pos): #Remove vortices outside artificial boundary
###############################################################################
if self.length > 1 and pos > 1:
current = self.element(pos-1).next
Expand Down
31 changes: 21 additions & 10 deletions src/split_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

unsigned int LatticeGraph::Edge::suid = 0;
unsigned int LatticeGraph::Node::suid = 0;

double DX = 0.0;
char buffer[100];
int verbose; //Print more info. Not curently implemented.
int device; //GPU ID choice.
Expand All @@ -64,7 +64,7 @@ double x0_shift, y0_shift; //Optical lattice shift parameters.
double Rxy; //Condensate scaling factor.
double a0x, a0y; //Harmonic oscillator length in x and y directions
double sepMinEpsilon=0.0; //Minimum separation for epsilon.

int kill_idx = -1;;
/*
* Checks CUDA routines have exitted correctly.
*/
Expand Down Expand Up @@ -395,7 +395,7 @@ int evolve( cufftDoubleComplex *gpuWfc,
case 2: //Real-time evolution, constant Omega value.
fileName = "wfc_ev";
vortexLocation = (int *) calloc(xDim * yDim, sizeof(int));
num_vortices[0] = Tracker::findVortex(vortexLocation, wfc, 1e-4, xDim, x, i);
num_vortices[0] = Tracker::findVortex(vortexLocation, wfc, 2e-4, xDim, x, i);

if (i == 0) { //If initial step, locate vortices, least-squares to find exact centre, calculate lattice angle, generate optical lattice.
vortCoords = (struct Vtx::Vortex *) malloc(
Expand Down Expand Up @@ -447,14 +447,15 @@ int evolve( cufftDoubleComplex *gpuWfc,
}
if(i==0) {
//Lambda for vortex annihilation/creation.
auto killIt=[&](int idx) {
WFC::phaseWinding(Phi, 1, x, y, dx, dy, lattice.getVortexUid(idx)->getData().coordsD.x,
lattice.getVortexUid(idx)->getData().coordsD.y, xDim);
auto killIt=[&](int idx, int winding, double delta_x) {
WFC::phaseWinding(Phi, winding, x, y, dx, dy, lattice.getVortexUid(idx)->getData().coordsD.x + cos(angle_sweep + vort_angle)*delta_x,
lattice.getVortexUid(idx)->getData().coordsD.y + sin(angle_sweep + vort_angle)*delta_x, xDim);
cudaMemcpy(Phi_gpu, Phi, sizeof(double) * xDim * yDim, cudaMemcpyHostToDevice);
cMultPhi <<<grid, threads>>> (gpuWfc, Phi_gpu, gpuWfc);
};
//killIt(44); //Kills vortex with UID 44

};
if (kill_idx > 0){
killIt(kill_idx,1,DX); //Kills vortex with UID idx
}

}
lattice.createEdges(1.5 * 2e-5 / dx);
Expand Down Expand Up @@ -768,7 +769,7 @@ template<typename T> void parSum(T *gpuToSumArr, T *gpuParSum, int xDim, int yDi
//###################################################################################################################
int parseArgs(int argc, char** argv){
int opt;
while ((opt = getopt (argc, argv, "d:x:y:w:G:g:e:T:t:n:p:r:o:L:l:s:i:P:X:Y:O:k:W:U:V:S:a:")) != -1) {
while ((opt = getopt (argc, argv, "D:d:x:y:w:G:g:e:T:t:n:p:r:o:L:l:s:i:P:X:Y:O:k:W:U:V:S:a:K:")) != -1) {
switch (opt)
{
case 'x':
Expand Down Expand Up @@ -906,6 +907,16 @@ int parseArgs(int argc, char** argv){
printf("Argument for graph is %d\n",graph);
appendData(&params,"graph",graph);
break;
case 'K':
kill_idx = atoi(optarg);
printf("Argument for kill_idx is %d\n",kill_idx);
appendData(&params,"kill_idx",kill_idx);
break;
case 'D':
DX = atoi(optarg);
printf("Argument for DX is %d\n",DX);
appendData(&params,"DX",DX);
break;
case '?':
if (optopt == 'c') {
fprintf (stderr, "Option -%c requires an argument.\n", optopt);
Expand Down
2 changes: 1 addition & 1 deletion src/tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ namespace Tracker {
location = i;
}
}
double ang=(fmod(atan2( (vortCoords[location].coords.y - central.coords.y), (vortCoords[location].coords.x - central.coords.x) ),PI/3));
double ang=0;//(fmod(atan2( (vortCoords[location].coords.y - central.coords.y), (vortCoords[location].coords.x - central.coords.x) ),PI/3));
printf("Angle=%e\n",ang);
return PI/3 - ang;

Expand Down

0 comments on commit 3003fd7

Please sign in to comment.