From davidk at ci.uchicago.edu Wed Aug 1 14:08:20 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 1 Aug 2012 14:08:20 -0500 (CDT)
Subject: [Swift-commit] r5883 - SwiftApps/CMTS/rmsd
Message-ID: <20120801190820.1992A9CC82@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-01 14:08:19 -0500 (Wed, 01 Aug 2012)
New Revision: 5883
Modified:
SwiftApps/CMTS/rmsd/plot_pd.pl
SwiftApps/CMTS/rmsd/rmsd.swift
Log:
Fixes for post processing plot
Modified: SwiftApps/CMTS/rmsd/plot_pd.pl
===================================================================
--- SwiftApps/CMTS/rmsd/plot_pd.pl 2012-07-30 18:59:23 UTC (rev 5882)
+++ SwiftApps/CMTS/rmsd/plot_pd.pl 2012-08-01 19:08:19 UTC (rev 5883)
@@ -7,7 +7,7 @@
# sweep the nonbonded parameter space
# File names
-open (OFILE, ">", "rmsd_pd.dat");
+open (OFILE, ">", "output/rmsd_pd.dat");
# Bead names
my $b1name = "PX";
@@ -35,9 +35,9 @@
while ($b2<=$b2max)
{
- if (-s "rmsd.$b1name${b1}_$b2name${b2}.dat")
+ if (-s "output/rmsd.$b1name${b1}_$b2name${b2}.dat")
{
- open(INPUT, "<", "rmsd.$b1name${b1}_$b2name${b2}.dat");
+ open(INPUT, "<", "output/rmsd.$b1name${b1}_$b2name${b2}.dat");
$_ = ;
my @data = split(/ +/,$_);
Modified: SwiftApps/CMTS/rmsd/rmsd.swift
===================================================================
--- SwiftApps/CMTS/rmsd/rmsd.swift 2012-07-30 18:59:23 UTC (rev 5882)
+++ SwiftApps/CMTS/rmsd/rmsd.swift 2012-08-01 19:08:19 UTC (rev 5883)
@@ -5,9 +5,9 @@
rmsd b1_val b2_val b1_name b2_name @namd_input_file @namd_params_file @vmd_script_file stdout=@o stderr=@e;
}
-app (file plot_pd_f) plot_pd ()
+app (file plot_pd_stdout, file plot_pd_output) plot_pd (file[float][float] datfs)
{
- plot_pd stdout=@plot_pd_f;
+ plot_pd stdout=@plot_pd_stdout;
}
# Bead names
@@ -29,6 +29,7 @@
file vmd_script <"rmsd.temp.tcl">;
file psf <"cg_clath_cage.psf">;
file pdb <"cg_clath_cage.pdb">;
+file[float][float] dats;
foreach b1 in [b1min:b1max:delta] {
foreach b2 in [b2min:b2max:delta] {
@@ -36,10 +37,12 @@
file error ;
file dcd ;
file dat ;
+ dats[b1][b2] = dat;
(output, error, dcd, dat) = rmsd(b1, b2, b1name, b2name, namd_input, namd_params, vmd_script, psf, pdb);
}
}
# Post processing analysis
-file plot_pd_file <"output/plot_pd.txt">;
-plot_pd_file = plot_pd();
+file plot_pd_stdout <"output/plot_pd.txt">;
+file plot_pd_output <"output/rmsd_pd.dat">;
+(plot_pd_stdout, plot_pd_output) = plot_pd(dats);
From davidk at ci.uchicago.edu Wed Aug 1 14:42:05 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 1 Aug 2012 14:42:05 -0500 (CDT)
Subject: [Swift-commit] r5884 - trunk/bin
Message-ID: <20120801194205.B7BD09CC82@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-01 14:42:05 -0500 (Wed, 01 Aug 2012)
New Revision: 5884
Added:
trunk/bin/slurm-qdel
trunk/bin/slurm-qstat
trunk/bin/slurm-qsub
Log:
Adding slurm scripts
Added: trunk/bin/slurm-qdel
===================================================================
--- trunk/bin/slurm-qdel (rev 0)
+++ trunk/bin/slurm-qdel 2012-08-01 19:42:05 UTC (rev 5884)
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+now=$(date "+%Y.%m%d.%H:%M:%S")
+echo $now $0: $* >> $HOME/pbslog
+
+qdel $*
+
+
Property changes on: trunk/bin/slurm-qdel
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/bin/slurm-qstat
===================================================================
--- trunk/bin/slurm-qstat (rev 0)
+++ trunk/bin/slurm-qstat 2012-08-01 19:42:05 UTC (rev 5884)
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+now=$(date "+%Y.%m%d.%H:%M:%S")
+echo $now $0: $* >> $HOME/pbslog
+
+#echo 'Job id Name User Time Use S Queue'
+#echo '------------------- ---------------- --------------- -------- - -----'
+
+#/software/slurm-2.4-el6-x86_64/bin/qstat $* | tail -n +2
+qstat $* | sed -e 's/\t/ /' -e 's/: */: /'
+
+
+
Property changes on: trunk/bin/slurm-qstat
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/bin/slurm-qsub
===================================================================
--- trunk/bin/slurm-qsub (rev 0)
+++ trunk/bin/slurm-qsub 2012-08-01 19:42:05 UTC (rev 5884)
@@ -0,0 +1,76 @@
+#! /bin/sh
+
+now=$(date "+%Y.%m%d.%H:%M:%S")
+echo $now $0: $* >> $HOME/pbslog
+
+slurmqsub=$( which qsub )
+script=$1.slurm
+echo '#! /bin/sh' >$script
+# echo 'export PBS_NODELIST=SLURM_NODELIST'' >>$script # FIXME: convert SLURM_NODELIST to PBS_NODEFILE here...
+cat $1 >>$script
+chmod +x $script
+
+srunargs=$(awk <$1 '
+/#PBS -S/ { shell=$3 }
+/#PBS -N/ { jobname=$3 }
+/#PBS -m/ { m = $3 }
+/#PBS -l nodes/ { nodes = $3; ppn=$3;
+ sub(/nodes=/,"",nodes); sub(/:.*/,"",nodes);
+ sub(/^.*ppn=/,"",ppn); }
+/#PBS -l walltime/ { walltime = $3; sub(/walltime=/,"",walltime);}
+/#PBS -q/ { queue = $3 }
+/#PBS -o/ { sofile = $3 }
+/#PBS -e/ { sefile = $3 }
+
+END {
+ #printf("shell=%s jobname=%s m=%s nodespec=%s nodes=%s ppn=%s walltime=%s queue=%s sofile=%s sefile=%s\n",
+ # shell, jobname, m, nodespec, nodes, ppn, walltime, queue, sofile, sefile);
+ #printf("-p %s -t %s -N %s -D %s -J %s -e %s -o %s", queue, walltime, nodes, "/tmp", jobname, sefile, sofile);
+
+# printf("-S %s -N %s -m %s -l nodes=%s:ppn=%s -l walltime=%s -q %s -o %s -e %s",
+# shell, jobname, m, nodes, ppn, walltime, queue, sofile, sefile);
+ printf("-N %s -m %s -l nodes=%s:ppn=%s -l walltime=%s -q %s -o %s -e %s",
+ jobname, m, nodes, ppn, walltime, queue, sofile, sefile);
+
+}')
+
+echo " " qsub args: $slurmqsub $srunargs $script >>$HOME/pbslog
+job=$($slurmqsub $srunargs $script)
+echo " " qsub output: $job >>$HOME/pbslog
+
+jid=$(echo $job | sed -e 's/^.* //')
+echo " " qsub job id: $jid >>$HOME/pbslog
+echo $jid
+
+# srun $srunargs $script
+
+# cqsub -q ${QUEUE} \
+# -k zeptoos \
+# -t ${MAXTIME} \ # minutes
+# -n ${NODES} \
+# --cwd ${LOGDIR} \
+# -E ${LOGDIR}/cobalt.${$}.stderr \
+# -o ${LOGDIR}/cobalt.${$}.stdout \
+# -e "WORKER_LOGGING_LEVEL=DEBUG:ZOID_ENABLE_NAT=true" \
+# $WORKER $EXECUTION_URL $ID $LOG_DIR
+
+# LOGDIR=/tmp/swiftlog
+#
+# WORKER_LOGGING_LEVEL=DEBUG srun \
+# -p ${QUEUE} \
+# -t ${MAXTIME} \
+# -N ${NODES} \
+# -D ${LOGDIR} \
+# -J swift-worker \
+# -e ${LOGDIR}/cobalt.${$}.stderr \
+# -o ${LOGDIR}/cobalt.${$}.stdout \
+# $SWIFT_BIN/$WORKER $EXECUTION_URL $ID $LOG_DIR
+
+#PBS -S /bin/bash
+#PBS -N cog-000000
+#PBS -m n
+#PBS -l nodes=1:ppn=1
+#PBS -l walltime=00:05:00
+#PBS -q sandyb
+#PBS -o /home/wilde/.globus/scripts/PBS4051523028032512638.submit.stdout
+#PBS -e /home/wilde/.globus/scripts/PBS4051523028032512638.submit.stderr
Property changes on: trunk/bin/slurm-qsub
___________________________________________________________________
Added: svn:executable
+ *
From swift at ci.uchicago.edu Wed Aug 1 14:45:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Wed, 1 Aug 2012 14:45:03 -0500 (CDT)
Subject: [Swift-commit] cog r3435
Message-ID: <20120801194504.511938D00065@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3435 | davidkelly999 | 2012-08-01 14:41:18 -0500 (Wed, 01 Aug 2012) | 2 lines
Point slurm provider to the correct shell scripts
------------------------------------------------------------------------
Index: modules/provider-localscheduler/etc/provider-slurm.properties
===================================================================
--- modules/provider-localscheduler/etc/provider-slurm.properties (revision 3434)
+++ modules/provider-localscheduler/etc/provider-slurm.properties (working copy)
@@ -8,17 +8,17 @@
#
# The path to qsub. The default assumes that qsub is in PATH
#
-qsub=notqsub
+qsub=slurm-qsub
#
# The path to qstat. The default assumes that qstat is in PATH
#
-qstat=notqstat
+qstat=slurm-qstat
#
# The path to qdel. The default assumes that qdel is in PATH
#
-qdel=notqdel
+qdel=slurm-qdel
# If true, use "#PBS -l mppwidth=" instead of "#PBS -l nodes="
# in PBS script
From davidk at ci.uchicago.edu Wed Aug 1 15:13:28 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 1 Aug 2012 15:13:28 -0500 (CDT)
Subject: [Swift-commit] r5885 - trunk
Message-ID: <20120801201328.D31DE9CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-01 15:13:28 -0500 (Wed, 01 Aug 2012)
New Revision: 5885
Modified:
trunk/build.xml
Log:
Include slurm stuff during build
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2012-08-01 19:42:05 UTC (rev 5884)
+++ trunk/build.xml 2012-08-01 20:13:28 UTC (rev 5885)
@@ -112,6 +112,9 @@
+
+
+
From swift at ci.uchicago.edu Thu Aug 2 01:35:04 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 01:35:04 -0500 (CDT)
Subject: [Swift-commit] cog r3437
Message-ID: <20120802063505.3C4558D00DF2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3437 | hategan | 2012-08-02 01:34:52 -0500 (Thu, 02 Aug 2012) | 1 line
changed security contexts to accept a host parameter (such that: credentials can be selected based on host name AND interactive credential dialogs can display the host name requesting credentials
------------------------------------------------------------------------
Index: modules/abstraction-common/src/org/globus/cog/abstraction/tools/execution/JobSubmission.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/tools/execution/JobSubmission.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/tools/execution/JobSubmission.java (working copy)
@@ -167,13 +167,11 @@
ExecutionService service = new ExecutionServiceImpl();
service.setProvider(this.provider.toLowerCase());
- SecurityContext securityContext = AbstractionFactory
- .newSecurityContext(provider);
- securityContext.setCredentials(null);
- service.setSecurityContext(securityContext);
-
ServiceContact sc = new ServiceContactImpl(this.serviceContact);
service.setServiceContact(sc);
+
+ SecurityContext securityContext = AbstractionFactory.getSecurityContext(provider, sc);
+ service.setSecurityContext(securityContext);
/*
* This is an abstraction for the jobmanager. For example, the
Index: modules/abstraction-common/src/org/globus/cog/abstraction/tools/transfer/FileTransfer.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/tools/transfer/FileTransfer.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/tools/transfer/FileTransfer.java (working copy)
@@ -92,28 +92,23 @@
this.task.setSpecification(spec);
// create te source service
- SecurityContext sourceSecurityContext = AbstractionFactory
- .newSecurityContext(sourceURI.getScheme());
- // selects the default credentials
- sourceSecurityContext.setCredentials(null);
-
ServiceContact sourceServiceContact = new ServiceContactImpl();
sourceServiceContact.setHost(sourceURI.getHost());
sourceServiceContact.setPort(sourceURI.getPort());
+
+ SecurityContext sourceSecurityContext =
+ AbstractionFactory.getSecurityContext(sourceURI.getScheme(), sourceServiceContact);
Service sourceService = new ServiceImpl(sourceURI.getScheme(),
Service.FILE_TRANSFER, sourceServiceContact,
sourceSecurityContext);
- // create te destination service
- SecurityContext destinationSecurityContext = AbstractionFactory
- .newSecurityContext(destinationURI.getScheme());
- // selects the default credentials
- destinationSecurityContext.setCredentials(null);
-
ServiceContact destinationServiceContact = new ServiceContactImpl();
destinationServiceContact.setHost(destinationURI.getHost());
destinationServiceContact.setPort(destinationURI.getPort());
+
+ SecurityContext destinationSecurityContext =
+ AbstractionFactory.getSecurityContext(destinationURI.getScheme(), destinationServiceContact);
Service destinationService = new ServiceImpl(
destinationURI.getScheme(), Service.FILE_TRANSFER,
Index: modules/abstraction-common/src/org/globus/cog/abstraction/xml/TaskUnmarshaller.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/xml/TaskUnmarshaller.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/xml/TaskUnmarshaller.java (working copy)
@@ -141,26 +141,27 @@
}
}
String provider = xmlService.getProvider();
+ // set the service contact
+ String serviceContact = xmlService.getServiceContact();
+ if (serviceContact != null && serviceContact.length() > 0) {
+ ServiceContact contact = new ServiceContactImpl(serviceContact
+ .trim());
+ service.setServiceContact(contact);
+ }
+
if (provider != null && provider.length() > 0) {
service.setProvider(provider.trim());
try {
- service.setSecurityContext(AbstractionFactory
- .newSecurityContext(provider));
+ service.setSecurityContext(AbstractionFactory.newSecurityContext(provider, service.getServiceContact()));
} catch (Exception e) {
throw new UnmarshalException(
"Cannot establish the appropriate security context",
e);
}
}
- // set the service contact
- String serviceContact = xmlService.getServiceContact();
- if (serviceContact != null && serviceContact.length() > 0) {
- ServiceContact contact = new ServiceContactImpl(serviceContact
- .trim());
- service.setServiceContact(contact);
- }
+
// set the service attributes
AttributeList attrList = xmlService.getAttributeList();
if (attrList != null) {
Index: modules/abstraction-common/src/org/globus/cog/abstraction/impl/file/FileResourceCache.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/impl/file/FileResourceCache.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/impl/file/FileResourceCache.java (working copy)
@@ -26,7 +26,6 @@
import org.globus.cog.abstraction.impl.common.task.InvalidProviderException;
import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
import org.globus.cog.abstraction.interfaces.FileResource;
-import org.globus.cog.abstraction.interfaces.SecurityContext;
import org.globus.cog.abstraction.interfaces.Service;
public class FileResourceCache {
@@ -115,7 +114,7 @@
throw new InvalidProviderException("Provider is null");
}
if (service.getSecurityContext() == null) {
- service.setSecurityContext(AbstractionFactory.newSecurityContext(provider));
+ service.setSecurityContext(AbstractionFactory.getSecurityContext(provider, service.getServiceContact()));
}
FileResource fileResource = AbstractionFactory
.newFileResource(provider);
Index: modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java (working copy)
@@ -8,7 +8,6 @@
import java.io.File;
import java.io.IOException;
-import java.net.MalformedURLException;
import org.apache.log4j.Logger;
import org.globus.cog.abstraction.impl.common.AbstractDelegatedTaskHandler;
@@ -20,7 +19,6 @@
import org.globus.cog.abstraction.impl.common.task.InvalidProviderException;
import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
import org.globus.cog.abstraction.impl.common.task.InvalidServiceContactException;
-import org.globus.cog.abstraction.impl.common.task.SecurityContextImpl;
import org.globus.cog.abstraction.impl.common.task.ServiceContactImpl;
import org.globus.cog.abstraction.impl.common.task.ServiceImpl;
import org.globus.cog.abstraction.impl.common.task.TaskImpl;
@@ -38,13 +36,7 @@
import org.globus.cog.abstraction.interfaces.Status;
import org.globus.cog.abstraction.interfaces.Task;
import org.globus.cog.abstraction.interfaces.TaskHandler;
-import org.globus.gsi.gssapi.auth.Authorization;
-import org.globus.gsi.gssapi.auth.HostAuthorization;
-import org.globus.io.urlcopy.UrlCopy;
-import org.globus.io.urlcopy.UrlCopyException;
import org.globus.io.urlcopy.UrlCopyListener;
-import org.globus.util.GlobusURL;
-import org.ietf.jgss.GSSCredential;
public class DelegatedFileTransferHandler extends AbstractDelegatedTaskHandler implements
Runnable, UrlCopyListener {
@@ -628,12 +620,13 @@
}
}
- private SecurityContext getSecurityContext(Service service) {
+ private SecurityContext getSecurityContext(Service service) throws InvalidProviderException, ProviderMethodException {
SecurityContext securityContext = service.getSecurityContext();
if (securityContext == null) {
- // create default credentials
- securityContext = new SecurityContextImpl();
+ return AbstractionFactory.getSecurityContext(service.getProvider(), service.getServiceContact());
}
- return securityContext;
+ else {
+ return securityContext;
+ }
}
}
\ No newline at end of file
Index: modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/AbstractionFactory.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/AbstractionFactory.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/AbstractionFactory.java (working copy)
@@ -16,6 +16,7 @@
import org.globus.cog.abstraction.impl.common.task.InvalidProviderException;
import org.globus.cog.abstraction.interfaces.FileResource;
import org.globus.cog.abstraction.interfaces.SecurityContext;
+import org.globus.cog.abstraction.interfaces.ServiceContact;
import org.globus.cog.abstraction.interfaces.TaskHandler;
/**
@@ -29,11 +30,11 @@
private static final String PROVIDER_PROP = "cog-provider.properties";
private static Logger logger = Logger.getLogger(AbstractionFactory.class);
-
- private static Map defaultCredentials;
+ public static Map> cachedSecurityContexts;
+
static {
- defaultCredentials = new HashMap();
+ cachedSecurityContexts = new HashMap>();
}
public static TaskHandler newExecutionTaskHandler()
@@ -92,11 +93,47 @@
AbstractionProperties.TYPE_FILE_RESOURCE);
}
+ /**
+ * @deprecated
+ */
public static SecurityContext newSecurityContext(String provider)
throws InvalidProviderException, ProviderMethodException {
return (SecurityContext) newObject(provider,
AbstractionProperties.TYPE_SECURITY_CONTEXT);
}
+
+ public static SecurityContext newSecurityContext(String provider, ServiceContact serviceContact)
+ throws InvalidProviderException, ProviderMethodException {
+ SecurityContext sc = (SecurityContext) newObject(provider,
+ AbstractionProperties.TYPE_SECURITY_CONTEXT);
+ sc.setServiceContact(serviceContact);
+ return sc;
+ }
+
+ /**
+ * Return a possibly cached security context
+ */
+ public static SecurityContext getSecurityContext(String provider, ServiceContact serviceContact)
+ throws InvalidProviderException, ProviderMethodException {
+ Map providerContexts;
+ synchronized(cachedSecurityContexts) {
+ providerContexts = cachedSecurityContexts.get(provider);
+ if (providerContexts == null) {
+ providerContexts = new HashMap();
+ cachedSecurityContexts.put(provider, providerContexts);
+ }
+ }
+
+ synchronized(providerContexts) {
+ SecurityContext sc = providerContexts.get(serviceContact);
+ if (sc == null) {
+ sc = newSecurityContext(provider, serviceContact);
+ providerContexts.put(serviceContact, sc);
+ }
+
+ return sc;
+ }
+ }
public static boolean hasObject(String provider, String role) {
try {
@@ -134,9 +171,11 @@
boolean useSandbox) throws InvalidProviderException,
InvalidClassException {
provider = provider.toLowerCase();
- logger
+ if (logger.isDebugEnabled()) {
+ logger
.debug("Instantiating " + className + " for provider "
+ provider);
+ }
ClassLoader cl = AbstractionFactory.class.getClassLoader();
try {
return cl.loadClass(className).newInstance();
@@ -145,14 +184,4 @@
throw new InvalidClassException(e);
}
}
-
- public synchronized static Object getDefaultCredentials(String provider) throws InvalidProviderException, ProviderMethodException {
- SecurityContext sc = defaultCredentials.get(provider);
- if (sc == null) {
- sc = newSecurityContext(provider);
- defaultCredentials.put(provider, sc);
- }
- return sc.getDefaultCredentials();
- }
-
}
\ No newline at end of file
Index: modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/task/SecurityContextImpl.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/task/SecurityContextImpl.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/task/SecurityContextImpl.java (working copy)
@@ -9,11 +9,13 @@
import java.util.HashMap;
import org.globus.cog.abstraction.interfaces.SecurityContext;
+import org.globus.cog.abstraction.interfaces.ServiceContact;
public class SecurityContextImpl implements SecurityContext {
private HashMap attributes;
private Object credentials;
private String alias;
+ private ServiceContact serviceContact;
public SecurityContextImpl() {
this.attributes = new HashMap();
@@ -88,4 +90,12 @@
public Object getDefaultCredentials() {
return null;
}
+
+ public ServiceContact getServiceContact() {
+ return serviceContact;
+ }
+
+ public void setServiceContact(ServiceContact serviceContact) {
+ this.serviceContact = serviceContact;
+ }
}
\ No newline at end of file
Index: modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/util/FileTransfer.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/util/FileTransfer.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/impl/common/util/FileTransfer.java (working copy)
@@ -122,11 +122,11 @@
else {
if (protocol.equals("gsiftp")) {
service.setProvider("GridFTP");
- securityContext = AbstractionFactory.newSecurityContext("GridFTP");
+ securityContext = AbstractionFactory.getSecurityContext("GridFTP", service.getServiceContact());
}
else if (protocol.equals("scp")) {
service.setProvider("ssh");
- securityContext = AbstractionFactory.newSecurityContext("ssh");
+ securityContext = AbstractionFactory.getSecurityContext("ssh", service.getServiceContact());
}
else {
throw new Exception("unsupported protocol: " + protocol);
Index: modules/abstraction-common/src/org/globus/cog/abstraction/interfaces/SecurityContext.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/interfaces/SecurityContext.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/interfaces/SecurityContext.java (working copy)
@@ -6,6 +6,7 @@
package org.globus.cog.abstraction.interfaces;
+import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
import org.ietf.jgss.GSSCredential;
/**
@@ -40,4 +41,8 @@
* else return null
*/
public Object getDefaultCredentials();
+
+ public void setServiceContact(ServiceContact serviceContact);
+
+ public ServiceContact getServiceContact();
}
\ No newline at end of file
Index: modules/abstraction-common/src/org/globus/cog/abstraction/examples/invocation/ServiceInvocation.java
===================================================================
--- modules/abstraction-common/src/org/globus/cog/abstraction/examples/invocation/ServiceInvocation.java (revision 3436)
+++ modules/abstraction-common/src/org/globus/cog/abstraction/examples/invocation/ServiceInvocation.java (working copy)
@@ -89,7 +89,7 @@
service.setProvider(this.provider.toLowerCase());
SecurityContext securityContext = AbstractionFactory
- .newSecurityContext(provider);
+ .getSecurityContext(provider, new ServiceContactImpl(serviceContact));
securityContext.setCredentials(null);
service.setSecurityContext(securityContext);
From swift at ci.uchicago.edu Thu Aug 2 01:40:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 01:40:03 -0500 (CDT)
Subject: [Swift-commit] cog r3439
Message-ID: <20120802064004.EC66F8D00DF2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3439 | hategan | 2012-08-02 01:38:52 -0500 (Thu, 02 Aug 2012) | 1 line
updated gt2 provider with changes from common and added proxy mapping file
------------------------------------------------------------------------
Index: modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
===================================================================
--- modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java (revision 3438)
+++ modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java (working copy)
@@ -20,10 +20,8 @@
import java.util.List;
import org.apache.log4j.Logger;
-import org.globus.cog.abstraction.impl.common.AbstractionFactory;
import org.globus.cog.abstraction.impl.common.task.IllegalSpecException;
import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
-import org.globus.cog.abstraction.impl.common.task.ServiceContactImpl;
import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
import org.globus.cog.abstraction.impl.file.DirectoryNotFoundException;
import org.globus.cog.abstraction.impl.file.FileResourceException;
@@ -92,15 +90,15 @@
private boolean bufferSizeChanged;
/** throws InvalidProviderException */
- public FileResourceImpl() throws Exception {
- this(null, new ServiceContactImpl(), AbstractionFactory
- .newSecurityContext("GridFTP"));
+ public FileResourceImpl() {
+ this(null, null, null);
}
/** constructor be used normally */
public FileResourceImpl(String name, ServiceContact serviceContact,
SecurityContext securityContext) {
- super(name == null ? serviceContact.toString() : name, "gsiftp", serviceContact, securityContext);
+ super((name == null && !(serviceContact == null)) ? serviceContact.toString() : name,
+ "gsiftp", serviceContact, securityContext);
}
/**
@@ -111,9 +109,11 @@
*/
public void start() throws IllegalHostException,
InvalidSecurityContextException, FileResourceException {
+
+ ServiceContact serviceContact = getAndCheckServiceContact();
- String host = getServiceContact().getHost();
- int port = getServiceContact().getPort();
+ String host = serviceContact.getHost();
+ int port = serviceContact.getPort();
if (port == -1) {
port = 2811;
}
@@ -123,6 +123,8 @@
}
try {
+ SecurityContext securityContext = getOrCreateSecurityContext("gsiftp", serviceContact);
+
gridFTPClient = new GridFTPClient(host, port);
Reply r = gridFTPClient.getLastReply();
@@ -140,11 +142,10 @@
if (logger.isDebugEnabled()) {
logger.debug("Data channel reuse: " + dataChannelReuse);
}
- gridFTPClient.setClientWaitParams(MAX_REPLY_WAIT_TIME,
- Session.DEFAULT_WAIT_DELAY);
- GSSCredential proxy = (GSSCredential) getSecurityContext()
- .getCredentials();
- gridFTPClient.authenticate(proxy);
+ gridFTPClient.setClientWaitParams(MAX_REPLY_WAIT_TIME, Session.DEFAULT_WAIT_DELAY);
+
+ GSSCredential cred = (GSSCredential) securityContext.getCredentials();
+ gridFTPClient.authenticate(cred);
gridFTPClient.setType(Session.TYPE_IMAGE);
if (dataChannelReuse) {
gridFTPClient.setMode(GridFTPSession.MODE_EBLOCK);
@@ -155,7 +156,7 @@
}
catch (Exception e) {
throw translateException(
- "Error communicating with the GridFTP server at " + host + ":" + port, e);
+ "Error connecting to the GridFTP server at " + host + ":" + port, e);
}
}
Index: modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/InteractiveFTPSecurityContextImpl.java
===================================================================
--- modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/InteractiveFTPSecurityContextImpl.java (revision 3438)
+++ modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/InteractiveFTPSecurityContextImpl.java (working copy)
@@ -6,33 +6,7 @@
package org.globus.cog.abstraction.impl.file.ftp;
-import java.net.PasswordAuthentication;
+import org.globus.cog.abstraction.impl.common.InteractivePasswordSecurityContextImpl;
-import org.apache.log4j.Logger;
-import org.globus.cog.abstraction.impl.common.task.SecurityContextImpl;
-
-public class InteractiveFTPSecurityContextImpl extends SecurityContextImpl {
-
- private static Logger logger = Logger
- .getLogger(InteractiveFTPSecurityContextImpl.class.getName());
-
- public InteractiveFTPSecurityContextImpl() {
- }
-
- public InteractiveFTPSecurityContextImpl(PasswordAuthentication credentials) {
- setCredentials(credentials);
- }
-
- public void setCredentials(Object credentials, String alias) {
- setCredentials(credentials);
- }
-
- public synchronized Object getCredentials() {
- Object credentials = getCredentials();
- if (credentials == null) {
- credentials = CredentialsDialog.showCredentialsDialog();
- setCredentials(credentials);
- }
- return credentials;
- }
+public class InteractiveFTPSecurityContextImpl extends InteractivePasswordSecurityContextImpl {
}
Index: modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java
===================================================================
--- modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java (revision 3438)
+++ modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java (working copy)
@@ -19,14 +19,13 @@
import java.util.List;
import org.apache.log4j.Logger;
-import org.globus.cog.abstraction.impl.common.AbstractionFactory;
import org.globus.cog.abstraction.impl.common.task.IllegalSpecException;
import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
-import org.globus.cog.abstraction.impl.common.task.ServiceContactImpl;
import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
import org.globus.cog.abstraction.impl.file.DirectoryNotFoundException;
import org.globus.cog.abstraction.impl.file.FileResourceException;
import org.globus.cog.abstraction.impl.file.GridFileImpl;
+import org.globus.cog.abstraction.impl.file.IllegalHostException;
import org.globus.cog.abstraction.interfaces.ExecutableObject;
import org.globus.cog.abstraction.interfaces.FileFragment;
import org.globus.cog.abstraction.interfaces.FileResource;
@@ -54,14 +53,21 @@
public class FileResourceImpl extends AbstractFTPFileResource {
public static final String PROTOCOL = "ftp";
+ public static final String ANONYMOUS_USERNAME = "anonymous";
+ public static final char[] ANONYMOUS_PASSWORD;
+ static {
+ String pwd = "none at example.com";
+ ANONYMOUS_PASSWORD = new char[pwd.length()];
+ pwd.getChars(0, pwd.length(), ANONYMOUS_PASSWORD, 0);
+ }
+
private FTPClient ftpClient;
public static final Logger logger = Logger.getLogger(FileResource.class
.getName());
/** throws invalidprovider exception */
- public FileResourceImpl() throws Exception {
- this(null, new ServiceContactImpl(), AbstractionFactory
- .newSecurityContext("ftp"));
+ public FileResourceImpl() {
+ this(null, null, null);
}
/** the constructor to be used normally */
@@ -76,18 +82,29 @@
* @throws FileResourceException
* if an exception occurs during the resource start-up
*/
- public void start() throws InvalidSecurityContextException,
+ public void start() throws InvalidSecurityContextException, IllegalHostException,
FileResourceException {
+ ServiceContact serviceContact = getAndCheckServiceContact();
+
+ String host = getServiceContact().getHost();
+ int port = getServiceContact().getPort();
+ if (port == -1) {
+ port = 21;
+ }
+
+ if (getName() == null) {
+ setName(host + ":" + port);
+ }
+
+
try {
- String host = getServiceContact().getHost();
- int port = getServiceContact().getPort();
- if (port == -1) {
- port = 21;
- }
+ SecurityContext securityContext = getOrCreateSecurityContext("ftp", serviceContact);
+
+ PasswordAuthentication credentials = getCredentialsAsPasswordAuthentication(securityContext);
+
ftpClient = new FTPClient(host, port);
- PasswordAuthentication credentials = (PasswordAuthentication) getSecurityContext()
- .getCredentials();
+
String username = credentials.getUserName();
String password = String.valueOf(credentials.getPassword());
@@ -95,11 +112,16 @@
ftpClient.setType(Session.TYPE_IMAGE);
setStarted(true);
}
- catch (Exception se) {
+ catch (Exception e) {
throw translateException(
- "Error while communicating with the FTP server", se);
+ "Error connecting to the FTP server at " + host + ":" + port, e);
}
}
+
+ @Override
+ protected PasswordAuthentication getDefaultUsernameAndPassword() {
+ return new PasswordAuthentication(ANONYMOUS_USERNAME, ANONYMOUS_PASSWORD);
+ }
/**
* Stop the ftpClient from connecting to the server
Index: modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/CredentialsDialog.java
===================================================================
--- modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/CredentialsDialog.java (revision 3438)
+++ modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/CredentialsDialog.java (working copy)
@@ -1,84 +0,0 @@
-//----------------------------------------------------------------------
-//This code is developed as part of the Java CoG Kit project
-//The terms of the license can be found at http://www.cogkit.org/license
-//This message may not be removed or altered.
-//----------------------------------------------------------------------
-
-package org.globus.cog.abstraction.impl.file.ftp;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.net.PasswordAuthentication;
-
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
-
-public class CredentialsDialog {
- private static final String NOTHING = "";
-
- private JOptionPane optionPane = new JOptionPane();
- private JDialog dialog;
-
- private JTextField usernameField = new JTextField();
- private JPasswordField passwordField = new JPasswordField();
-
- private PasswordAuthentication result = null;
-
- public CredentialsDialog() {
- // init sizes
- usernameField.setPreferredSize(new Dimension(125, 20));
- passwordField.setPreferredSize(new Dimension(125, 20));
-
- // the main panel
- JPanel main = new JPanel(new BorderLayout());
-
- // Labels
- JPanel labels = new JPanel(new GridLayout(0, 1));
- labels.add(new JLabel("Username: "));
- labels.add(new JLabel("Password: "));
-
- // username and password labels/fields
- JPanel fields = new JPanel(new GridLayout(0, 1));
- fields.add(usernameField);
- fields.add(passwordField);
-
- main.add(labels, BorderLayout.WEST);
- main.add(fields, BorderLayout.CENTER);
-
- optionPane.setMessage(main);
- optionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION);
- dialog = optionPane.createDialog(null, "Enter Your FTP Credentials");
- }
-
- protected synchronized void okButtonPushed() {
- String uname = usernameField.getText();
- char[] passwd = passwordField.getPassword();
- if (NOTHING.equals(uname) || NOTHING.equals(passwd)) {
- result = null;
- } else {
- result = new PasswordAuthentication(uname, passwd);
- }
- }
-
- public static PasswordAuthentication showCredentialsDialog() {
- return new CredentialsDialog().getResult();
- }
-
- public PasswordAuthentication getResult() {
- dialog.show();
- if (optionPane.getValue() != null
- && ((Integer) optionPane.getValue()).equals(new Integer(
- JOptionPane.OK_OPTION))) {
- okButtonPushed();
-
- } else {
- result = null;
- }
- return result;
- }
-}
\ No newline at end of file
Index: modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java
===================================================================
--- modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java (revision 3438)
+++ modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java (working copy)
@@ -6,9 +6,20 @@
package org.globus.cog.abstraction.impl.execution.gt2;
-import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
import org.globus.cog.abstraction.impl.common.task.SecurityContextImpl;
import org.globus.cog.abstraction.interfaces.Delegation;
+import org.globus.cog.abstraction.interfaces.ServiceContact;
+import org.globus.gsi.GlobusCredential;
+import org.globus.gsi.gssapi.GlobusGSSCredentialImpl;
import org.globus.gsi.gssapi.auth.Authorization;
import org.globus.gsi.gssapi.auth.HostAuthorization;
import org.gridforum.jgss.ExtendedGSSManager;
@@ -17,14 +28,32 @@
import org.ietf.jgss.GSSManager;
public class GlobusSecurityContextImpl extends SecurityContextImpl implements Delegation {
+ public static final Logger logger = Logger.getLogger(GlobusSecurityContextImpl.class);
+
public static final int XML_ENCRYPTION = 1;
public static final int XML_SIGNATURE = 2;
+ public static final String PROXY_HOST_PATH_MAPPING_FILE = System.getProperty("user.home") +
+ File.separator + ".globus" + File.separator + "proxy.mapping";
+
public static final int DEFAULT_CREDENTIAL_REFRESH_INTERVAL = 30000;
- private static GSSCredential cachedCredential;
- private static long credentialTime;
+ private static Map cachedCredentials = new HashMap();
+ private static Map credentialTimes = new HashMap();
+ private static Properties proxyPaths;
+
+ public GlobusSecurityContextImpl() {
+ }
+ public GlobusSecurityContextImpl(String proxyPath) {
+ if (proxyPath == null) {
+ setCredentials(getDefaultCredentials());
+ }
+ else {
+ setCredentials(loadProxyFromFile(proxyPath));
+ }
+ }
+
public void setAuthorization(Authorization authorization) {
setAttribute("authorization", authorization);
}
@@ -61,25 +90,104 @@
return value.intValue();
}
- public GSSCredential getDefaultCredential() throws InvalidSecurityContextException {
- return _getDefaultCredential();
+ public GSSCredential getDefaultCredentials() {
+ return _getDefaultCredential(getServiceContact());
}
- public static GSSCredential _getDefaultCredential() throws InvalidSecurityContextException {
- synchronized (GlobusSecurityContextImpl.class) {
- if (cachedCredential == null
- ||
- (System.currentTimeMillis() - credentialTime) > DEFAULT_CREDENTIAL_REFRESH_INTERVAL) {
- credentialTime = System.currentTimeMillis();
- GSSManager manager = ExtendedGSSManager.getInstance();
- try {
- cachedCredential = manager.createCredential(GSSCredential.INITIATE_AND_ACCEPT);
+ @Override
+ public Object getCredentials() {
+ Object credentials = super.getCredentials();
+ if (credentials == null) {
+ return getDefaultCredentials();
+ }
+ else {
+ return credentials;
+ }
+ }
+
+ public static GSSCredential _getDefaultCredential(ServiceContact serviceContact) {
+ String host = null;
+ if (serviceContact != null) {
+ // null is OK
+ host = serviceContact.getHost();
+ }
+ loadProxyPaths();
+ synchronized (cachedCredentials) {
+ GSSCredential cachedCredential = cachedCredentials.get(host);
+ Long credentialTime = credentialTimes.get(host);
+ long now = System.currentTimeMillis();
+ if (cachedCredential == null || (now - credentialTime) > DEFAULT_CREDENTIAL_REFRESH_INTERVAL) {
+ if (cachedCredential == null) {
+ if (logger.isInfoEnabled()) {
+ logger.info("No cached credentials for " + host + ".");
+ }
}
- catch (GSSException e) {
- throw new InvalidSecurityContextException(e);
+ else {
+ if (logger.isInfoEnabled()) {
+ logger.info("Credentials for " + host + " need refreshing.");
+ }
}
+ credentialTimes.put(host, now);
+ cachedCredential = loadCredential(host);
+ cachedCredentials.put(host, cachedCredential);
}
return cachedCredential;
}
}
+
+ private static GSSCredential loadCredential(String host) {
+ String proxyPath = null;
+
+ if (host != null) {
+ proxyPath = (String) proxyPaths.get(host);
+ }
+
+ if (proxyPath == null) {
+ if (logger.isInfoEnabled()) {
+ logger.info("No proxy mapping found for " + host + ". Loading default.");
+ }
+ return loadDefaultProxy();
+ }
+ else {
+ if (logger.isInfoEnabled()) {
+ logger.info("Proxy mapping found for " + host + ": " + proxyPath);
+ }
+ return loadProxyFromFile(proxyPath);
+ }
+ }
+
+ private static GSSCredential loadProxyFromFile(String proxyPath) {
+ try {
+ GlobusCredential cred = new GlobusCredential(proxyPath);
+ return new GlobusGSSCredentialImpl(cred, GSSCredential.INITIATE_AND_ACCEPT);
+ }
+ catch (Exception e) {
+ throw new SecurityException(e);
+ }
+ }
+
+ private static GSSCredential loadDefaultProxy() {
+ GSSManager manager = ExtendedGSSManager.getInstance();
+ try {
+ return manager.createCredential(GSSCredential.INITIATE_AND_ACCEPT);
+ }
+ catch (GSSException e) {
+ throw new SecurityException(e);
+ }
+ }
+
+ private static synchronized void loadProxyPaths() {
+ if (proxyPaths == null) {
+ proxyPaths = new Properties();
+ try {
+ proxyPaths.load(new FileInputStream(PROXY_HOST_PATH_MAPPING_FILE));
+ }
+ catch (FileNotFoundException e) {
+ // no mapping
+ }
+ catch (IOException e) {
+ logger.warn("Could not load host-proxy mapping file", e);
+ }
+ }
+ }
}
\ No newline at end of file
From swift at ci.uchicago.edu Thu Aug 2 01:45:05 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 01:45:05 -0500 (CDT)
Subject: [Swift-commit] cog r3443
Message-ID: <20120802064506.6517E8D00DF2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3443 | hategan | 2012-08-02 01:44:59 -0500 (Thu, 02 Aug 2012) | 1 line
properly serialize/deserialize remote exceptions instead of faking it with strings
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/RequestReply.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/RequestReply.java (revision 3442)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/RequestReply.java (working copy)
@@ -13,10 +13,9 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.io.OutputStreamWriter;
-import java.io.PrintStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -119,22 +118,30 @@
}
public void sendError(String error, Throwable e) throws ProtocolException {
- logger.info(this + " sending error: " + error, e);
+ if (logger.isInfoEnabled()) {
+ logger.info(this + " sending error: " + error, e);
+ }
if (error == null) {
if (e == null) {
error = "No message available";
}
else {
- error = e.toString();
+ error = (e.getMessage() == null ? e.toString() : e.getMessage());
}
}
this.addOutData(error.getBytes());
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- if (e != null) {
- PrintStream ps = new PrintStream(baos);
- e.printStackTrace(ps);
+ try {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ if (e != null) {
+ oos.writeObject(e);
+ }
+ oos.close();
+ this.addOutData(baos.toByteArray());
}
- this.addOutData(baos.toByteArray());
+ catch (IOException ex) {
+ logger.warn("Exception caught serializing exception", e);
+ }
send(true);
}
@@ -289,8 +296,14 @@
if (data != null && data.size() > 0) {
msg = new String(data.get(0));
if (data.size() > 1) {
- String ex = new String(data.get(1));
- exception = new RemoteException(msg, ex);
+ try {
+ ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data.get(1)));
+ exception = new RemoteException(msg, (Exception) ois.readObject());
+ ois.close();
+ }
+ catch (Exception e) {
+ logger.warn("Failed to de-serialize remote exception", e);
+ }
}
}
errorReceived(msg, exception);
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/RemoteException.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/RemoteException.java (revision 3442)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/RemoteException.java (working copy)
@@ -9,25 +9,10 @@
*/
package org.globus.cog.karajan.workflow.service;
-import java.io.PrintStream;
-import java.io.PrintWriter;
public class RemoteException extends Exception {
- private String remote;
- public RemoteException(String msg, String remote) {
- super(msg);
- this.remote = remote;
+
+ public RemoteException(String msg, Exception remote) {
+ super(msg, remote);
}
-
- public void printStackTrace(PrintStream s) {
- super.printStackTrace(s);
- s.println("Remote exception:");
- s.println(remote);
- }
-
- public void printStackTrace(PrintWriter s) {
- super.printStackTrace(s);
- s.println("Remote exception:");
- s.println(remote);
- }
}
From swift at ci.uchicago.edu Thu Aug 2 01:50:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 01:50:03 -0500 (CDT)
Subject: [Swift-commit] cog r3444
Message-ID: <20120802065004.C4BA68D00DF2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3444 | hategan | 2012-08-02 01:46:31 -0500 (Thu, 02 Aug 2012) | 1 line
new security context stuff
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/ServiceNode.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/ServiceNode.java (revision 3443)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/ServiceNode.java (working copy)
@@ -12,6 +12,7 @@
import org.apache.log4j.Logger;
import org.globus.cog.abstraction.impl.common.AbstractionFactory;
import org.globus.cog.abstraction.impl.common.AbstractionProperties;
+import org.globus.cog.abstraction.impl.common.InteractivePasswordSecurityContextImpl;
import org.globus.cog.abstraction.impl.common.task.ExecutionServiceImpl;
import org.globus.cog.abstraction.impl.common.task.ServiceContactImpl;
import org.globus.cog.abstraction.impl.common.task.ServiceImpl;
@@ -88,6 +89,15 @@
if (A_PROJECT.isPresent(stack)) {
service.setAttribute("project", TypeUtil.toString(A_PROJECT.getValue(stack)));
}
+
+ String uri = null;
+ uri = TypeUtil.toString(A_URI.getValue(stack));
+ if (uri == null) {
+ uri = TypeUtil.toString(A_URL.getValue(stack));
+ }
+ if (uri != null) {
+ service.setServiceContact(new ServiceContactImpl(uri));
+ }
SecurityContext sc = (SecurityContext) A_SECURITY_CONTEXT.getValue(stack);
if (sc == null) {
@@ -101,7 +111,7 @@
}
if (sc == null) {
try {
- sc = AbstractionFactory.newSecurityContext(provider);
+ sc = AbstractionFactory.getSecurityContext(provider, service.getServiceContact());
stack.setGlobal(scName, sc);
}
catch (Exception e1) {
@@ -112,16 +122,13 @@
}
}
}
+ else {
+ if (sc instanceof InteractivePasswordSecurityContextImpl) {
+ ((InteractivePasswordSecurityContextImpl) sc).setHostName(uri);
+ }
+ }
service.setSecurityContext(sc);
service.setType(itype);
- String uri = null;
- uri = TypeUtil.toString(A_URI.getValue(stack));
- if (uri == null) {
- uri = TypeUtil.toString(A_URL.getValue(stack));
- }
- if (uri != null) {
- service.setServiceContact(new ServiceContactImpl(uri));
- }
return service;
}
}
\ No newline at end of file
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/AbstractGridNode.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/AbstractGridNode.java (revision 3443)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/AbstractGridNode.java (working copy)
@@ -25,6 +25,7 @@
import org.globus.cog.abstraction.impl.common.task.ServiceImpl;
import org.globus.cog.abstraction.interfaces.SecurityContext;
import org.globus.cog.abstraction.interfaces.Service;
+import org.globus.cog.abstraction.interfaces.ServiceContact;
import org.globus.cog.abstraction.interfaces.Status;
import org.globus.cog.abstraction.interfaces.StatusListener;
import org.globus.cog.abstraction.interfaces.Task;
@@ -118,22 +119,21 @@
private void addDefaultServices(BoundContact bc, String contact, String provider)
throws ExecutionException {
+
+ ServiceContact serviceContact = new ServiceContactImpl(contact);
SecurityContext sc = null;
if (provider != null) {
try {
- sc = AbstractionFactory.newSecurityContext(provider);
+ sc = AbstractionFactory.getSecurityContext(provider, serviceContact);
}
catch (Exception e) {
throw new ExecutionException("Could not get default security context for provider "
+ provider, e);
}
}
- bc.addService(new ServiceImpl(provider, Service.EXECUTION, new ServiceContactImpl(contact),
- sc));
- bc.addService(new ServiceImpl(provider, Service.FILE_OPERATION, new ServiceContactImpl(
- contact), sc));
- bc.addService(new ServiceImpl(provider, Service.FILE_TRANSFER, new ServiceContactImpl(
- contact), sc));
+ bc.addService(new ServiceImpl(provider, Service.EXECUTION, serviceContact, sc));
+ bc.addService(new ServiceImpl(provider, Service.FILE_OPERATION, serviceContact, sc));
+ bc.addService(new ServiceImpl(provider, Service.FILE_TRANSFER, serviceContact, sc));
}
public static final Arg A_SECURITY_CONTEXT = new Arg.TypedPositional("securityContext",
@@ -334,7 +334,7 @@
}
}
- protected SecurityContext getSecurityContext(VariableStack stack, String provider)
+ protected SecurityContext getSecurityContext(VariableStack stack, String provider, ServiceContact serviceContact)
throws InvalidProviderException, ProviderMethodException, ExecutionException {
if (A_SECURITY_CONTEXT.isPresent(stack)) {
return (SecurityContext) A_SECURITY_CONTEXT.getValue(stack);
@@ -344,7 +344,7 @@
SecurityContext.class, "Security Context");
}
else {
- return AbstractionFactory.newSecurityContext(provider);
+ return AbstractionFactory.getSecurityContext(provider, serviceContact);
}
}
}
\ No newline at end of file
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/SecurityContextNode.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/SecurityContextNode.java (revision 3443)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/SecurityContextNode.java (working copy)
@@ -32,7 +32,7 @@
if (context == null) {
String provider = TypeUtil.toString(A_PROVIDER.getValue(stack));
try {
- context = AbstractionFactory.newSecurityContext(provider);
+ context = AbstractionFactory.getSecurityContext(provider, null);
}
catch (Exception e) {
throw new ExecutionException("Unsupported security context type: " + provider, e);
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/AbstractFileOperation.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/AbstractFileOperation.java (revision 3443)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/AbstractFileOperation.java (working copy)
@@ -56,8 +56,9 @@
}
if (scheduler == null) {
- task.setService(0, getService((BoundContact) host, provider));
- SecurityContext sc = getSecurityContext(stack, provider);
+ Service service = getService((BoundContact) host, provider);
+ task.setService(0, service);
+ SecurityContext sc = getSecurityContext(stack, provider, service.getServiceContact());
setSecurityContextIfNotLocal(task.getService(0), sc);
synchronized (this.getClass()) {
if (handler == null) {
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/GridTransfer.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/GridTransfer.java (revision 3443)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/grid/GridTransfer.java (working copy)
@@ -164,8 +164,8 @@
+ destinationContact);
}
- setSecurityContextIfNotLocal(s, getSecurityContext(stack, s.getProvider()));
- setSecurityContextIfNotLocal(d, getSecurityContext(stack, d.getProvider()));
+ setSecurityContextIfNotLocal(s, getSecurityContext(stack, s.getProvider(), s.getServiceContact()));
+ setSecurityContextIfNotLocal(d, getSecurityContext(stack, d.getProvider(), d.getServiceContact()));
task.setService(Service.FILE_TRANSFER_SOURCE_SERVICE, s);
task.setService(Service.FILE_TRANSFER_DESTINATION_SERVICE, d);
From hategan at ci.uchicago.edu Thu Aug 2 17:47:22 2012
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 17:47:22 -0500 (CDT)
Subject: [Swift-commit] r5886 -
branches/release-0.93/src/org/griphyn/vdl/karajan/lib/swiftscript
Message-ID: <20120802224722.BFE239CC82@svn.ci.uchicago.edu>
Author: hategan
Date: 2012-08-02 17:47:22 -0500 (Thu, 02 Aug 2012)
New Revision: 5886
Modified:
branches/release-0.93/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
fixed @length
Modified: branches/release-0.93/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- branches/release-0.93/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java 2012-08-01 20:13:28 UTC (rev 5885)
+++ branches/release-0.93/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java 2012-08-02 22:47:22 UTC (rev 5886)
@@ -396,7 +396,9 @@
*/
public DSHandle swiftscript_length(VariableStack stack)
throws ExecutionException {
- Map, ?> n = (Map, ?>) PA_ARRAY.getValue(stack);
+ AbstractDataNode array = (AbstractDataNode) PA_ARRAY.getValue(stack);
+ array.waitFor();
+ Map, ?> n = array.getArrayValue();
return RootDataNode.newNode(Types.INT, Integer.valueOf(n.size()));
}
From hategan at ci.uchicago.edu Thu Aug 2 17:47:42 2012
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 17:47:42 -0500 (CDT)
Subject: [Swift-commit] r5887 -
branches/release-0.93.1/src/org/griphyn/vdl/karajan/lib/swiftscript
Message-ID: <20120802224742.9C1A69CC82@svn.ci.uchicago.edu>
Author: hategan
Date: 2012-08-02 17:47:42 -0500 (Thu, 02 Aug 2012)
New Revision: 5887
Modified:
branches/release-0.93.1/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
fixed @length
Modified: branches/release-0.93.1/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- branches/release-0.93.1/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java 2012-08-02 22:47:22 UTC (rev 5886)
+++ branches/release-0.93.1/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java 2012-08-02 22:47:42 UTC (rev 5887)
@@ -396,7 +396,9 @@
*/
public DSHandle swiftscript_length(VariableStack stack)
throws ExecutionException {
- Map, ?> n = (Map, ?>) PA_ARRAY.getValue(stack);
+ AbstractDataNode array = (AbstractDataNode) PA_ARRAY.getValue(stack);
+ array.waitFor();
+ Map, ?> n = array.getArrayValue();
return RootDataNode.newNode(Types.INT, Integer.valueOf(n.size()));
}
From hategan at ci.uchicago.edu Thu Aug 2 17:48:48 2012
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 17:48:48 -0500 (CDT)
Subject: [Swift-commit] r5888 -
branches/release-0.93/tests/language-behaviour/arrays
Message-ID: <20120802224848.BB15C9CC82@svn.ci.uchicago.edu>
Author: hategan
Date: 2012-08-02 17:48:48 -0500 (Thu, 02 Aug 2012)
New Revision: 5888
Added:
branches/release-0.93/tests/language-behaviour/arrays/030-array-length.check.sh
branches/release-0.93/tests/language-behaviour/arrays/030-array-length.swift
Log:
added @length test
Added: branches/release-0.93/tests/language-behaviour/arrays/030-array-length.check.sh
===================================================================
--- branches/release-0.93/tests/language-behaviour/arrays/030-array-length.check.sh (rev 0)
+++ branches/release-0.93/tests/language-behaviour/arrays/030-array-length.check.sh 2012-08-02 22:48:48 UTC (rev 5888)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+cat 030-array-length.out | grep "SwiftScript trace: 3" || exit 1
+exit 0
Property changes on: branches/release-0.93/tests/language-behaviour/arrays/030-array-length.check.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/release-0.93/tests/language-behaviour/arrays/030-array-length.swift
===================================================================
--- branches/release-0.93/tests/language-behaviour/arrays/030-array-length.swift (rev 0)
+++ branches/release-0.93/tests/language-behaviour/arrays/030-array-length.swift 2012-08-02 22:48:48 UTC (rev 5888)
@@ -0,0 +1,3 @@
+int a[] = [1, 2, 3];
+
+trace(@length(a));
\ No newline at end of file
From hategan at ci.uchicago.edu Thu Aug 2 17:49:31 2012
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Thu, 2 Aug 2012 17:49:31 -0500 (CDT)
Subject: [Swift-commit] r5889 -
branches/release-0.93.1/tests/language-behaviour/arrays
Message-ID: <20120802224931.B327C9CC82@svn.ci.uchicago.edu>
Author: hategan
Date: 2012-08-02 17:49:31 -0500 (Thu, 02 Aug 2012)
New Revision: 5889
Added:
branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.check.sh
branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.swift
Log:
added @length test
Added: branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.check.sh
===================================================================
--- branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.check.sh (rev 0)
+++ branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.check.sh 2012-08-02 22:49:31 UTC (rev 5889)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+cat 030-array-length.out | grep "SwiftScript trace: 3" || exit 1
+exit 0
Property changes on: branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.check.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.swift
===================================================================
--- branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.swift (rev 0)
+++ branches/release-0.93.1/tests/language-behaviour/arrays/030-array-length.swift 2012-08-02 22:49:31 UTC (rev 5889)
@@ -0,0 +1,3 @@
+int a[] = [1, 2, 3];
+
+trace(@length(a));
\ No newline at end of file
From davidk at ci.uchicago.edu Fri Aug 3 15:26:46 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 3 Aug 2012 15:26:46 -0500 (CDT)
Subject: [Swift-commit] r5890 - in SwiftApps/CMTS/rmsd: . docs/figures
Message-ID: <20120803202646.706509CC9C@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-03 15:26:46 -0500 (Fri, 03 Aug 2012)
New Revision: 5890
Added:
SwiftApps/CMTS/rmsd/docs/figures/fig-distrib.png
SwiftApps/CMTS/rmsd/docs/figures/fig-local.png
SwiftApps/CMTS/rmsd/docs/figures/fig-multilocal.png
Removed:
SwiftApps/CMTS/rmsd/docs/figures/fig.distrib.png
SwiftApps/CMTS/rmsd/docs/figures/fig.local.png
SwiftApps/CMTS/rmsd/docs/figures/fig.multilocal.png
Modified:
SwiftApps/CMTS/rmsd/README
Log:
Some updates to README for running across multiple sites
PDF generation was choking on image names in the format of first.second.png - renamed figures
Modified: SwiftApps/CMTS/rmsd/README
===================================================================
--- SwiftApps/CMTS/rmsd/README 2012-08-02 22:49:31 UTC (rev 5889)
+++ SwiftApps/CMTS/rmsd/README 2012-08-03 20:26:46 UTC (rev 5890)
@@ -4,12 +4,11 @@
Prerequisites
-------------
This README will assume that runs will be started from
-makena.uchicago.edu.
+makena.uchicago.edu or grotthuss.uchicago.edu
Please ensure that namd2, vmd, and Swift are in your $PATH. These
applications must be available from the Makena worker
-nodes (applications kept in /state do not seem to be
-available by the worker nodes).
+nodes.
Add the following line to $HOME/.bashrc to set the PATH:
-----
@@ -41,15 +40,20 @@
svn update
-----
-How to Run
-----------
+Running Single Site Jobs
+------------------------
+For single site jobs, it is assumed that you are connected to the head node
+where you will be doing the run.
+
+image:figures/fig-local.png["Local", height=390, width=664]
+
The runrmsd.sh script is used to start a run. The options you pass to
this script will determine how the rmsd script runs.
Usage: runrmsd.sh [-s sitename]
-The sitename option determines where a run will take place. Currently, the
-only tested option is "makena".
+The sitename option determines where a run will take place. Currently,
+there are valid options here are "makena" and "grotthuss".
Example:
@@ -72,3 +76,39 @@
Within each run directory is a subdirectory called logs. This directory contains
the standard output and standard error logs from each namd task. If you notice a job
is failing, reference these files for more detail about what went wrong.
+
+Running Remote and Multisite Jobs
+---------------------------------
+It is possible to run this script remotely across multiple sites at once. For example, a test
+configuration exists called "makgroth" which runs jobs on both Makena and Grotthuss at the same time.
+
+Here is an example of what a configuration might look like.
+
+image:figures/fig-distrib.png["Distributed Configuration", width=700]
+
+There are two requirements for this: SSH agent forwarding must be used, and a grid certificate
+must be in place on each of the machines involved.
+
+The easiest way to set up SSH agent forwarding is to use the "-A" option to ssh. In this
+example, let us assume that we will be running Swift on a machine called
+bridled.ci.uchicago.edu, and sending work to grotthuss and makena.
+
+My laptop is the machine that has the my SSH key. When I connect to bridled, I run this command:
+
+-----
+ssh -A bridled.ci.uchicago.edu
+-----
+
+This will enable me to bring my SSH key to the makena and grotthuss head nodes easily. You must also
+have $HOME/.ssh/authorized_keys setup correctly on makena/grotthuss to avoid getting prompted for a
+password.
+
+The second thing that will be needed is a grid certificate. You have have the environment variables
+X509_CERT_DIR and X509_USER_PROXY set up to point to your certificates directory and proxy.
+
+Once this is all set up, performing the run is very similar to how you run single site jobs.
+
+-----
+./runrmsd.sh -s makgroth
+-----
+
Copied: SwiftApps/CMTS/rmsd/docs/figures/fig-distrib.png (from rev 5889, SwiftApps/CMTS/rmsd/docs/figures/fig.distrib.png)
===================================================================
(Binary files differ)
Copied: SwiftApps/CMTS/rmsd/docs/figures/fig-local.png (from rev 5889, SwiftApps/CMTS/rmsd/docs/figures/fig.local.png)
===================================================================
(Binary files differ)
Copied: SwiftApps/CMTS/rmsd/docs/figures/fig-multilocal.png (from rev 5889, SwiftApps/CMTS/rmsd/docs/figures/fig.multilocal.png)
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/rmsd/docs/figures/fig.distrib.png
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/rmsd/docs/figures/fig.local.png
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/rmsd/docs/figures/fig.multilocal.png
===================================================================
(Binary files differ)
From davidk at ci.uchicago.edu Mon Aug 6 10:56:44 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 6 Aug 2012 10:56:44 -0500 (CDT)
Subject: [Swift-commit] r5891 - trunk/bin
Message-ID: <20120806155644.7259C9CC9C@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-06 10:56:43 -0500 (Mon, 06 Aug 2012)
New Revision: 5891
Modified:
trunk/bin/start-coaster-service
Log:
Add condor accounting groups for UC3
Modified: trunk/bin/start-coaster-service
===================================================================
--- trunk/bin/start-coaster-service 2012-08-03 20:26:46 UTC (rev 5890)
+++ trunk/bin/start-coaster-service 2012-08-06 15:56:43 UTC (rev 5891)
@@ -283,6 +283,7 @@
notification = Never
leave_in_queue = FALSE
machine_count = $CONDOR_MACHINE_COUNT
++AccountingGroup="group_friends.$USER"
queue $CONDOR_WORKERS
EOF
From swift at ci.uchicago.edu Mon Aug 6 23:35:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Mon, 6 Aug 2012 23:35:03 -0500 (CDT)
Subject: [Swift-commit] cog r3445
Message-ID: <20120807043504.167918D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3445 | hategan | 2012-08-06 23:33:58 -0500 (Mon, 06 Aug 2012) | 1 line
added a file locking class based on the bakery algorithm (so it doesn't need support from the FS -- in theory)
------------------------------------------------------------------------
Index: modules/util/src/org/globus/cog/util/concurrent/FileLock.java
===================================================================
--- modules/util/src/org/globus/cog/util/concurrent/FileLock.java (revision 0)
+++ modules/util/src/org/globus/cog/util/concurrent/FileLock.java (revision 3445)
@@ -0,0 +1,190 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Aug 5, 2012
+ */
+package org.globus.cog.util.concurrent;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.security.SecureRandom;
+import java.util.Random;
+
+import org.apache.log4j.Logger;
+
+/**
+ * An implementation of file locks using Lamport's Bakery algorithm.
+ * It tries to use the PID as thread identifier with fallback to random numbers.
+ *
+ * The Entering and Number arrays are implemented as sparse arrays of
+ * files in some directory.
+ */
+public class FileLock {
+ public static final Logger logger = Logger.getLogger(FileLock.class);
+
+ public static final String NUMBER = "locking.number";
+ public static final String ENTERING = "locking.entering";
+
+ private int myId, myN;
+ private File dir;
+
+ public FileLock(String dir) {
+ this(new File(dir));
+ }
+
+ public FileLock(File dir) {
+ this.dir = dir;
+ dir.mkdirs();
+ this.myId = getId();
+ }
+
+ private int getId() {
+ try {
+ return Integer.parseInt(new File("/proc/self").getCanonicalFile().getName());
+ }
+ catch (Exception e) {
+ logger.warn("Failed to get PID of current process", e);
+ try {
+ SecureRandom rnd = SecureRandom.getInstance("SHA1PRNG");
+ return rnd.nextInt() & 0x7fffffff;
+ }
+ catch (Exception ee) {
+ logger.warn("Failed to get instance of SHA1PRNG", ee);
+ return new Random().nextInt() & 0x7fffffff;
+ }
+ }
+ }
+
+ public void lock() throws IOException, InterruptedException {
+ write(ENTERING, myId, 1);
+ write(NUMBER, myId, myN = 1 + maxNumber());
+ write(ENTERING, myId, 0);
+ waitOther();
+ }
+
+ private void waitOther() throws InterruptedException {
+ int last = -1;
+ while (true) {
+ int minIndex = getMinIndex(last);
+
+ if (minIndex == Integer.MAX_VALUE) {
+ // all remaining NUMBER[j] and ENTERING[j] are 0
+ break;
+ }
+ File e = makeFile(ENTERING, minIndex);
+
+ while (e.exists()) {
+ Thread.sleep(100);
+ }
+
+ File n = makeFile(NUMBER, minIndex);
+
+ while (n.exists()) {
+ int nj = read(n);
+ if (nj > myN || ((nj == myN) && (minIndex >= myId))) {
+ break;
+ }
+ Thread.sleep(100);
+ }
+ last = minIndex;
+ }
+ }
+
+ private File makeFile(String prefix, int index) {
+ return new File(dir, prefix + "." + index);
+ }
+
+ private int getMinIndex(final int greaterThan) {
+ File[] numbers = dir.listFiles(new FileFilter() {
+ @Override
+ public boolean accept(File f) {
+ String name = f.getName();
+ return f.isFile() && (name.startsWith(NUMBER) || name.startsWith(ENTERING)) && (getIndex(f) > greaterThan);
+ }
+ });
+ int min = Integer.MAX_VALUE;
+ for (File n : numbers) {
+ int in = getIndex(n);
+ if (in < min) {
+ min = in;
+ }
+ }
+ return min;
+ }
+
+ private int getIndex(File n) {
+ try {
+ return Integer.parseInt(n.getName().substring(n.getName().lastIndexOf('.') + 1));
+ }
+ catch (Exception e) {
+ throw new IllegalArgumentException("A file is conflicting with directory locking: " + n, e);
+ }
+ }
+
+ private int maxNumber() {
+ File[] numbers = dir.listFiles(new FileFilter() {
+ @Override
+ public boolean accept(File f) {
+ return f.isFile() && f.getName().startsWith(NUMBER);
+ }
+ });
+
+ int max = 0;
+ for (File n : numbers) {
+ int in = read(n);
+ if (in > max) {
+ max = in;
+ }
+ }
+ return max;
+ }
+
+ private int read(File n) {
+ try {
+ BufferedReader br = new BufferedReader(new FileReader(n));
+ try {
+ return Integer.parseInt(br.readLine());
+ }
+ finally {
+ br.close();
+ }
+ }
+ catch (Exception e) {
+ // nothing. The algorithm tolerates incorrect reads
+ }
+ return 0;
+ }
+
+ private void write(String prefix, int id, int value) throws IOException {
+ File f = new File(dir, prefix + "." + id);
+ if (value == 0) {
+ if (!f.delete()) {
+ f.deleteOnExit();
+ throw new IOException("Failed to delete " + f);
+ }
+ }
+ else {
+ BufferedWriter br = new BufferedWriter(new FileWriter(f));
+ try {
+ br.write(String.valueOf(value));
+ }
+ finally {
+ br.close();
+ }
+ f.deleteOnExit();
+ }
+ }
+
+ public void unlock() throws IOException {
+ write("locking.number", myId, 0);
+ }
+}
From swift at ci.uchicago.edu Mon Aug 6 23:40:04 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Mon, 6 Aug 2012 23:40:04 -0500 (CDT)
Subject: [Swift-commit] cog r3447
Message-ID: <20120807044005.CBEB98D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3447 | hategan | 2012-08-06 23:37:37 -0500 (Mon, 06 Aug 2012) | 1 line
added an automatic CA/user cert/proxy generator which gets used when SSH is the boot handler
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/AutoCA.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/AutoCA.java (revision 0)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/AutoCA.java (revision 3447)
@@ -0,0 +1,354 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Aug 5, 2012
+ */
+package org.globus.cog.abstraction.impl.execution.coaster;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.security.GeneralSecurityException;
+import java.security.KeyPair;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.SecureRandom;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.bouncycastle.asn1.ASN1InputStream;
+import org.bouncycastle.asn1.ASN1Sequence;
+import org.bouncycastle.asn1.DEREncodable;
+import org.bouncycastle.asn1.DERObject;
+import org.bouncycastle.asn1.DERObjectIdentifier;
+import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.KeyUsage;
+import org.bouncycastle.asn1.x509.SubjectKeyIdentifier;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.asn1.x509.X509Extensions;
+import org.bouncycastle.asn1.x509.X509Name;
+import org.bouncycastle.x509.X509V3CertificateGenerator;
+import org.globus.cog.util.concurrent.FileLock;
+import org.globus.gsi.CertUtil;
+import org.globus.gsi.GSIConstants;
+import org.globus.gsi.GlobusCredential;
+import org.globus.gsi.OpenSSLKey;
+import org.globus.gsi.X509ExtensionSet;
+import org.globus.gsi.bc.BouncyCastleCertProcessingFactory;
+import org.globus.gsi.bc.BouncyCastleOpenSSLKey;
+import org.globus.util.Util;
+
+/**
+ * A class to automatically generate:
+ * - a CA key/cert pair
+ * - a user key/cert pair signed by the above CA
+ * - a proxy certificate signed by the above user key
+ *
+ * This is heavily inspired by http://code.google.com/p/java-simple-ca/
+ *
+ */
+public class AutoCA {
+ public static final Logger logger = Logger.getLogger(AutoCA.class);
+
+ public static final String CA_DIR = System.getProperty("user.home") + File.separator
+ + ".globus" + File.separator + "coasters";
+ public static final String CA_CRT_NAME_PREFIX = "CAcert";
+ public static final String CA_KEY_NAME_PREFIX = "CAkey";
+ public static final String USER_CRT_NAME_PREFIX = "usercert";
+ public static final String USER_KEY_NAME_PREFIX = "userkey";
+ public static final String PROXY_NAME_PREFIX = "proxy";
+
+ public static final String CA_CERT_ALGORITHM = "RSA";
+ public static final int CA_CERT_BITS = 1024;
+ public static final String CA_CERT_DN = "C=US,O=JavaCoG,OU=AutoCA,CN=Certificate Authority";
+ public static final String USER_CERT_DN = "C=US,O=JavaCoG,OU=AutoCA,CN=User";
+ public static final String CA_CERT_SIGNATURE_ALGORITHM = "SHA1WithRSAEncryption";
+
+ public static final long WEEK_IN_MS = 1000 * 3600 * 24 * 7;
+ public static final long CA_CERT_LIFETIME = 2 * WEEK_IN_MS;
+ public static final long MIN_CA_CERT_LIFETIME_LEFT = WEEK_IN_MS;
+
+ public static final int ID_BYTES = 4;
+
+ private static AutoCA instance;
+ private Info info;
+ private X509Certificate cert;
+ private X509V3CertificateGenerator gen;
+
+ public synchronized static AutoCA getInstance() {
+ if (instance == null) {
+ instance = new AutoCA();
+ }
+ return instance;
+ }
+
+ public AutoCA() {
+ gen = new X509V3CertificateGenerator();
+ }
+
+ public static class Info {
+ public final String proxyPath, caCertPath;
+
+ public Info(File proxyFile, File caCertFile) {
+ this(proxyFile.getAbsolutePath(), caCertFile.getAbsolutePath());
+ }
+
+ public Info(String proxyPath, String caCertPath) {
+ this.proxyPath = proxyPath;
+ this.caCertPath = caCertPath;
+ }
+ }
+
+ public Info createProxy() throws IOException, GeneralSecurityException {
+ ensureCACertsExist();
+ return info;
+ }
+
+ private void ensureCACertsExist() throws IOException, GeneralSecurityException {
+ // delete expired CAs, make a new one if the existing ones don't have
+ // at least MIN_CA_LIFETIME_LEFT
+ FileLock fl = new FileLock(CA_DIR);
+ try {
+ fl.lock();
+ }
+ catch (Exception e) {
+ logger.warn("Failed to lock CA dir", e);
+ }
+ try {
+ File[] certs = discoverProxies();
+ long now = System.currentTimeMillis();
+ long maxExpirationTime = 0;
+
+ for (File c : certs) {
+ if (logger.isInfoEnabled()) {
+ logger.info("Checking certificate " + c);
+ }
+ X509Certificate cert = CertUtil.loadCertificate(c.getAbsolutePath());
+ long certExpirationTime = cert.getNotAfter().getTime();
+ if (certExpirationTime < now) {
+ // delete cert and key
+ if (logger.isInfoEnabled()) {
+ logger.info("Certificate expired. Deleting.");
+ }
+ deleteAll(getIndex(c));
+ }
+ if (certExpirationTime > maxExpirationTime) {
+ maxExpirationTime = certExpirationTime;
+ int index = getIndex(c);
+ this.info = new Info(makeFile(PROXY_NAME_PREFIX, index), makeFile(CA_CRT_NAME_PREFIX, index));
+ this.cert = cert;
+ }
+ }
+
+ if (now + MIN_CA_CERT_LIFETIME_LEFT > maxExpirationTime) {
+ int index = discoverNextIndex();
+ this.info = new Info(makeFile(PROXY_NAME_PREFIX, index), makeFile(CA_CRT_NAME_PREFIX, index));
+ if (logger.isInfoEnabled()) {
+ logger.info("No certificates with enough lifetime. Creating new certificate: " + info.proxyPath);
+ }
+ this.cert = createAll(index);
+ }
+ else {
+ if (logger.isInfoEnabled()) {
+ logger.info("Using certificate " + info.proxyPath + " with expiration date " + this.cert.getNotAfter());
+ }
+ }
+ }
+ finally {
+ fl.unlock();
+ }
+ }
+
+ private File makeFile(String prefix, int index) {
+ return new File(CA_DIR + File.separator + prefix + ".pem." + index);
+ }
+
+ private static final String[] ALL_NAMES = new String[] {CA_CRT_NAME_PREFIX,
+ CA_KEY_NAME_PREFIX, USER_CRT_NAME_PREFIX, USER_KEY_NAME_PREFIX, PROXY_NAME_PREFIX};
+ private void deleteAll(int index) {
+ for (String name : ALL_NAMES) {
+ new File(CA_DIR + File.separator + name + ".pem." + index).delete();
+ }
+ }
+
+ private int getIndex(File c) {
+ return Integer.parseInt(c.getName().substring(c.getName().lastIndexOf('.') + 1));
+ }
+
+ private int discoverNextIndex() throws GeneralSecurityException {
+ for (int i = 0; i < 10; i++) {
+ File f = new File(CA_DIR + File.separator + PROXY_NAME_PREFIX + ".pem." + i);
+ if (!f.exists()) {
+ return i;
+ }
+ }
+ throw new GeneralSecurityException("No slots found to save CA certificate");
+ }
+
+ private File[] discoverProxies() {
+ return new File(CA_DIR).listFiles(new FileFilter() {
+ public boolean accept(File f) {
+ return f.isFile() && f.getName().matches(PROXY_NAME_PREFIX + "\\.pem\\.[0-9]");
+ }
+ });
+ }
+
+ private X509Certificate createAll(int index) throws GeneralSecurityException, IOException {
+ logger.info("Generating CA key pair");
+ KeyPair ca = CertUtil.generateKeyPair(CA_CERT_ALGORITHM, CA_CERT_BITS);
+ OpenSSLKey caKey = new BouncyCastleOpenSSLKey(ca.getPrivate());
+ logger.info("Self-signing CA certificate");
+ X509Certificate caCert = genCert(ca.getPrivate(), ca.getPublic(), CA_CERT_DN, CA_CERT_DN, null);
+
+ logger.info("Generating user key pair");
+ KeyPair user = CertUtil.generateKeyPair(CA_CERT_ALGORITHM, CA_CERT_BITS);
+ OpenSSLKey userKey = new BouncyCastleOpenSSLKey(user.getPrivate());
+ logger.info("Signing user certificate");
+ X509Certificate userCert = genCert(ca.getPrivate(), user.getPublic(), USER_CERT_DN, CA_CERT_DN,
+ createExtensions(ca.getPublic(), user.getPublic()));
+ logger.info("Generating proxy certificate");
+ GlobusCredential proxy = makeProxy(user, userCert);
+
+ try {
+ logger.info("Writing keys, certificates, and proxy");
+ writeKey(caKey, makeFile(CA_KEY_NAME_PREFIX, index));
+ writeCert(caCert, makeFile(CA_CRT_NAME_PREFIX, index));
+ writeKey(userKey, makeFile(USER_KEY_NAME_PREFIX, index));
+ writeCert(userCert, makeFile(USER_CRT_NAME_PREFIX, index));
+ writeProxy(proxy, makeFile(PROXY_NAME_PREFIX, index));
+ }
+ catch (GeneralSecurityException e) {
+ deleteAll(index);
+ throw e;
+ }
+ return cert;
+ }
+
+ private Map createExtensions(PublicKey caPub, PublicKey userPub) throws IOException {
+ Map ext = new HashMap();
+
+ // not a CA
+ ext.put(X509Extensions.BasicConstraints, new BasicConstraints(false));
+ // obvious
+ ext.put(X509Extensions.KeyUsage, new KeyUsage(KeyUsage.dataEncipherment | KeyUsage.digitalSignature));
+ ext.put(X509Extensions.SubjectKeyIdentifier, getSubjectKeyInfo(userPub));
+ ext.put(X509Extensions.AuthorityKeyIdentifier, getAuthorityKeyIdentifier(caPub));
+
+ return ext;
+ }
+
+
+
+ private DEREncodable getAuthorityKeyIdentifier(PublicKey caPub) throws IOException {
+ DERObject derKey = new ASN1InputStream(caPub.getEncoded()).readObject();
+ return new AuthorityKeyIdentifier(new SubjectPublicKeyInfo((ASN1Sequence) derKey));
+ }
+
+ private DEREncodable getSubjectKeyInfo(PublicKey userPub) throws IOException {
+ // convert key to bouncy castle format and get subject key identifier
+ DERObject derKey = new ASN1InputStream(userPub.getEncoded()).readObject();
+ return new SubjectKeyIdentifier(new SubjectPublicKeyInfo((ASN1Sequence) derKey));
+ }
+
+ private void signCert(X509Certificate userCert, OpenSSLKey caKey, X509Certificate caCert) {
+ gen.reset();
+ }
+
+ private GlobusCredential makeProxy(KeyPair kp, X509Certificate issuerCert) throws GeneralSecurityException {
+ BouncyCastleCertProcessingFactory factory = BouncyCastleCertProcessingFactory.getDefault();
+ KeyPair newKeyPair = CertUtil.generateKeyPair(CA_CERT_ALGORITHM, CA_CERT_BITS);
+
+ return factory.createCredential(new X509Certificate[] { issuerCert },
+ kp.getPrivate(), CA_CERT_BITS, (int) (CA_CERT_LIFETIME / 1000), GSIConstants.DELEGATION_FULL,
+ (X509ExtensionSet) null);
+ }
+
+ private void writeProxy(GlobusCredential proxy, File f) throws GeneralSecurityException {
+ try {
+ OutputStream fw = openStream(f);
+ try {
+ proxy.save(fw);
+ }
+ finally {
+ fw.close();
+ }
+ }
+ catch (Exception e) {
+ throw new GeneralSecurityException("Failed to save proxy certificate", e);
+ }
+ }
+
+ private OutputStream openStream(File f) throws SecurityException, IOException {
+ String path = f.getAbsolutePath();
+ File file = Util.createFile(path);
+ // set read only permissions
+ if (!Util.setOwnerAccessOnly(path)) {
+ logger.warn("Failed to set permissions on " + path);
+ }
+ return new FileOutputStream(file);
+ }
+
+ private void writeCert(X509Certificate cert, File f) throws GeneralSecurityException {
+ try {
+ OutputStream fw = openStream(f);
+ CertUtil.writeCertificate(fw, cert);
+ }
+ catch (Exception e) {
+ throw new GeneralSecurityException("Failed to save X509 certificate", e);
+ }
+ }
+
+ private X509Certificate genCert(PrivateKey signKey, PublicKey pubKey, String subjectDN, String issuerDN,
+ Map ext) throws GeneralSecurityException {
+ gen.reset();
+ Date now = new Date();
+
+ gen.setSerialNumber(BigInteger.valueOf(0));
+ gen.setNotBefore(now);
+ gen.setNotAfter(new Date(now.getTime() + CA_CERT_LIFETIME));
+ gen.setIssuerDN(new X509Name(issuerDN));
+ gen.setSubjectDN(new X509Name(subjectDN));
+ gen.setPublicKey(pubKey);
+ gen.setSignatureAlgorithm(CA_CERT_SIGNATURE_ALGORITHM);
+
+ if (ext != null) {
+ for (Map.Entry e : ext.entrySet()) {
+ gen.addExtension(e.getKey(), false, e.getValue());
+ }
+ }
+
+ try {
+ X509Certificate cert = gen.generateX509Certificate(signKey, "BC", new SecureRandom());
+ return cert;
+ }
+ catch (Exception e) {
+ throw new GeneralSecurityException("Failed to create X509 certificate", e);
+ }
+ }
+
+ private void writeKey(OpenSSLKey key, File f) throws GeneralSecurityException {
+ try {
+ OutputStream keyStream = openStream(f);
+ try {
+ key.writeTo(keyStream);
+ }
+ finally {
+ keyStream.close();
+ }
+ }
+ catch (Exception e) {
+ throw new GeneralSecurityException("Failed to save CA private key", e);
+ }
+ }
+}
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/JobSubmissionTaskHandler.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/JobSubmissionTaskHandler.java (revision 3446)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/JobSubmissionTaskHandler.java (working copy)
@@ -19,7 +19,6 @@
import org.globus.cog.abstraction.coaster.service.local.LocalRequestManager;
import org.globus.cog.abstraction.coaster.service.local.LocalService;
import org.globus.cog.abstraction.impl.common.AbstractDelegatedTaskHandler;
-import org.globus.cog.abstraction.impl.common.AbstractionFactory;
import org.globus.cog.abstraction.impl.common.StatusImpl;
import org.globus.cog.abstraction.impl.common.task.ExecutionServiceImpl;
import org.globus.cog.abstraction.impl.common.task.IllegalSpecException;
@@ -32,7 +31,6 @@
import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
import org.globus.cog.abstraction.interfaces.ExecutionService;
import org.globus.cog.abstraction.interfaces.JobSpecification;
-import org.globus.cog.abstraction.interfaces.SecurityContext;
import org.globus.cog.abstraction.interfaces.Service;
import org.globus.cog.abstraction.interfaces.Status;
import org.globus.cog.abstraction.interfaces.Task;
@@ -117,7 +115,6 @@
ChannelException {
if (autostart) {
String provider = getBootHandlerProvider(task);
- cred = getCredentials(task);
url = ServiceManager.getDefault().reserveService(task, provider);
task.getService(0).setAttribute("coaster-url", url);
}
@@ -217,20 +214,6 @@
return js.getEnvironmentVariable("JAVA_HOME");
}
- private GSSCredential getCredentials(Task task) throws InvalidSecurityContextException {
- SecurityContext sc = task.getService(0).getSecurityContext();
- if (sc == null || sc.getCredentials() == null) {
- try {
- sc = AbstractionFactory.getSecurityContext("gt2", task.getService(0).getServiceContact());
- task.getService(0).setSecurityContext(sc);
- }
- catch (Exception e) {
- throw new InvalidSecurityContextException(e);
- }
- }
- return (GSSCredential) sc.getCredentials();
- }
-
public void errorReceived(Command cmd, String msg, Exception t) {
Status s = new StatusImpl(Status.FAILED, msg, t);
getTask().setStatus(s);
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java (revision 3446)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java (working copy)
@@ -14,6 +14,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
+import java.security.GeneralSecurityException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.HashMap;
@@ -53,6 +54,7 @@
import org.globus.cog.karajan.workflow.service.channels.KarajanChannel;
import org.globus.cog.karajan.workflow.service.commands.Command;
import org.globus.cog.karajan.workflow.service.commands.Command.Callback;
+import org.globus.common.CoGProperties;
import org.ietf.jgss.GSSCredential;
public class ServiceManager implements StatusListener {
@@ -164,11 +166,20 @@
try {
startLocalService();
final Task t = buildTask(service);
- setSecurityContext(t, sc, bootHandlerProvider);
+
t.addStatusListener(this);
if (logger.isDebugEnabled()) {
logger.debug("Starting coaster service on " + contact + ". Task is " + t);
}
+
+ boolean ssh = "ssh".equalsIgnoreCase(bootHandlerProvider);
+
+ if (ssh) {
+ setupGSIProxy();
+ }
+
+ setSecurityContext(t, sc, bootHandlerProvider);
+
boolean local = "local".equals(bootHandlerProvider);
if (LOCALJVM || (LOCALJVM_WHEN_LOCAL && local)) {
final String ls = getLocalServiceURL();
@@ -200,6 +211,12 @@
}
}
+ private void setupGSIProxy() throws IOException, GeneralSecurityException {
+ AutoCA.Info result = AutoCA.getInstance().createProxy();
+ CoGProperties.getDefault().setProxyFile(result.proxyPath);
+ CoGProperties.getDefault().setCaCertLocations(result.caCertPath);
+ }
+
private void setSecurityContext(Task t, SecurityContext sc, String provider)
throws InvalidProviderException, ProviderMethodException {
t.getService(0).setSecurityContext(AbstractionFactory.getSecurityContext(provider, t.getService(0).getServiceContact()));
From davidk at ci.uchicago.edu Wed Aug 8 10:11:32 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 8 Aug 2012 10:11:32 -0500 (CDT)
Subject: [Swift-commit] r5892 - SwiftApps/CMTS
Message-ID: <20120808151133.00AEC9CCBB@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-08 10:11:32 -0500 (Wed, 08 Aug 2012)
New Revision: 5892
Added:
SwiftApps/CMTS/dimers/
Log:
Creating SVN location for John's LAMMPS script - an example showing serial dependencies
From swift at ci.uchicago.edu Wed Aug 8 20:35:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Wed, 8 Aug 2012 20:35:03 -0500 (CDT)
Subject: [Swift-commit] cog r3448
Message-ID: <20120809013504.18FA78D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3448 | hategan | 2012-08-08 20:34:37 -0500 (Wed, 08 Aug 2012) | 1 line
fixed issue where gsi cert would be required in local mode
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/LocalService.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/LocalService.java (revision 3447)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/LocalService.java (working copy)
@@ -158,9 +158,6 @@
}
try {
GSSCredential cred = channel.getUserContext().getCredential();
- if (cred == null) {
- cred = (GSSCredential) AbstractionFactory.getSecurityContext("gt2", new ServiceContactImpl(url)).getCredentials();
- }
ChannelManager.getManager().registerChannel(url, cred, channel);
}
catch (Exception e) {
From swift at ci.uchicago.edu Wed Aug 8 20:40:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Wed, 8 Aug 2012 20:40:03 -0500 (CDT)
Subject: [Swift-commit] cog r3449
Message-ID: <20120809014004.86B7F8D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3449 | hategan | 2012-08-08 20:37:44 -0500 (Wed, 08 Aug 2012) | 1 line
if no relevant trusted CA can be found for forwarding, log a list of the ones that are known
------------------------------------------------------------------------
Index: modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java
===================================================================
--- modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java (revision 3448)
+++ modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java (working copy)
@@ -22,6 +22,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.log4j.Logger;
import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException;
import org.globus.cog.abstraction.impl.ssh.ConnectionID;
import org.globus.cog.abstraction.impl.ssh.SSHChannel;
@@ -48,6 +49,8 @@
*
*/
public class ProxyForwardingManager {
+ public static final Logger logger = Logger.getLogger(ProxyForwardingManager.class);
+
public static final long TIME_MARGIN = 10000;
public static final String PROXY_PREFIX = "sshproxy";
public static final String CA_PREFIX = "sshCAcert";
@@ -164,6 +167,12 @@
X509Certificate caCert = tc.getCertificate(userCert.getIssuerDN().getName());
if (caCert == null) {
+ logger.info("Cannot find root CA certificate for proxy");
+ logger.info("DNs of trusted certificates:");
+ X509Certificate[] roots = tc.getCertificates();
+ for (X509Certificate root : roots) {
+ logger.info("\t" + root.getSubjectDN());
+ }
throw new InvalidSecurityContextException("Failed to find root CA certificate (" + userCert.getIssuerDN().getName() + ")");
}
From swift at ci.uchicago.edu Wed Aug 8 20:45:04 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Wed, 8 Aug 2012 20:45:04 -0500 (CDT)
Subject: [Swift-commit] cog r3450
Message-ID: <20120809014505.281648D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3450 | hategan | 2012-08-08 20:40:42 -0500 (Wed, 08 Aug 2012) | 1 line
changed info to warn; you shouldn't get this far with an untrusted CA
------------------------------------------------------------------------
Index: modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java
===================================================================
--- modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java (revision 3449)
+++ modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java (working copy)
@@ -167,11 +167,11 @@
X509Certificate caCert = tc.getCertificate(userCert.getIssuerDN().getName());
if (caCert == null) {
- logger.info("Cannot find root CA certificate for proxy");
- logger.info("DNs of trusted certificates:");
+ logger.warn("Cannot find root CA certificate for proxy");
+ logger.warn("DNs of trusted certificates:");
X509Certificate[] roots = tc.getCertificates();
for (X509Certificate root : roots) {
- logger.info("\t" + root.getSubjectDN());
+ logger.warn("\t" + root.getSubjectDN());
}
throw new InvalidSecurityContextException("Failed to find root CA certificate (" + userCert.getIssuerDN().getName() + ")");
}
From swift at ci.uchicago.edu Thu Aug 9 03:30:03 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Thu, 9 Aug 2012 03:30:03 -0500 (CDT)
Subject: [Swift-commit] cog r3451
Message-ID: <20120809083004.000EC8D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3451 | hategan | 2012-08-09 03:27:36 -0500 (Thu, 09 Aug 2012) | 1 line
use system properties to set proxy and ca locations since CoGProperties gives precedence to those over its own set methods
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java (revision 3450)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java (working copy)
@@ -213,8 +213,8 @@
private void setupGSIProxy() throws IOException, GeneralSecurityException {
AutoCA.Info result = AutoCA.getInstance().createProxy();
- CoGProperties.getDefault().setProxyFile(result.proxyPath);
- CoGProperties.getDefault().setCaCertLocations(result.caCertPath);
+ System.setProperty("X509_USER_PROXY", result.proxyPath);
+ System.setProperty("X509_CERT_DIR", result.caCertPath);
}
private void setSecurityContext(Task t, SecurityContext sc, String provider)
From davidk at ci.uchicago.edu Thu Aug 9 17:32:54 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Thu, 9 Aug 2012 17:32:54 -0500 (CDT)
Subject: [Swift-commit] r5894 - in SwiftApps/CMTS/dimers: . bin conf
input_files
Message-ID: <20120809223254.763AC9CC9E@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-09 17:32:54 -0500 (Thu, 09 Aug 2012)
New Revision: 5894
Added:
SwiftApps/CMTS/dimers/bin/restart2data.sh
Removed:
SwiftApps/CMTS/dimers/input_files/end_20.restart
SwiftApps/CMTS/dimers/input_files/end_25.restart
SwiftApps/CMTS/dimers/input_files/end_30.restart
SwiftApps/CMTS/dimers/input_files/end_35.restart
SwiftApps/CMTS/dimers/input_files/end_40.restart
SwiftApps/CMTS/dimers/input_files/end_45.restart
SwiftApps/CMTS/dimers/input_files/end_50.restart
SwiftApps/CMTS/dimers/input_files/end_55.restart
SwiftApps/CMTS/dimers/input_files/end_60.restart
SwiftApps/CMTS/dimers/input_files/end_65.restart
SwiftApps/CMTS/dimers/input_files/end_70.restart
Modified:
SwiftApps/CMTS/dimers/conf/local.cf
SwiftApps/CMTS/dimers/dimers.swift
SwiftApps/CMTS/dimers/rundimers.sh
Log:
Various updates to input files, swift script, and wrapper shell script
Added: SwiftApps/CMTS/dimers/bin/restart2data.sh
===================================================================
--- SwiftApps/CMTS/dimers/bin/restart2data.sh (rev 0)
+++ SwiftApps/CMTS/dimers/bin/restart2data.sh 2012-08-09 22:32:54 UTC (rev 5894)
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+./restart2data $@
+for file in $( ls *.swift )
+do
+ mv $file $( basename $file .swift )
+done
Property changes on: SwiftApps/CMTS/dimers/bin/restart2data.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: SwiftApps/CMTS/dimers/conf/local.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/local.cf 2012-08-08 15:12:55 UTC (rev 5893)
+++ SwiftApps/CMTS/dimers/conf/local.cf 2012-08-09 22:32:54 UTC (rev 5894)
@@ -7,4 +7,5 @@
provider.staging.pin.swiftfiles=false
use.wrapper.staging=false
-#app rmsd=$PWD/../rmsd.sh
+#app insert_molecules=$PWD/../bin/insert_molecules
+#app restart2data=$PWD/../bin/restart2data.sh
Modified: SwiftApps/CMTS/dimers/dimers.swift
===================================================================
--- SwiftApps/CMTS/dimers/dimers.swift 2012-08-08 15:12:55 UTC (rev 5893)
+++ SwiftApps/CMTS/dimers/dimers.swift 2012-08-09 22:32:54 UTC (rev 5894)
@@ -1,13 +1,33 @@
type file;
-app insert_molecules
+app (file lamps_config_output) insert_molecules (file lamps_config, file dimer, int delta, int v_radius)
+{
+ insert_molecules @lamps_config @dimer delta v_radius 0 25.0 @lamps_config_output;
+}
-app restart2data
+app (file output_file) restart2data (file restart_file, file config_file)
+{
+ restart2data @restart_file @config_file;
+}
-app lmp_john
-
int start_ndimers=20;
-int max_ndimers=75;
+int max_ndimers=70;
int delta_ndimers=5;
int virion_radius=300;
+file dimer_file <"dimer_1232.lammps_config">;
+file initial_output <"empty.lammps_config">;
+file outputs[];
+outputs[start_ndimers-delta_ndimers] = initial_output;
+
+foreach i in [start_ndimers:max_ndimers:delta_ndimers] {
+
+ file molecule_output ;
+ molecule_output = insert_molecules(outputs[i-delta_ndimers], dimer_file, delta_ndimers, virion_radius);
+
+ file restart_input ;
+ file restart_output ;
+ restart_output = restart2data(restart_input, molecule_output);
+
+ outputs[i] = restart_output;
+}
Deleted: SwiftApps/CMTS/dimers/input_files/end_20.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_25.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_30.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_35.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_40.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_45.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_50.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_55.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_60.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_65.restart
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_70.restart
===================================================================
(Binary files differ)
Modified: SwiftApps/CMTS/dimers/rundimers.sh
===================================================================
--- SwiftApps/CMTS/dimers/rundimers.sh 2012-08-08 15:12:55 UTC (rev 5893)
+++ SwiftApps/CMTS/dimers/rundimers.sh 2012-08-09 22:32:54 UTC (rev 5894)
@@ -58,7 +58,7 @@
# Do the run
cd $rundir
-cp ../rmsd.swift .
+cp ../dimers.swift .
export WORK=$PWD/swiftwork
mkdir -p $PWD/swiftwork/workers
From davidk at ci.uchicago.edu Fri Aug 10 11:04:31 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 11:04:31 -0500 (CDT)
Subject: [Swift-commit] r5895 - SwiftApps/CMTS/dimers/src
Message-ID: <20120810160431.3B4459CCA5@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 11:04:31 -0500 (Fri, 10 Aug 2012)
New Revision: 5895
Removed:
SwiftApps/CMTS/dimers/src/insert_molecules
SwiftApps/CMTS/dimers/src/restart2data
Log:
Remove binaries
Deleted: SwiftApps/CMTS/dimers/src/insert_molecules
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/src/restart2data
===================================================================
(Binary files differ)
From davidk at ci.uchicago.edu Fri Aug 10 11:05:38 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 11:05:38 -0500 (CDT)
Subject: [Swift-commit] r5896 - SwiftApps/CMTS/dimers/bin
Message-ID: <20120810160538.2E6609CCA5@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 11:05:38 -0500 (Fri, 10 Aug 2012)
New Revision: 5896
Removed:
SwiftApps/CMTS/dimers/bin/insert_molecules
SwiftApps/CMTS/dimers/bin/restart2data
Log:
Remove binaries from bin - run make in src/
Deleted: SwiftApps/CMTS/dimers/bin/insert_molecules
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/bin/restart2data
===================================================================
(Binary files differ)
From davidk at ci.uchicago.edu Fri Aug 10 11:24:38 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 11:24:38 -0500 (CDT)
Subject: [Swift-commit] r5897 - SwiftApps/CMTS/dimers/input_files
Message-ID: <20120810162438.390F59CCA5@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 11:24:38 -0500 (Fri, 10 Aug 2012)
New Revision: 5897
Added:
SwiftApps/CMTS/dimers/input_files/dimer_1232.lammps_config
SwiftApps/CMTS/dimers/input_files/empty.lammps_config
SwiftApps/CMTS/dimers/input_files/end_20.restart.swift
SwiftApps/CMTS/dimers/input_files/end_25.restart.swift
SwiftApps/CMTS/dimers/input_files/end_30.restart.swift
SwiftApps/CMTS/dimers/input_files/end_35.restart.swift
SwiftApps/CMTS/dimers/input_files/end_40.restart.swift
SwiftApps/CMTS/dimers/input_files/end_45.restart.swift
SwiftApps/CMTS/dimers/input_files/end_50.restart.swift
SwiftApps/CMTS/dimers/input_files/end_55.restart.swift
SwiftApps/CMTS/dimers/input_files/end_60.restart.swift
SwiftApps/CMTS/dimers/input_files/end_65.restart.swift
SwiftApps/CMTS/dimers/input_files/end_70.restart.swift
Log:
Input config files and example lampps outputs
Added: SwiftApps/CMTS/dimers/input_files/dimer_1232.lammps_config
===================================================================
--- SwiftApps/CMTS/dimers/input_files/dimer_1232.lammps_config (rev 0)
+++ SwiftApps/CMTS/dimers/input_files/dimer_1232.lammps_config 2012-08-10 16:24:38 UTC (rev 5897)
@@ -0,0 +1,161 @@
+Single dimer, as 1232 format
+
+86 atoms
+5 bonds
+2 impropers
+
+43 atom types
+3 bond types
+2 improper types
+
+ -756.560 +785.152 xlo xhi
+ -792.835 +795.239 ylo yhi
+ -715.562 +702.503 zlo zhi
+
+Masses
+
+ 1 1.000 # 1_1
+ 2 1.000 # 1_2
+ 3 1.000 # 1_3
+ 4 1.000 # 1_4
+ 5 1.000 # 2_1
+ 6 1.000 # 2_2
+ 7 1.000 # 3_1
+ 8 1.000 # 3_2
+ 9 1.000 # 3_3
+ 10 1.000 # 4_1
+ 11 1.000 # 4_2
+ 12 1.000 # 4_3
+ 13 1.000 # 4_4
+ 14 1.000 # 4_5
+ 15 1.000 # 4_6
+ 16 1.000 # 5_1
+ 17 1.000 # 6_1
+ 18 1.000 # 6_2
+ 19 1.000 # 6_3
+ 20 1.000 # 7_1
+ 21 1.000 # 7_2
+ 22 1.000 # 7_3
+ 23 1.000 # 7_4
+ 24 1.000 # 7_5
+ 25 1.000 # 7_6
+ 26 1.000 # AN1
+ 27 1.000 # AN2
+ 28 1.000 # AC1
+ 29 1.000 # AC2
+ 30 1.000 # 8_1
+ 31 1.000 # 8_2
+ 32 1.000 # 8_3
+ 33 1.000 # 8_4
+ 34 1.000 # 9_1
+ 35 1.000 # 9_2
+ 36 1.000 # 9_3
+ 37 1.000 # 9_4
+ 38 1.000 # 10_1
+ 39 1.000 # 10_2
+ 40 1.000 # 10_3
+ 41 1.000 # 11_1
+ 42 1.000 # 11_2
+ 43 1.000 # 12
+
+Atoms
+
+ 1 1 1 +226.922 -126.238 +12.619
+ 2 1 2 +224.009 -124.025 +9.839
+ 3 1 3 +221.082 -122.564 +6.574
+ 4 1 4 +218.557 -121.306 +2.898
+ 5 1 5 +214.572 -115.267 +11.126
+ 6 1 6 +219.039 -117.163 +14.819
+ 7 1 7 +231.591 -113.864 +15.743
+ 8 1 8 +230.273 -115.423 +11.608
+ 9 1 9 +229.516 -116.359 +7.193
+ 10 1 10 +224.393 -109.574 -1.334
+ 11 1 11 +225.128 -106.326 +1.727
+ 12 1 12 +226.938 -102.700 +6.299
+ 13 1 13 +227.650 -99.606 +9.640
+ 14 1 14 +229.470 -96.512 +14.475
+ 15 1 15 +230.559 -93.572 +17.766
+ 16 1 16 +235.225 -102.180 +16.805
+ 17 1 17 +239.745 -111.924 +20.986
+ 18 1 18 +237.403 -110.785 +24.664
+ 19 1 19 +234.974 -110.629 +28.372
+ 20 1 20 +228.012 -107.919 +21.779
+ 21 1 21 +225.202 -107.090 +18.297
+ 22 1 22 +221.939 -105.556 +13.325
+ 23 1 23 +219.184 -105.702 +9.666
+ 24 1 24 +215.241 -105.432 +5.008
+ 25 1 25 +212.592 -106.240 +1.329
+ 26 1 26 +199.194 -107.488 +4.286
+ 27 1 27 +206.737 -112.435 +8.607
+ 28 2 28 +199.194 -107.488 +4.286
+ 29 2 29 +206.737 -112.435 +8.607
+ 30 2 30 +190.775 -115.480 +3.527
+ 31 2 31 +194.919 -113.877 +4.223
+ 32 2 32 +199.878 -111.026 +4.469
+ 33 2 33 +203.866 -109.208 +5.251
+ 34 2 34 +200.291 -99.839 +12.535
+ 35 2 35 +196.603 -100.915 +10.492
+ 36 2 36 +193.408 -101.313 +7.671
+ 37 2 37 +190.553 -102.513 +4.748
+ 38 2 38 +183.062 -108.578 +0.748
+ 39 2 39 +181.304 -108.080 +5.233
+ 40 2 40 +179.848 -107.264 +9.507
+ 41 2 41 +188.331 -111.694 +14.227
+ 42 2 42 +185.947 -114.438 +11.847
+ 43 2 43 +197.466 -100.342 +7.203
+ 44 3 1 +183.923 -60.433 +24.939
+ 45 3 2 +183.348 -63.836 +21.906
+ 46 3 3 +182.231 -66.678 +18.437
+ 47 3 4 +180.530 -69.380 +15.078
+ 48 3 5 +190.586 -73.326 +16.909
+ 49 3 6 +191.247 -69.684 +21.753
+ 50 3 7 +186.548 -70.335 +33.869
+ 51 3 8 +183.367 -70.315 +30.532
+ 52 3 9 +179.785 -70.866 +27.737
+ 53 3 10 +176.176 -80.640 +21.701
+ 54 3 11 +179.022 -82.664 +24.575
+ 55 3 12 +182.709 -84.414 +29.122
+ 56 3 13 +185.778 -86.215 +32.051
+ 57 3 14 +189.591 -87.384 +36.563
+ 58 3 15 +192.407 -88.991 +39.748
+ 59 3 16 +187.786 -80.373 +40.836
+ 60 3 17 +187.436 -69.202 +43.651
+ 61 3 18 +191.923 -69.597 +43.535
+ 62 3 19 +196.304 -69.074 +43.069
+ 63 3 20 +194.513 -74.768 +35.091
+ 64 3 21 +193.040 -77.058 +31.447
+ 65 3 22 +190.638 -80.529 +26.986
+ 66 3 23 +188.812 -81.945 +23.028
+ 67 3 24 +186.781 -84.254 +17.749
+ 68 3 25 +184.768 -85.036 +13.682
+ 69 3 26 +193.567 -85.316 +3.085
+ 70 3 27 +192.731 -78.087 +9.945
+ 71 2 28 +193.567 -85.316 +3.085
+ 72 2 29 +192.731 -78.087 +9.945
+ 73 2 30 +195.567 -79.488 -6.783
+ 74 2 31 +194.442 -80.071 -2.467
+ 75 2 32 +192.760 -81.818 +2.718
+ 76 2 33 +191.823 -82.605 +6.998
+ 77 2 34 +201.468 -89.889 +9.750
+ 78 2 35 +201.311 -90.117 +5.407
+ 79 2 36 +200.371 -91.127 +1.356
+ 80 2 37 +199.037 -91.355 -2.682
+ 81 2 38 +198.155 -88.130 -12.567
+ 82 2 39 +202.937 -87.584 -12.027
+ 83 2 40 +207.449 -87.346 -11.226
+ 84 2 41 +206.590 -80.322 -3.238
+ 85 2 42 +205.216 -78.857 -7.091
+ 86 2 43 +198.179 -91.474 +4.920
+
+Bonds
+
+ 1 1 43 86
+ 2 2 26 28
+ 3 3 27 29
+ 4 2 69 71
+ 5 3 70 72
+
+Impropers
+
+ 1 1 25 27 26 30
+ 2 2 68 70 69 73
Added: SwiftApps/CMTS/dimers/input_files/empty.lammps_config
===================================================================
--- SwiftApps/CMTS/dimers/input_files/empty.lammps_config (rev 0)
+++ SwiftApps/CMTS/dimers/input_files/empty.lammps_config 2012-08-10 16:24:38 UTC (rev 5897)
@@ -0,0 +1,66 @@
+Empty system!
+
+0 atoms
+0 bonds
+0 impropers
+
+44 atom types
+3 bond types
+2 improper types
+
+ -800 +800 xlo xhi
+ -800 +800 ylo yhi
+ -800 +800 zlo zhi
+
+Masses
+
+ 1 1.000 # 1_1
+ 2 1.000 # 1_2
+ 3 1.000 # 1_3
+ 4 1.000 # 1_4
+ 5 1.000 # 2_1
+ 6 1.000 # 2_2
+ 7 1.000 # 3_1
+ 8 1.000 # 3_2
+ 9 1.000 # 3_3
+ 10 1.000 # 4_1
+ 11 1.000 # 4_2
+ 12 1.000 # 4_3
+ 13 1.000 # 4_4
+ 14 1.000 # 4_5
+ 15 1.000 # 4_6
+ 16 1.000 # 5_1
+ 17 1.000 # 6_1
+ 18 1.000 # 6_2
+ 19 1.000 # 6_3
+ 20 1.000 # 7_1
+ 21 1.000 # 7_2
+ 22 1.000 # 7_3
+ 23 1.000 # 7_4
+ 24 1.000 # 7_5
+ 25 1.000 # 7_6
+ 26 1.000 # AN1
+ 27 1.000 # AN2
+ 28 1.000 # AC1
+ 29 1.000 # AC2
+ 30 1.000 # 8_1
+ 31 1.000 # 8_2
+ 32 1.000 # 8_3
+ 33 1.000 # 8_4
+ 34 1.000 # 9_1
+ 35 1.000 # 9_2
+ 36 1.000 # 9_3
+ 37 1.000 # 9_4
+ 38 1.000 # 10_1
+ 39 1.000 # 10_2
+ 40 1.000 # 10_3
+ 41 1.000 # 11_1
+ 42 1.000 # 11_2
+ 43 1.000 # 12
+ 44 1.000 # ?
+
+Atoms
+
+Bonds
+
+Impropers
Added: SwiftApps/CMTS/dimers/input_files/end_20.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_20.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_25.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_25.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_30.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_30.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_35.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_35.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_40.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_40.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_45.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_45.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_50.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_50.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_55.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_55.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_60.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_60.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_65.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_65.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_70.restart.swift
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_70.restart.swift
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
From davidk at ci.uchicago.edu Fri Aug 10 11:44:54 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 11:44:54 -0500 (CDT)
Subject: [Swift-commit] r5898 - SwiftApps/CMTS/dimers/conf
Message-ID: <20120810164454.62DBC9CCA5@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 11:44:54 -0500 (Fri, 10 Aug 2012)
New Revision: 5898
Modified:
SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf
SwiftApps/CMTS/dimers/conf/grotthuss.cf
SwiftApps/CMTS/dimers/conf/makena-ssh.cf
SwiftApps/CMTS/dimers/conf/makena.cf
SwiftApps/CMTS/dimers/conf/makgroth.cf
Log:
Updated config files for makena/grotthuss
Modified: SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf 2012-08-10 16:24:38 UTC (rev 5897)
+++ SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf 2012-08-10 16:44:54 UTC (rev 5898)
@@ -7,5 +7,6 @@
use.wrapper.staging=false
tcp.port.range=5000,51000
-#app rmsd=$PWD/../rmsd.sh
-#app plot_pd=$PWD/../plot_pd.pl
+#app insert_molecules=$PWD/../bin/insert_molecules
+#app restart2data=$PWD/../bin/restart2data.sh
+
Modified: SwiftApps/CMTS/dimers/conf/grotthuss.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss.cf 2012-08-10 16:24:38 UTC (rev 5897)
+++ SwiftApps/CMTS/dimers/conf/grotthuss.cf 2012-08-10 16:44:54 UTC (rev 5898)
@@ -7,5 +7,6 @@
provider.staging.pin.swiftfiles=false
use.wrapper.staging=false
-#app rmsd=$PWD/../rmsd.sh
-#app plot_pd=$PWD/../plot_pd.pl
+#app insert_molecules=$PWD/../bin/insert_molecules
+#app restart2data=$PWD/../bin/restart2data.sh
+
Modified: SwiftApps/CMTS/dimers/conf/makena-ssh.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena-ssh.cf 2012-08-10 16:24:38 UTC (rev 5897)
+++ SwiftApps/CMTS/dimers/conf/makena-ssh.cf 2012-08-10 16:44:54 UTC (rev 5898)
@@ -7,5 +7,6 @@
use.wrapper.staging=false
tcp.port.range=5000,51000
-#app rmsd=$PWD/../rmsd.sh
-#app plot_pd=$PWD/../plot_pd.pl
+#app insert_molecules=$PWD/../bin/insert_molecules
+#app restart2data=$PWD/../bin/restart2data.sh
+
Modified: SwiftApps/CMTS/dimers/conf/makena.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena.cf 2012-08-10 16:24:38 UTC (rev 5897)
+++ SwiftApps/CMTS/dimers/conf/makena.cf 2012-08-10 16:44:54 UTC (rev 5898)
@@ -7,5 +7,6 @@
provider.staging.pin.swiftfiles=false
use.wrapper.staging=false
-#app rmsd=$PWD/../rmsd.sh
-#app plot_pd=$PWD/../plot_pd.pl
+#app insert_molecules=$PWD/../bin/insert_molecules
+#app restart2data=$PWD/../bin/restart2data.sh
+
Modified: SwiftApps/CMTS/dimers/conf/makgroth.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makgroth.cf 2012-08-10 16:24:38 UTC (rev 5897)
+++ SwiftApps/CMTS/dimers/conf/makgroth.cf 2012-08-10 16:44:54 UTC (rev 5898)
@@ -7,5 +7,6 @@
use.wrapper.staging=false
tcp.port.range=5000,51000
-#app rmsd=$PWD/../rmsd.sh
-#app plot_pd=$PWD/../plot_pd.pl
+#app insert_molecules=$PWD/../bin/insert_molecules
+#app restart2data=$PWD/../bin/restart2data.sh
+
From davidk at ci.uchicago.edu Fri Aug 10 12:22:52 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 12:22:52 -0500 (CDT)
Subject: [Swift-commit] r5899 - SwiftApps/CMTS/dimers
Message-ID: <20120810172252.578E79CCAF@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 12:22:52 -0500 (Fri, 10 Aug 2012)
New Revision: 5899
Modified:
SwiftApps/CMTS/dimers/README
Log:
Added readme
Modified: SwiftApps/CMTS/dimers/README
===================================================================
--- SwiftApps/CMTS/dimers/README 2012-08-10 16:44:54 UTC (rev 5898)
+++ SwiftApps/CMTS/dimers/README 2012-08-10 17:22:52 UTC (rev 5899)
@@ -0,0 +1,70 @@
+Dimers Swift Scripts
+====================
+
+Prerequisites
+-------------
+This README will assume that runs will be started from
+makena.uchicago.edu.
+
+Please ensure that Swift is in your $PATH.
+
+Add the following line to $HOME/.bashrc to set the PATH:
+-----
+export PATH=/scratch/davidk/swift-trunk/cog/modules/swift/dist/swift-svn/bin:/opt/torque/bin:$PATH
+-----
+
+You will need to create a directory called /scratch/:
+-----
+mkdir /scratch/yourusername
+cd /scratch/yourusername
+-----
+
+IMPORTANT: Please note that runs may fail if started from /home due to some
+potential NFS issues, so please make sure to always use /scratch.
+
+
+Checking out scripts from SVN
+-----------------------------
+From within your scratch directory, run the following command to get the
+dimers scripts:
+
+-----
+svn checkout https://svn.ci.uchicago.edu/svn/vdl2/SwiftApps/CMTS/dimers
+-----
+
+These scripts can periodically be updated by running an SVN update within
+the dimers directory:
+-----
+svn update
+-----
+
+How to Run
+----------
+The rundimers.sh script is used to start a run. The options you pass to
+this script will determine how the dimers script runs.
+
+Usage: rundimers.sh [-s sitename]
+
+The sitename option determines where a run will take place. Currently, the
+only tested options are "makena" and "grotthuss".
+
+Example:
+
+-----
+./rundimers.sh -s makena
+-----
+
+When your job has finished running for the first time, you will see that a directory
+has been created called run001. A new directory will be created each time you run
+the rundimers.sh script.
+
+Outputs
+-------
+Within each run directory is a subdirectory called output. This directory will
+contain all relevent outputs created during the run.
+
+Logs
+----
+Within each run directory is a subdirectory called logs. This directory contains
+the standard output and standard error logs from each namd task. If you notice a job
+is failing, reference these files for more detail about what went wrong.
From davidk at ci.uchicago.edu Fri Aug 10 12:36:34 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 12:36:34 -0500 (CDT)
Subject: [Swift-commit] r5900 - SwiftApps/CMTS/dimers
Message-ID: <20120810173634.EFBF19CCAF@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 12:36:34 -0500 (Fri, 10 Aug 2012)
New Revision: 5900
Modified:
SwiftApps/CMTS/dimers/rundimers.sh
Log:
Build packages as needed
Modified: SwiftApps/CMTS/dimers/rundimers.sh
===================================================================
--- SwiftApps/CMTS/dimers/rundimers.sh 2012-08-10 17:22:52 UTC (rev 5899)
+++ SwiftApps/CMTS/dimers/rundimers.sh 2012-08-10 17:36:34 UTC (rev 5900)
@@ -36,6 +36,15 @@
mkdir $rundir
fi
+# Ensure binaries are build
+if [ ! -x "bin/restart2data" ] || [ ! -x "bin/insert_molecules" ]; then
+ echo Building packages
+ cd src
+ make
+ cd ..
+ echo
+fi
+
# Copy input files
cp input_files/* $rundir
echo Run directory $rundir: site=$execsite paramfile=$paramfile
From davidk at ci.uchicago.edu Fri Aug 10 16:12:09 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 10 Aug 2012 16:12:09 -0500 (CDT)
Subject: [Swift-commit] r5901 - trunk/bin
Message-ID: <20120810211209.33BAE9CCAF@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-10 16:12:09 -0500 (Fri, 10 Aug 2012)
New Revision: 5901
Modified:
trunk/bin/swift
Log:
Ignore ifconfig obsolete messages on midway
Modified: trunk/bin/swift
===================================================================
--- trunk/bin/swift 2012-08-10 17:36:34 UTC (rev 5900)
+++ trunk/bin/swift 2012-08-10 21:12:09 UTC (rev 5901)
@@ -122,7 +122,7 @@
PATH=$PATH:/sbin
IFCONFIG=`which ifconfig 2>&1`
if [ -x "$IFCONFIG" ]; then
- MAC=`$IFCONFIG |grep HWaddr`
+ MAC=`$IFCONFIG 2>/dev/null |grep HWaddr`
fi
# Check if we are running on a mac, if so look for md5 and not md5sum
From swift at ci.uchicago.edu Sat Aug 11 11:05:05 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sat, 11 Aug 2012 11:05:05 -0500 (CDT)
Subject: [Swift-commit] cog r3453
Message-ID: <20120811160505.A6D628D00DF3@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3453 | hategan | 2012-08-11 11:02:05 -0500 (Sat, 11 Aug 2012) | 1 line
also forward signing policy
------------------------------------------------------------------------
Index: modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java
===================================================================
--- modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java (revision 3452)
+++ modules/provider-ssh/src/org/globus/cog/abstraction/impl/ssh/execution/ProxyForwardingManager.java (working copy)
@@ -10,7 +10,10 @@
package org.globus.cog.abstraction.impl.ssh.execution;
import java.io.BufferedOutputStream;
+import java.io.FileInputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.SecureRandom;
@@ -31,6 +34,7 @@
import org.globus.gsi.GSIConstants;
import org.globus.gsi.GlobusCredential;
import org.globus.gsi.GlobusCredentialException;
+import org.globus.gsi.SigningPolicy;
import org.globus.gsi.TrustedCertificates;
import org.globus.gsi.X509ExtensionSet;
import org.globus.gsi.bc.BouncyCastleCertProcessingFactory;
@@ -152,10 +156,13 @@
SecureRandom random = SecureRandom.getInstance("SHA1PRNG", "SUN");
long now = System.currentTimeMillis();
int id = Math.abs(random.nextInt());
- String proxyFileName = PROXY_PREFIX + "-" + id + "-" + (cred.getTimeLeft() + now / 1000);
- String caCertFileName = CA_PREFIX + "-" + id + "-" + (cred.getTimeLeft() + now / 1000);
+ long suffix = cred.getTimeLeft() + now / 1000;
+ String proxyFileName = PROXY_PREFIX + "-" + id + "-" + suffix;
+ String caCertFileName = CA_PREFIX + "-" + id + "-" + suffix + ".pem";
+ String signingPolicyFileName = CA_PREFIX + "-" + id + "-" + suffix + ".signing_policy";
+
SftpFile fp = createFile(sftp, globusDir, proxyFileName);
BufferedOutputStream pout = new BufferedOutputStream(new SftpFileOutputStream(fp));
cred.save(pout);
@@ -182,6 +189,14 @@
CertUtil.writeCertificate(cout, caCert);
cout.close();
+ SigningPolicy sp = tc.getSigningPolicy('/' + userCert.getIssuerDN().getName().replace(',', '/'));
+ if (sp != null) {
+ SftpFile spf = createFile(sftp, globusDir, signingPolicyFileName);
+ BufferedOutputStream spout = new BufferedOutputStream(new SftpFileOutputStream(spf));
+ writeFile(spout, new FileInputStream(sp.getFileName()));
+ }
+
+
return new Info(globusDir + "/" + proxyFileName, globusDir + "/" + caCertFileName, cred.getTimeLeft() * 1000
+ System.currentTimeMillis());
}
@@ -198,6 +213,17 @@
}
}
+ private void writeFile(OutputStream out, InputStream in) throws IOException {
+ byte[] buf = new byte[1024];
+ int len = in.read(buf);
+ while (len != -1) {
+ out.write(buf, 0, len);
+ len = in.read(buf);
+ }
+ out.close();
+ in.close();
+ }
+
private SftpFile createFile(SftpSubsystemClient sftp, String dir, String name) throws IOException {
FileAttributes fa = new FileAttributes();
fa.setPermissions(new UnsignedInteger32(FileAttributes.S_IRUSR
From wilde at ci.uchicago.edu Mon Aug 13 11:47:42 2012
From: wilde at ci.uchicago.edu (wilde at ci.uchicago.edu)
Date: Mon, 13 Aug 2012 11:47:42 -0500 (CDT)
Subject: [Swift-commit] r5902 - SwiftApps/CMTS/dimers
Message-ID: <20120813164742.9BEA39CCB4@svn.ci.uchicago.edu>
Author: wilde
Date: 2012-08-13 11:47:42 -0500 (Mon, 13 Aug 2012)
New Revision: 5902
Added:
SwiftApps/CMTS/dimers/README_USE_CASE
Log:
Add description of this use case from Johns email
Added: SwiftApps/CMTS/dimers/README_USE_CASE
===================================================================
--- SwiftApps/CMTS/dimers/README_USE_CASE (rev 0)
+++ SwiftApps/CMTS/dimers/README_USE_CASE 2012-08-13 16:47:42 UTC (rev 5902)
@@ -0,0 +1,103 @@
+From John Grime, 7 Aug 2012:
+
+---
+
+Chaps,
+
+Please find attached a compressed directory with an example of the
+sort of thing I sometimes need to do which may benefit from
+SWIFTification.
+
+---------------
+Brief overview:
+---------------
+
+I have some molecular simulations where I try to get a set of proteins
+to self-assemble into a larger structure inside a spherical region of
+space.
+
+I know what the "target" concentration of protein is for the
+biological system I'm trying to model, but I found that when I add all
+the proteins at once I get multiple "nucleation sites" - instead of a
+single structure forming, I instead got multiple incomplete
+structures.
+
+To get around this I instead tried to add the proteins gradually, a
+few at a time. The general workflow is therefore something like this:
+
+1. Add a few proteins to the simulation data.
+
+2. Run the molecular dynamics simulation for a while, save a snapshot
+of the simulation at the end of the run.
+
+3. Take the snapshot written at the end of step 2, and use as the
+input for step 1.
+
+-----------------------
+What I need to do this:
+-----------------------
+
+1. The molecular dynamics program itself; I use a modified version of
+ LAMMPS, but in principle I could probably use other codes.
+
+2. A little program to insert a specified number of molecules into an
+ existing simulation, given a well-defined molecule description.
+
+3. The ability to convert a binary LAMMPS snapshot into something more
+ convenient for the previous program to deal with.
+
+--------------------------------------
+Description of files in the directory:
+--------------------------------------
+
+lammps_new_spherical.in :
+
+A LAMMPS control file, containing miscellaneous information
+(temperature, interaction parameters etc) to describe how to run the
+simulation.
+
+dimer_1232.lammps_config :
+
+A LAMMPS format molecular description of the protein we're adding to
+the simulation (atom types and coordinates, what's bonded to what etc)
+
+empty.lammps_config :
+
+The initially empty simulation that we start to add proteins into.
+
+GeometryUtil.*, Ran1.*, StringUtil.*, definitions.* :
+
+Utility code!
+
+insert_molecules.cpp :
+
+The program to insert molecules into an existing simulation
+definition. Assumes LAMMPS config format, such as found in
+empty.lammps_config and dimer_1232.lammps_config.
+
+restart2data.cpp :
+
+A program to convert the binary LAMMPS snapshot format into something
+suitable for use with the "insert_molecules" program.
+
+---------------
+Notes
+---------------
+
+Rather than include the source code for the modified LAMMPS MD
+program, and leave you guys to it, I've instead included the script
+which runs the little protein insertion loop and commented out the
+line which runs LAMMPS. I have, however, included some example binary
+output files from LAMMPS which should allow the loop to work as if we
+actually were running LAMMPS in the loop.
+
+Hopefully, all should be pretty straightforward if you look at the
+"looped_run.sh" script. The "insert_molecules" and "restart2data"
+programs are compiled when you run the script if the binaries don't
+exist.
+
+The version of this script I actually use has some PBS stuff in there
+to generate a set of submission scripts which wait on previous job
+completion, but I thought I'd keep it simple in this case!
+
+J.
From davidk at ci.uchicago.edu Mon Aug 13 15:25:26 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 13 Aug 2012 15:25:26 -0500 (CDT)
Subject: [Swift-commit] r5903 - SwiftApps/CMTS
Message-ID: <20120813202526.725F69CCB4@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-13 15:25:26 -0500 (Mon, 13 Aug 2012)
New Revision: 5903
Added:
SwiftApps/CMTS/userguide/
Log:
Creating a place for the CMTS swift userguide
From hategan at ci.uchicago.edu Tue Aug 14 20:10:31 2012
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Tue, 14 Aug 2012 20:10:31 -0500 (CDT)
Subject: [Swift-commit] r5904 - trunk/src/org/griphyn/vdl/karajan
Message-ID: <20120815011031.65E569CCE6@svn.ci.uchicago.edu>
Author: hategan
Date: 2012-08-14 20:10:31 -0500 (Tue, 14 Aug 2012)
New Revision: 5904
Modified:
trunk/src/org/griphyn/vdl/karajan/WaitingThreadsMonitor.java
Log:
fixed sync issue which, besides causing the tracking of outputs to be inconsistent, may lead to deadlocks
Modified: trunk/src/org/griphyn/vdl/karajan/WaitingThreadsMonitor.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/WaitingThreadsMonitor.java 2012-08-13 20:25:26 UTC (rev 5903)
+++ trunk/src/org/griphyn/vdl/karajan/WaitingThreadsMonitor.java 2012-08-15 01:10:31 UTC (rev 5904)
@@ -52,7 +52,7 @@
}
public static void addOutput(VariableStack stack, List outputs) {
- synchronized(outputs) {
+ synchronized(WaitingThreadsMonitor.outputs) {
WaitingThreadsMonitor.outputs.put(stack, outputs);
}
}
From swift at ci.uchicago.edu Wed Aug 15 18:35:53 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Wed, 15 Aug 2012 18:35:53 -0500 (CDT)
Subject: [Swift-commit] cog r3454
Message-ID: <20120815233553.502AD8D0801C@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3454 | hategan | 2012-08-15 18:34:35 -0500 (Wed, 15 Aug 2012) | 1 line
log file name for GETs
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/GetFileHandler.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/GetFileHandler.java (revision 3453)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/GetFileHandler.java (working copy)
@@ -42,7 +42,7 @@
String src = getInDataAsString(0);
try {
if (logger.isInfoEnabled()) {
- logger.info(this + " request complete");
+ logger.info(this + " request complete; src=" + src);
}
provider = IOProviderFactory.getDefault().instance(getProtocol(src));
sendReply();
From swift at ci.uchicago.edu Wed Aug 15 23:40:49 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Wed, 15 Aug 2012 23:40:49 -0500 (CDT)
Subject: [Swift-commit] cog r3455
Message-ID: <20120816044049.BCB6E6160001@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3455 | hategan | 2012-08-15 23:35:07 -0500 (Wed, 15 Aug 2012) | 1 line
improved logging of buffers/IO providers
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/GetFileHandler.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/GetFileHandler.java (revision 3454)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/GetFileHandler.java (working copy)
@@ -66,6 +66,9 @@
}
try {
reader = provider.pull(src, dst, this);
+ if (logger.isInfoEnabled()) {
+ logger.info(this + " reader: " + reader);
+ }
reader.start();
}
catch (IOException e) {
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/providers/LocalIOProvider.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/providers/LocalIOProvider.java (revision 3454)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/providers/LocalIOProvider.java (working copy)
@@ -150,7 +150,9 @@
private FileChannel fc;
public Reader(String src, ReadIOCallback cb) throws IOException {
- logger.debug("LocalIOProvider.Reader " + src);
+ if (logger.isDebugEnabled()) {
+ logger.debug("LocalIOProvider.Reader " + src);
+ }
URI srcURI = newURI(src);
f = CoasterFileRequestHandler.normalize(srcURI.getPath().substring(1));
this.cb = cb;
@@ -158,7 +160,7 @@
}
public String toString() {
- return "LR " + f;
+ return "LR-" + System.identityHashCode(this);
}
public void start() throws IOException {
@@ -167,6 +169,9 @@
synchronized(this) {
rbuf = Buffers.newReadBuffer(Buffers.getBuffers(Direction.IN), fc, f.length(), this);
}
+ if (logger.isInfoEnabled()) {
+ logger.info(this + " rbuf: " + rbuf);
+ }
}
catch (InterruptedException e) {
throw new IOException(e.toString());
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java (revision 3454)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java (working copy)
@@ -48,7 +48,7 @@
int nbuf = Math.min((int) (size / Buffers.ENTRY_SIZE) + 1, Buffers.ENTRIES_PER_STREAM);
if (logger.isInfoEnabled()) {
- logger.info("Will ask for " + nbuf + " buffers for a size of " + size);
+ logger.info(this + " will ask for " + nbuf + " buffers for a size of " + size);
}
for (int i = 0; i < nbuf; i++) {
@@ -58,7 +58,7 @@
}
int queuedBuffers = requestFill();
if (logger.isInfoEnabled()) {
- logger.info("Actual allocated buffers " + (nbuf - queuedBuffers));
+ logger.info(this + " actual allocated buffers " + (nbuf - queuedBuffers));
}
if (queuedBuffers == nbuf) {
// all buffers are queued
@@ -112,14 +112,14 @@
protected synchronized void bufferCreated(Buffers.Allocation a) {
if (logger.isDebugEnabled()) {
- logger.debug("buffer created");
+ logger.debug(this + " buffer created");
}
allocs.add(a);
}
protected synchronized void deallocateBuffers() {
if (logger.isInfoEnabled()) {
- logger.info("De-allocating " + allocs.size() + " buffers");
+ logger.info(this + " de-allocating " + allocs.size() + " buffers");
}
for (Buffers.Allocation a : allocs) {
buffers.free(a);
@@ -133,7 +133,7 @@
}
public String getName() {
- return "RB-" + cb;
+ return "RB-" + System.identityHashCode(this);
}
public boolean isAlive() {
@@ -148,4 +148,9 @@
public void suspend() {
suspended = true;
}
+
+ @Override
+ public String toString() {
+ return getName();
+ }
}
From swift at ci.uchicago.edu Fri Aug 17 14:55:45 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Fri, 17 Aug 2012 14:55:45 -0500 (CDT)
Subject: [Swift-commit] cog r3456
Message-ID: <20120817195545.8D8E86160001@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3456 | hategan | 2012-08-17 14:49:16 -0500 (Fri, 17 Aug 2012) | 1 line
make sure queued data is sent on shutdown (otherwise shutdown acknowledgements never make it to the service)
------------------------------------------------------------------------
Index: modules/provider-coaster/resources/worker.pl
===================================================================
--- modules/provider-coaster/resources/worker.pl (revision 3455)
+++ modules/provider-coaster/resources/worker.pl (working copy)
@@ -966,27 +966,32 @@
if ($wset && @$wset) {
# can write
wlog(DEBUG, "Can write\n");
- my $wouldBlock;
- # if last write didn't finish, try to finish it now
- $wouldBlock = resumeSend();
-
- if (!$wouldBlock) {
- my $cmd;
- # send whatever is now queued; don't clear the queue, since
- # things may be added to it while stuff is being sent
- my $sz = scalar(@SENDQ);
- wlog(DEBUG, "SENDQ size: $sz\n");
- for (my $i = 0; $i < $sz; $i++) {
- $cmd = shift(@SENDQ);
- $wouldBlock = sendInternal(@$cmd);
- if ($wouldBlock) {
- last;
- }
+ sendQueued();
+ }
+}
+
+sub sendQueued {
+ my $wouldBlock;
+ # if last write didn't finish, try to finish it now
+ $wouldBlock = resumeSend();
+
+ if (!$wouldBlock) {
+ my $cmd;
+ # send whatever is now queued; don't clear the queue, since
+ # things may be added to it while stuff is being sent
+ my $sz = scalar(@SENDQ);
+ wlog(DEBUG, "SENDQ size: $sz\n");
+ for (my $i = 0; $i < $sz; $i++) {
+ $cmd = shift(@SENDQ);
+ $wouldBlock = sendInternal(@$cmd);
+ if ($wouldBlock) {
+ last;
}
}
}
}
+
sub printreply {
my ($tag, $timeout, $err, $fin, $reply) = @_;
if ($timeout) {
@@ -1072,15 +1077,17 @@
my ($tag, $timeout, $msgs) = @_;
wlog DEBUG, "Shutdown command received\n";
queueReply($tag, ("OK"));
+ sendQueued();
wlog INFO, "Acknowledged shutdown.\n";
wlog INFO, "Ran a total of $JOB_COUNT jobs\n";
if ($PROFILE) {
push(@PROFILE_EVENTS, "STOP", "N/A", time());
}
writeprofile();
+
select(undef, undef, undef, 1);
wlog INFO, "Exiting\n";
-
+
exit 0;
}
From swift at ci.uchicago.edu Fri Aug 17 20:15:37 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Fri, 17 Aug 2012 20:15:37 -0500 (CDT)
Subject: [Swift-commit] cog r3457
Message-ID: <20120818011537.9CB3A6160001@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3457 | hategan | 2012-08-17 20:11:15 -0500 (Fri, 17 Aug 2012) | 1 line
log reason for failures with pinning
------------------------------------------------------------------------
Index: modules/provider-coaster/resources/worker.pl
===================================================================
--- modules/provider-coaster/resources/worker.pl (revision 3456)
+++ modules/provider-coaster/resources/worker.pl (working copy)
@@ -1394,7 +1394,7 @@
wlog DEBUG, "mkpath: $pinned_dir\n";
mkpath($pinned_dir) ||
die "mkPinnedDirectory(): " .
- "Could not mkdir: $pinned_dir\n";
+ "Could not mkdir: $pinned_dir ($!)\n";
}
$PINNED_READY = 1;
}
@@ -1407,7 +1407,7 @@
wlog DEBUG, "link: $dst -> $pinned_dir$rdst\n";
if (! -f "$pinned_dir$rdst") {
link($dst, "$pinned_dir$rdst") ||
- die "getPinnedFile(): Could not link: $pinned_dir$rdst\n";
+ die "getPinnedFile(): Could not link: $pinned_dir$rdst ($!)\n";
}
}
@@ -1418,10 +1418,10 @@
if (! -d $dir) {
wlog DEBUG, "mkpath: $dir\n";
mkpath($dir) ||
- die "getPinnedFile(): Could not mkdir: $dir\n";
+ die "getPinnedFile(): Could not mkdir: $dir ($!)\n";
}
link("$pinned_dir$rdst", $dst) ||
- die "getPinnedFile(): Could not link!\n";
+ die "getPinnedFile(): Could not link: $!\n";
if ($PINNED{$rdst} == INFLIGHT) {
waitForPinnedFile($rdst, $jobid);
}
From swift at ci.uchicago.edu Sat Aug 18 01:45:12 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sat, 18 Aug 2012 01:45:12 -0500 (CDT)
Subject: [Swift-commit] cog r3458
Message-ID: <20120818064512.DD771400001@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3458 | hategan | 2012-08-18 01:43:13 -0500 (Sat, 18 Aug 2012) | 1 line
use actual get command for names of buffers instead of the previous random id
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/providers/LocalIOProvider.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/providers/LocalIOProvider.java (revision 3457)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/handlers/providers/LocalIOProvider.java (working copy)
@@ -160,7 +160,7 @@
}
public String toString() {
- return "LR-" + System.identityHashCode(this);
+ return "LR-" + cb;
}
public void start() throws IOException {
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java (revision 3457)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java (working copy)
@@ -133,7 +133,7 @@
}
public String getName() {
- return "RB-" + System.identityHashCode(this);
+ return "RB-" + cb;
}
public boolean isAlive() {
From swift at ci.uchicago.edu Tue Aug 21 02:15:11 2012
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Tue, 21 Aug 2012 02:15:11 -0500 (CDT)
Subject: [Swift-commit] cog r3459
Message-ID: <20120821071511.80B478D00068@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3459 | hategan | 2012-08-21 02:13:46 -0500 (Tue, 21 Aug 2012) | 1 line
fixed race condition in stagein buffer (de)allocation
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/NIOChannelReadBuffer.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/NIOChannelReadBuffer.java (revision 3458)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/NIOChannelReadBuffer.java (working copy)
@@ -33,18 +33,15 @@
public void doStuff(boolean last, ByteBuffer b, Buffers.Allocation alloc) {
synchronized(this) {
if (closed) {
+ if (logger.isInfoEnabled()) {
+ logger.info("Transfer done. De-allocating one unused buffer");
+ }
+ if (alloc != null) {
+ buffers.free(alloc);
+ }
return;
}
}
- if (read >= size) {
- if (logger.isDebugEnabled()) {
- logger.debug("Transfer done. De-allocating one unused buffer");
- }
- if (alloc != null) {
- buffers.free(alloc);
- }
- return;
- }
if (alloc != null) {
bufferCreated(alloc);
}
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java (revision 3458)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/file/coaster/buffers/ReadBuffer.java (working copy)
@@ -58,7 +58,7 @@
}
int queuedBuffers = requestFill();
if (logger.isInfoEnabled()) {
- logger.info(this + " actual allocated buffers " + (nbuf - queuedBuffers));
+ logger.info(this + " actual allocated buffers " + (nbuf - queuedBuffers) + "(" + queuedBuffers + " queued)");
}
if (queuedBuffers == nbuf) {
// all buffers are queued
@@ -71,9 +71,9 @@
synchronized (this) {
b = full.removeFirst();
b.clear();
+ empty.addLast(b);
+ requestFill();
}
- buffers.queueRequest(false, b, this, this);
- requestFill();
}
protected int requestFill() {
@@ -81,25 +81,20 @@
return 0;
}
int queued = 0;
- synchronized (empty) {
- while (!empty.isEmpty() && read < size) {
- ByteBuffer buf = empty.removeFirst();
- if (buf != null) {
- buf.clear();
- }
- if (buffers.queueRequest(false, buf, this, this)) {
- queued++;
- }
+ while (!empty.isEmpty() && read < size) {
+ ByteBuffer buf = empty.removeFirst();
+ if (buf != null) {
+ buf.clear();
}
+ if (buffers.queueRequest(false, buf, this, this)) {
+ queued++;
+ }
}
return queued;
}
public void error(ByteBuffer buf, Exception e) {
- synchronized (empty) {
- empty.addLast(buf);
- getCallback().error(false, e);
- }
+ getCallback().error(false, e);
}
public void bufferRead(ByteBuffer buf) {
From davidk at ci.uchicago.edu Wed Aug 22 11:08:39 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 22 Aug 2012 11:08:39 -0500 (CDT)
Subject: [Swift-commit] r5905 - trunk/bin
Message-ID: <20120822160839.6D2C99CC92@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-22 11:08:39 -0500 (Wed, 22 Aug 2012)
New Revision: 5905
Modified:
trunk/bin/start-coaster-service
Log:
Remove initialization script
Modified: trunk/bin/start-coaster-service
===================================================================
--- trunk/bin/start-coaster-service 2012-08-15 01:10:31 UTC (rev 5904)
+++ trunk/bin/start-coaster-service 2012-08-22 16:08:39 UTC (rev 5905)
@@ -486,11 +486,11 @@
fi
# For evil bug #467
-echo "app echo (string i) { echo i; }" > hi.swift
-echo "echo(\"hi\");" >> hi.swift
-swift -sites.file sites.xml -tc.file tc.data -config cf hi.swift > /dev/null 2>&1 &
-DUMMYPID=$!
-sleep 15
+#echo "app echo (string i) { echo i; }" > hi.swift
+#echo "echo(\"hi\");" >> hi.swift
+#swift -sites.file sites.xml -tc.file tc.data -config cf hi.swift > /dev/null 2>&1 &
+#DUMMYPID=$!
+#sleep 15
# Start workers
case $WORKER_MODE in
@@ -524,7 +524,7 @@
esac
# Wait for dummy script to finish
-wait $DUMMYPID
+#wait $DUMMYPID
# Generate config file
if [ "$SHARED_FILESYSTEM" == "no" ]; then
From davidk at ci.uchicago.edu Thu Aug 23 13:51:16 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Thu, 23 Aug 2012 13:51:16 -0500 (CDT)
Subject: [Swift-commit] r5906 - trunk/bin
Message-ID: <20120823185116.62C989CC9E@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-23 13:51:16 -0500 (Thu, 23 Aug 2012)
New Revision: 5906
Modified:
trunk/bin/start-coaster-service
Log:
Use unique condor submit file names
Modified: trunk/bin/start-coaster-service
===================================================================
--- trunk/bin/start-coaster-service 2012-08-22 16:08:39 UTC (rev 5905)
+++ trunk/bin/start-coaster-service 2012-08-23 18:51:16 UTC (rev 5906)
@@ -275,7 +275,8 @@
export CONDOR_MACHINE_COUNT=1
fi
-cat < start_workers.submit
+export MYPID=$$
+cat < start_workers.$MYPID.submit
output = workers.stdout
error = workers.stderr
executable = $SWIFT_BIN/$WORKER
@@ -288,10 +289,10 @@
EOF
if [ -n "$WORKER_RELAY_HOST" ]; then
- scp start_workers.submit $WORKER_USERNAME@$WORKER_RELAY_HOST:
- ssh $WORKER_USERNAME@$WORKER_RELAY_HOST "condor_submit start_workers.submit"
+ scp start_workers.$MYPID.submit $WORKER_USERNAME@$WORKER_RELAY_HOST:
+ ssh $WORKER_USERNAME@$WORKER_RELAY_HOST "condor_submit start_workers.$MYPID.submit"
else
- condor_submit start_workers.submit
+ condor_submit start_workers.$MYPID.submit
fi
}
From davidk at ci.uchicago.edu Mon Aug 27 02:14:43 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 27 Aug 2012 02:14:43 -0500 (CDT)
Subject: [Swift-commit] r5907 - in SwiftApps/CMTS/dimers: . bin conf
input_files
Message-ID: <20120827071443.D05529CC9E@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-27 02:14:42 -0500 (Mon, 27 Aug 2012)
New Revision: 5907
Added:
SwiftApps/CMTS/dimers/bin/dimers.sh
SwiftApps/CMTS/dimers/input_files/lammps_new_spherical.in
Removed:
SwiftApps/CMTS/dimers/input_files/end_20.restart.swift
SwiftApps/CMTS/dimers/input_files/end_25.restart.swift
SwiftApps/CMTS/dimers/input_files/end_30.restart.swift
SwiftApps/CMTS/dimers/input_files/end_35.restart.swift
SwiftApps/CMTS/dimers/input_files/end_40.restart.swift
SwiftApps/CMTS/dimers/input_files/end_45.restart.swift
SwiftApps/CMTS/dimers/input_files/end_50.restart.swift
SwiftApps/CMTS/dimers/input_files/end_55.restart.swift
SwiftApps/CMTS/dimers/input_files/end_60.restart.swift
SwiftApps/CMTS/dimers/input_files/end_65.restart.swift
SwiftApps/CMTS/dimers/input_files/end_70.restart.swift
Modified:
SwiftApps/CMTS/dimers/README
SwiftApps/CMTS/dimers/conf/grotthuss.cf
SwiftApps/CMTS/dimers/conf/makena.cf
SwiftApps/CMTS/dimers/dimers.swift
Log:
Use real lammps
Use wrapper script to simplify the example
Modified: SwiftApps/CMTS/dimers/README
===================================================================
--- SwiftApps/CMTS/dimers/README 2012-08-23 18:51:16 UTC (rev 5906)
+++ SwiftApps/CMTS/dimers/README 2012-08-27 07:14:42 UTC (rev 5907)
@@ -10,7 +10,7 @@
Add the following line to $HOME/.bashrc to set the PATH:
-----
-export PATH=/scratch/davidk/swift-trunk/cog/modules/swift/dist/swift-svn/bin:/opt/torque/bin:$PATH
+export PATH=/scratch/davidk/swift-trunk/cog/modules/swift/dist/swift-svn/bin:/scratch/davidk/lammps-12Oct11_spherical_modified/src:/opt/torque/bin:$PATH
-----
You will need to create a directory called /scratch/:
Added: SwiftApps/CMTS/dimers/bin/dimers.sh
===================================================================
--- SwiftApps/CMTS/dimers/bin/dimers.sh (rev 0)
+++ SwiftApps/CMTS/dimers/bin/dimers.sh 2012-08-27 07:14:42 UTC (rev 5907)
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+prev_ndimers_file=$1
+dimer_file=$2
+n_dimers_to_add=$3
+virion_radius=$4
+ndimers=$5
+
+insert_molecules ${prev_ndimers_file} ${dimer_file} ${n_dimers_to_add} ${virion_radius} 0 25.0 start_${ndimers}.lammps_config
+
+lmp_john -in lammps_new_spherical.in -var CONFIG start_${ndimers}.lammps_config -var NTDNTD_LJEPS 5.0 -var NTDCTD_LJEPS 5.0 -var RANDOMSEED 666 -var SPHERE_RADIUS ${virion_radius} -var NDIMERS ${ndimers}
+
+restart2data end_${ndimers}.restart end_${ndimers}.lammps_config
+
Property changes on: SwiftApps/CMTS/dimers/bin/dimers.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: SwiftApps/CMTS/dimers/conf/grotthuss.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss.cf 2012-08-23 18:51:16 UTC (rev 5906)
+++ SwiftApps/CMTS/dimers/conf/grotthuss.cf 2012-08-27 07:14:42 UTC (rev 5907)
@@ -7,6 +7,5 @@
provider.staging.pin.swiftfiles=false
use.wrapper.staging=false
-#app insert_molecules=$PWD/../bin/insert_molecules
-#app restart2data=$PWD/../bin/restart2data.sh
+#app dimers=$PWD/../bin/dimers.sh
Modified: SwiftApps/CMTS/dimers/conf/makena.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena.cf 2012-08-23 18:51:16 UTC (rev 5906)
+++ SwiftApps/CMTS/dimers/conf/makena.cf 2012-08-27 07:14:42 UTC (rev 5907)
@@ -7,6 +7,4 @@
provider.staging.pin.swiftfiles=false
use.wrapper.staging=false
-#app insert_molecules=$PWD/../bin/insert_molecules
-#app restart2data=$PWD/../bin/restart2data.sh
-
+#app dimers=$PWD/../bin/dimers.sh
Modified: SwiftApps/CMTS/dimers/dimers.swift
===================================================================
--- SwiftApps/CMTS/dimers/dimers.swift 2012-08-23 18:51:16 UTC (rev 5906)
+++ SwiftApps/CMTS/dimers/dimers.swift 2012-08-27 07:14:42 UTC (rev 5907)
@@ -1,33 +1,30 @@
type file;
-app (file lamps_config_output) insert_molecules (file lamps_config, file dimer, int delta, int v_radius)
+# Dimers wrapper script
+app (file config_out, file restart_out, file trajectory_out) dimers (file previous_file, file lampps_input_file, file dimer, int dimers_to_add, int v_radius, int step)
{
- insert_molecules @lamps_config @dimer delta v_radius 0 25.0 @lamps_config_output;
+ dimers @previous_file @dimer dimers_to_add v_radius step;
}
-app (file output_file) restart2data (file restart_file, file config_file)
-{
- restart2data @restart_file @config_file;
-}
-
-int start_ndimers=20;
-int max_ndimers=70;
+# Parameters
+int start_ndimers=5;
+int max_ndimers=30;
int delta_ndimers=5;
int virion_radius=300;
+# Files
file dimer_file <"dimer_1232.lammps_config">;
file initial_output <"empty.lammps_config">;
-file outputs[];
-outputs[start_ndimers-delta_ndimers] = initial_output;
+file lampps_input <"lammps_new_spherical.in">;
+file lampps_configs[];
-foreach i in [start_ndimers:max_ndimers:delta_ndimers] {
+lampps_configs[start_ndimers-delta_ndimers] = initial_output;
- file molecule_output ;
- molecule_output = insert_molecules(outputs[i-delta_ndimers], dimer_file, delta_ndimers, virion_radius);
-
- file restart_input ;
- file restart_output ;
- restart_output = restart2data(restart_input, molecule_output);
-
- outputs[i] = restart_output;
+# Main loop - example of a serial dependency
+foreach i in [start_ndimers:max_ndimers:delta_ndimers] {
+ file config ;
+ file restart ;
+ file trajectory ;
+ (config, restart, trajectory) = dimers(lampps_configs[i-delta_ndimers], lampps_input, dimer_file, delta_ndimers, virion_radius, i);
+ lampps_configs[i] = config;
}
Deleted: SwiftApps/CMTS/dimers/input_files/end_20.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_25.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_30.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_35.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_40.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_45.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_50.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_55.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_60.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_65.restart.swift
===================================================================
(Binary files differ)
Deleted: SwiftApps/CMTS/dimers/input_files/end_70.restart.swift
===================================================================
(Binary files differ)
Added: SwiftApps/CMTS/dimers/input_files/lammps_new_spherical.in
===================================================================
--- SwiftApps/CMTS/dimers/input_files/lammps_new_spherical.in (rev 0)
+++ SwiftApps/CMTS/dimers/input_files/lammps_new_spherical.in 2012-08-27 07:14:42 UTC (rev 5907)
@@ -0,0 +1,382 @@
+#
+# You need to pass the following variables via the command line:
+#
+# "CONFIG", "NTDNTD_LJEPS", "NTDCTD_LJEPS", "RANDOMSEED", "SPHERE_RADIUS", "NDIMERS"
+#
+# Example:
+#
+# lammps -in -var CONFIG 1232.lammps_config -var NTDNTD_LJEPS 5.0 -var NTDCTD_LJEPS 5.0 -var RANDOMSEED 666 -var SPHERE_RADIUS x -var NDIMERS y
+#
+
+variable LOGFILE string log.${NDIMERS}
+log ${LOGFILE}
+
+print "Defined variables:"
+print "CONFIG: ${CONFIG}"
+print "RANDOMSEED: ${RANDOMSEED}"
+print "NTDNTD_LJEPS: ${NTDNTD_LJEPS}"
+print "NTDCTD_LJEPS: ${NTDCTD_LJEPS}"
+print "SPHERE_RADIUS: ${SPHERE_RADIUS}"
+print "NDIMERS: ${NDIMERS}"
+
+variable DUMPFILE string traj_${NDIMERS}.lammpstrj
+variable RESTARTFILE string end_${NDIMERS}.restart
+
+variable TSTART equal 310.0
+variable TEND equal 310.0
+variable TDAMP equal 100.0
+
+variable TIMESTEP equal 5.0
+#variable NSTEPS equal 20000000
+#variable DUMPEVERY equal 100000
+variable NSTEPS equal 10000
+variable DUMPEVERY equal 1000
+
+
+units real
+atom_style molecular
+boundary f f f
+
+print "Reading data from ${CONFIG}..."
+read_data ${CONFIG}
+
+# 1 1.000 # 1_1
+# 2 1.000 # 1_2
+# 3 1.000 # 1_3
+# 4 1.000 # 1_4
+# 5 1.000 # 2_1
+# 6 1.000 # 2_2
+# 7 1.000 # 3_1
+# 8 1.000 # 3_2
+# 9 1.000 # 3_3
+# 10 1.000 # 4_1
+# 11 1.000 # 4_2
+# 12 1.000 # 4_3
+# 13 1.000 # 4_4
+# 14 1.000 # 4_5
+# 15 1.000 # 4_6
+# 16 1.000 # 5_1
+# 17 1.000 # 6_1
+# 18 1.000 # 6_2
+# 19 1.000 # 6_3
+# 20 1.000 # 7_1
+# 21 1.000 # 7_2
+# 22 1.000 # 7_3
+# 23 1.000 # 7_4
+# 24 1.000 # 7_5
+# 25 1.000 # 7_6
+# 26 1.000 # AN1
+# 27 1.000 # AN2
+# 28 1.000 # AC1
+# 29 1.000 # AC2
+# 30 1.000 # 8_1
+# 31 1.000 # 8_2
+# 32 1.000 # 8_3
+# 33 1.000 # 8_4
+# 34 1.000 # 9_1
+# 35 1.000 # 9_2
+# 36 1.000 # 9_3
+# 37 1.000 # 9_4
+# 38 1.000 # 10_1
+# 39 1.000 # 10_2
+# 40 1.000 # 10_3
+# 41 1.000 # 11_1
+# 42 1.000 # 11_2
+# 43 1.000 # 12
+
+
+###################################################
+# Bond parameters etc
+###################################################
+bond_style harmonic
+bond_coeff 1 0.1 9.17 # dimer, where necessary
+# NTD-CTD linker constraints; there seem to be relatively insensitive.
+bond_coeff 2 10.0 0.0 # Pivot 1
+bond_coeff 3 10.0 0.0 # Pivot 2
+
+#
+# Improper - parameterized from the CG capsid structure. ~132 degrees
+# reproduces the angle distribution from the CG capsid in simulation pretty well!
+#
+improper_style harmonic
+improper_coeff 1 100.0 132.0
+improper_coeff 2 100.0 132.0
+
+###################################################
+# Ignore forces for beads in the same rigid body
+###################################################
+neigh_modify exclude molecule all
+
+
+###################################################
+# Let's look at what energy we get out of the
+# NTDNTD and NTDCTD interactions during the scale-in,
+# as well as the ghost bonds for the CTD pivot and
+# thw CTD dimer interface bond.
+###################################################
+
+#
+# pairwise interacting types:
+#
+# Although 2_1 -> 3_3 is a smaller distance, 2_2 -> 3_3 is *slightly* more conserved (ie smaller
+# standard deviation / standard error, and smaller absolute gap between lowest and largest distances
+# measured from capsid). It also works *much* better than 2_1 -> 3_3!
+#
+# 4_1 -> 8_3 has a *slightly* smaller average distance and *slightly* smaller spread of values from
+# smallest to largest vs 4_1 -> 8_2 (albeit the standard deviation and standard error are a little
+# larger). I'm not sure there's much of a difference, here; if you plot the distributions using
+# the structural_analysis program, they're basically the same!
+#
+variable tNN1 equal 6 # 2_2
+variable tNN2 equal 9 # 3_3
+variable tNC1 equal 10 # 4_1
+variable tNC2 equal 32 # 8_3
+
+# sites involved in the rotation axis, NTD and CTD
+variable tAN1 equal 26
+variable tAN2 equal 27
+variable tAC1 equal 28
+variable tAC2 equal 29
+
+# dimer bond
+variable tDIM equal 43
+
+#
+# NTD-NTD interaction: 2_1 and 3_3
+#
+group gNN1 type ${tNN1}
+compute NN_pe_v1 gNN1 pe/atom
+compute NN_pe_1 all reduce sum c_NN_pe_v1
+
+group gNN2 type ${tNN2}
+compute NN_pe_v2 gNN2 pe/atom
+compute NN_pe_2 all reduce sum c_NN_pe_v2
+
+group gNN1_NN2 type ${tNN1} ${tNN2}
+compute NN_pe_v gNN1_NN2 pe/atom
+compute NN_pe all reduce sum c_NN_pe_v
+
+#
+# NTD-CTD interaction: 4_1 and 8_2 (or ghost bead!)
+#
+group gNC1 type ${tNC1}
+compute NC_pe_v1 gNC1 pe/atom
+compute NC_pe_1 all reduce sum c_NC_pe_v1
+
+group gNC2 type ${tNC2}
+compute NC_pe_v2 gNC2 pe/atom
+compute NC_pe_2 all reduce sum c_NC_pe_v2
+
+group gNC1_NC2 type ${tNC1} ${tNC2}
+compute NC_pe_v gNC1_NC2 pe/atom
+compute NC_pe all reduce sum c_NC_pe_v
+
+group gNN_NC type ${tNN1} ${tNN2} ${tNC1} ${tNC2}
+compute NN_NC_pe_v gNN_NC pe/atom
+compute NN_NC_pe all reduce sum c_NN_NC_pe_v
+
+#
+# Ghost bond interactions - DI is dimer interface!
+#
+group gAN1_AC1 type ${tAN1} ${tAC1}
+group gAN2_AC2 type ${tAN2} ${tAC2}
+group gPivot type ${tAN1} ${tAC1} ${tAN2} ${tAC2}
+group gDI type ${tDIM}
+
+compute A1_be_v gAN1_AC1 pe/atom bond
+compute A1_be all reduce sum c_A1_be_v
+
+compute A2_be_v gAN2_AC2 pe/atom bond
+compute A2_be all reduce sum c_A2_be_v
+
+compute Pivot_be_v gPivot pe/atom bond
+compute Pivot_be all reduce sum c_Pivot_be_v
+
+compute DI_be_v gDI pe/atom bond
+compute DI_be all reduce sum c_DI_be_v
+
+#
+# check what weird-ass method lammps uses for the improper dihedral calculation
+#
+#group gimp1 id 25 27 26 30
+group gimp1 type 25 27 26 30
+compute imp1 gimp1 improper/local chi
+compute imp1_min all reduce min c_imp1
+compute imp1_ave all reduce ave c_imp1
+compute imp1_max all reduce max c_imp1
+
+
+# special thermo output for scale-in; list temperature, bond energy, nonbonded energy, then specific NTD-NTD, NTD-CTD and NTDNTD+NTDCTD energy
+thermo_style custom step cpu temp evdwl c_NN_pe c_NC_pe c_NN_NC_pe ebond c_A1_be c_A2_be c_Pivot_be c_DI_be c_imp1_min c_imp1_ave c_imp1_max
+
+
+###################################################
+# some system info
+###################################################
+thermo ${DUMPEVERY}
+dump 1 all custom ${DUMPEVERY} ${DUMPFILE} id mol type x y z
+dump_modify 1 sort id
+timestep ${TIMESTEP}
+
+
+###################################################
+# Fixes, initial velocity distribution
+###################################################
+# Nose-Hoover
+fix 1 all rigid/nvt molecule temp ${TSTART} ${TEND} ${TDAMP} tparam 10 6 3
+
+# sphere constraint
+fix 2 all wall/harmonicsphericaljohn xhi ${SPHERE_RADIUS} 0.05 1.0 ${SPHERE_RADIUS} units box
+
+# Langevin
+#fix 1 all rigid/nve molecule
+#fix 2 all langevin ${TSTART} ${TEND} ${TDAMP} ${RANDOMSEED}
+
+velocity all create ${TSTART} ${RANDOMSEED} mom yes rot yes dist gaussian
+
+
+#############################################################
+# Nonbonded: Morse (pure exclusion) & LJ (attractive wells) #
+#############################################################
+# Notes:
+# 1. Lammps uses the star notation for "all types", but it's
+# implicit that the second type in the pair_coeff line is
+# larger than the first; we therefore have to use the star
+# both "before" and "after" the global type interaction.
+# This is why eg the ghost types have both "x *" and
+# "* x" when we set them to have no excluded volume effect
+# with any other type in the system.
+#############################################################
+#pair_style hybrid lj/cut 25.0 lj/john 12.0 morse 12.0
+pair_style hybrid lj/cut 25.0 morse 12.0
+# -- Morse params -------------------------------------------
+variable MORSE_D0 equal 0.0001
+variable MORSE_ALPHA equal 4.5
+
+# -- default size excluded radius ----
+pair_coeff * * morse ${MORSE_D0} ${MORSE_ALPHA} 12.0 12.0
+
+# -- raw output from capsid analysis, independent NTD and CTD superpositions ----
+pair_coeff 1 1 morse ${MORSE_D0} ${MORSE_ALPHA} 9.891 9.891 # 1_1 1_1: 9.891 10.705 10.755
+pair_coeff 1 2 morse ${MORSE_D0} ${MORSE_ALPHA} 9.565 9.565 # 1_1 1_2: 9.565 10.301 10.347
+pair_coeff 1 3 morse ${MORSE_D0} ${MORSE_ALPHA} 11.366 11.366 # 1_1 1_3: 11.366 11.935 11.971
+pair_coeff 1 6 morse ${MORSE_D0} ${MORSE_ALPHA} 10.178 10.178 # 1_1 2_2: 10.178 10.187 10.188
+pair_coeff 2 2 morse ${MORSE_D0} ${MORSE_ALPHA} 11.196 11.196 # 1_2 1_2: 11.196 11.197 11.198
+pair_coeff 2 3 morse ${MORSE_D0} ${MORSE_ALPHA} 11.207 11.207 # 1_2 1_3: 11.207 11.207 11.209
+pair_coeff 2 6 morse ${MORSE_D0} ${MORSE_ALPHA} 11.657 11.657 # 1_2 2_2: 11.657 11.883 11.897
+pair_coeff 3 29 morse ${MORSE_D0} ${MORSE_ALPHA} 11.247 11.247 # 1_3 AC2: 11.247 11.247 11.247
+pair_coeff 4 29 morse ${MORSE_D0} ${MORSE_ALPHA} 10.586 10.586 # 1_4 AC2: 10.586 11.428 11.796
+pair_coeff 5 8 morse ${MORSE_D0} ${MORSE_ALPHA} 10.814 10.814 # 2_1 3_2: 10.814 10.862 11.644
+pair_coeff 5 9 morse ${MORSE_D0} ${MORSE_ALPHA} 7.744 7.744 # 2_1 3_3: 7.744 7.773 8.243
+pair_coeff 5 29 morse ${MORSE_D0} ${MORSE_ALPHA} 7.128 7.128 # 2_1 AC2: 7.128 8.862 11.920
+pair_coeff 5 33 morse ${MORSE_D0} ${MORSE_ALPHA} 10.876 10.876 # 2_1 8_4: 10.876 11.619 11.997
+pair_coeff 6 8 morse ${MORSE_D0} ${MORSE_ALPHA} 10.393 10.393 # 2_2 3_2: 10.393 10.456 11.492
+pair_coeff 6 9 morse ${MORSE_D0} ${MORSE_ALPHA} 9.675 9.675 # 2_2 3_3: 9.675 9.704 10.159
+pair_coeff 8 29 morse ${MORSE_D0} ${MORSE_ALPHA} 9.672 9.672 # 3_2 AC2: 9.672 11.430 11.997
+pair_coeff 9 27 morse ${MORSE_D0} ${MORSE_ALPHA} 9.945 9.945 # 3_3 AN2: 9.945 9.967 10.322
+pair_coeff 9 29 morse ${MORSE_D0} ${MORSE_ALPHA} 6.143 6.143 # 3_3 AC2: 6.143 8.920 11.839
+pair_coeff 9 33 morse ${MORSE_D0} ${MORSE_ALPHA} 10.806 10.806 # 3_3 8_4: 10.806 11.524 11.972
+pair_coeff 10 26 morse ${MORSE_D0} ${MORSE_ALPHA} 11.109 11.109 # 4_1 AN1: 11.109 11.128 11.431
+pair_coeff 10 27 morse ${MORSE_D0} ${MORSE_ALPHA} 9.080 9.080 # 4_1 AN2: 9.080 9.083 9.117
+pair_coeff 10 28 morse ${MORSE_D0} ${MORSE_ALPHA} 7.985 7.985 # 4_1 AC1: 7.985 10.524 11.996
+pair_coeff 10 29 morse ${MORSE_D0} ${MORSE_ALPHA} 2.501 2.501 # 4_1 AC2: 2.501 8.595 10.808
+pair_coeff 10 30 morse ${MORSE_D0} ${MORSE_ALPHA} 8.581 8.581 # 4_1 8_1: 8.581 10.780 11.991
+pair_coeff 10 31 morse ${MORSE_D0} ${MORSE_ALPHA} 5.397 5.397 # 4_1 8_2: 5.397 7.996 10.379
+pair_coeff 10 32 morse ${MORSE_D0} ${MORSE_ALPHA} 5.100 5.100 # 4_1 8_3: 5.100 7.925 9.861
+pair_coeff 10 33 morse ${MORSE_D0} ${MORSE_ALPHA} 5.196 5.196 # 4_1 8_4: 5.196 9.826 11.658
+pair_coeff 10 41 morse ${MORSE_D0} ${MORSE_ALPHA} 10.110 10.110 # 4_1 11_1: 10.110 11.413 11.999
+pair_coeff 10 42 morse ${MORSE_D0} ${MORSE_ALPHA} 11.606 11.606 # 4_1 11_2: 11.606 11.835 11.995
+pair_coeff 11 27 morse ${MORSE_D0} ${MORSE_ALPHA} 11.301 11.301 # 4_2 AN2: 11.301 11.308 11.409
+pair_coeff 11 28 morse ${MORSE_D0} ${MORSE_ALPHA} 10.782 10.782 # 4_2 AC1: 10.782 11.744 12.000
+pair_coeff 11 29 morse ${MORSE_D0} ${MORSE_ALPHA} 4.749 4.749 # 4_2 AC2: 4.749 10.138 11.996
+pair_coeff 11 30 morse ${MORSE_D0} ${MORSE_ALPHA} 11.415 11.415 # 4_2 8_1: 11.415 11.719 11.973
+pair_coeff 11 31 morse ${MORSE_D0} ${MORSE_ALPHA} 8.439 8.439 # 4_2 8_2: 8.439 11.119 11.999
+pair_coeff 11 32 morse ${MORSE_D0} ${MORSE_ALPHA} 8.333 8.333 # 4_2 8_3: 8.333 11.011 11.999
+pair_coeff 11 33 morse ${MORSE_D0} ${MORSE_ALPHA} 8.698 8.698 # 4_2 8_4: 8.698 11.123 11.998
+pair_coeff 11 41 morse ${MORSE_D0} ${MORSE_ALPHA} 8.066 8.066 # 4_2 11_1: 8.066 10.726 12.000
+pair_coeff 11 42 morse ${MORSE_D0} ${MORSE_ALPHA} 11.011 11.011 # 4_2 11_2: 11.011 11.622 11.998
+pair_coeff 12 29 morse ${MORSE_D0} ${MORSE_ALPHA} 9.835 9.835 # 4_3 AC2: 9.835 11.080 11.989
+pair_coeff 12 41 morse ${MORSE_D0} ${MORSE_ALPHA} 9.931 9.931 # 4_3 11_1: 9.931 11.300 11.999
+pair_coeff 24 29 morse ${MORSE_D0} ${MORSE_ALPHA} 10.115 10.115 # 7_5 AC2: 10.115 11.358 12.000
+pair_coeff 24 33 morse ${MORSE_D0} ${MORSE_ALPHA} 10.974 10.974 # 7_5 8_4: 10.974 11.572 11.997
+pair_coeff 24 41 morse ${MORSE_D0} ${MORSE_ALPHA} 10.207 10.207 # 7_5 11_1: 10.207 11.419 11.992
+pair_coeff 24 42 morse ${MORSE_D0} ${MORSE_ALPHA} 9.468 9.468 # 7_5 11_2: 9.468 11.169 11.998
+pair_coeff 25 28 morse ${MORSE_D0} ${MORSE_ALPHA} 11.525 11.525 # 7_6 AC1: 11.525 11.777 11.982
+pair_coeff 25 29 morse ${MORSE_D0} ${MORSE_ALPHA} 9.917 9.917 # 7_6 AC2: 9.917 11.265 11.994
+pair_coeff 25 30 morse ${MORSE_D0} ${MORSE_ALPHA} 10.548 10.548 # 7_6 8_1: 10.548 11.533 11.977
+pair_coeff 25 33 morse ${MORSE_D0} ${MORSE_ALPHA} 9.307 9.307 # 7_6 8_4: 9.307 10.121 11.997
+pair_coeff 25 41 morse ${MORSE_D0} ${MORSE_ALPHA} 10.508 10.508 # 7_6 11_1: 10.508 11.500 11.989
+pair_coeff 25 42 morse ${MORSE_D0} ${MORSE_ALPHA} 8.144 8.144 # 7_6 11_2: 8.144 10.663 11.985
+pair_coeff 26 28 morse ${MORSE_D0} ${MORSE_ALPHA} 0.277 0.277 # AN1 AC1: 0.277 1.693 4.228
+pair_coeff 26 29 morse ${MORSE_D0} ${MORSE_ALPHA} 8.840 8.840 # AN1 AC2: 8.840 10.660 11.997
+pair_coeff 26 30 morse ${MORSE_D0} ${MORSE_ALPHA} 9.190 9.190 # AN1 8_1: 9.190 11.163 11.999
+pair_coeff 26 31 morse ${MORSE_D0} ${MORSE_ALPHA} 5.725 5.725 # AN1 8_2: 5.725 8.001 10.884
+pair_coeff 26 32 morse ${MORSE_D0} ${MORSE_ALPHA} 2.296 2.296 # AN1 8_3: 2.296 4.609 7.720
+pair_coeff 26 33 morse ${MORSE_D0} ${MORSE_ALPHA} 4.298 4.298 # AN1 8_4: 4.298 6.119 8.959
+pair_coeff 26 34 morse ${MORSE_D0} ${MORSE_ALPHA} 7.771 7.771 # AN1 9_1: 7.771 10.421 11.992
+pair_coeff 26 35 morse ${MORSE_D0} ${MORSE_ALPHA} 5.446 5.446 # AN1 9_2: 5.446 8.505 11.909
+pair_coeff 26 36 morse ${MORSE_D0} ${MORSE_ALPHA} 5.025 5.025 # AN1 9_3: 5.025 8.167 11.994
+pair_coeff 26 37 morse ${MORSE_D0} ${MORSE_ALPHA} 5.987 5.987 # AN1 9_4: 5.987 9.062 11.969
+pair_coeff 26 43 morse ${MORSE_D0} ${MORSE_ALPHA} 3.816 3.816 # AN1 12: 3.816 7.256 11.981
+pair_coeff 27 28 morse ${MORSE_D0} ${MORSE_ALPHA} 6.778 6.778 # AN2 AC1: 6.778 9.066 10.948
+pair_coeff 27 29 morse ${MORSE_D0} ${MORSE_ALPHA} 0.422 0.422 # AN2 AC2: 0.422 2.216 7.719
+pair_coeff 27 31 morse ${MORSE_D0} ${MORSE_ALPHA} 11.120 11.120 # AN2 8_2: 11.120 11.821 11.999
+pair_coeff 27 32 morse ${MORSE_D0} ${MORSE_ALPHA} 6.050 6.050 # AN2 8_3: 6.050 7.306 9.818
+pair_coeff 27 33 morse ${MORSE_D0} ${MORSE_ALPHA} 2.330 2.330 # AN2 8_4: 2.330 4.398 7.000
+pair_coeff 27 34 morse ${MORSE_D0} ${MORSE_ALPHA} 10.795 10.795 # AN2 9_1: 10.795 11.697 11.975
+pair_coeff 27 35 morse ${MORSE_D0} ${MORSE_ALPHA} 11.673 11.673 # AN2 9_2: 11.673 11.673 11.673
+pair_coeff 27 43 morse ${MORSE_D0} ${MORSE_ALPHA} 10.447 10.447 # AN2 12: 10.447 11.613 11.965
+pair_coeff 30 40 morse ${MORSE_D0} ${MORSE_ALPHA} 9.753 9.753 # 8_1 10_3: 9.753 11.067 11.975
+pair_coeff 34 34 morse ${MORSE_D0} ${MORSE_ALPHA} 4.337 4.337 # 9_1 9_1: 4.337 9.883 10.595
+pair_coeff 34 35 morse ${MORSE_D0} ${MORSE_ALPHA} 6.685 6.685 # 9_1 9_2: 6.685 6.686 6.687
+pair_coeff 34 36 morse ${MORSE_D0} ${MORSE_ALPHA} 9.967 9.967 # 9_1 9_3: 9.967 9.968 9.969
+pair_coeff 34 43 morse ${MORSE_D0} ${MORSE_ALPHA} 7.367 7.367 # 9_1 12: 7.367 11.092 11.571
+pair_coeff 35 35 morse ${MORSE_D0} ${MORSE_ALPHA} 6.424 6.424 # 9_2 9_2: 6.424 6.425 6.426
+pair_coeff 35 36 morse ${MORSE_D0} ${MORSE_ALPHA} 7.873 7.873 # 9_2 9_3: 7.873 7.874 7.875
+pair_coeff 35 37 morse ${MORSE_D0} ${MORSE_ALPHA} 11.212 11.212 # 9_2 9_4: 11.212 11.213 11.214
+pair_coeff 35 43 morse ${MORSE_D0} ${MORSE_ALPHA} 5.309 5.309 # 9_2 12: 5.309 10.529 11.200
+pair_coeff 36 36 morse ${MORSE_D0} ${MORSE_ALPHA} 6.831 6.831 # 9_3 9_3: 6.831 6.832 6.833
+pair_coeff 36 37 morse ${MORSE_D0} ${MORSE_ALPHA} 8.652 8.652 # 9_3 9_4: 8.652 8.653 8.654
+pair_coeff 36 43 morse ${MORSE_D0} ${MORSE_ALPHA} 5.640 5.640 # 9_3 12: 5.640 10.765 11.424
+pair_coeff 37 37 morse ${MORSE_D0} ${MORSE_ALPHA} 8.340 8.340 # 9_4 9_4: 8.340 8.341 8.342
+pair_coeff 37 43 morse ${MORSE_D0} ${MORSE_ALPHA} 8.910 8.910 # 9_4 12: 8.910 8.911 8.912
+pair_coeff 38 40 morse ${MORSE_D0} ${MORSE_ALPHA} 9.360 9.360 # 10_1 10_3: 9.360 10.984 11.983
+pair_coeff 39 39 morse ${MORSE_D0} ${MORSE_ALPHA} 9.299 9.299 # 10_2 10_2: 9.299 11.228 12.000
+pair_coeff 39 40 morse ${MORSE_D0} ${MORSE_ALPHA} 6.916 6.916 # 10_2 10_3: 6.916 10.645 11.995
+pair_coeff 39 42 morse ${MORSE_D0} ${MORSE_ALPHA} 9.311 9.311 # 10_2 11_2: 9.311 11.030 11.989
+pair_coeff 40 40 morse ${MORSE_D0} ${MORSE_ALPHA} 4.327 4.327 # 10_3 10_3: 4.327 9.538 11.995
+pair_coeff 40 41 morse ${MORSE_D0} ${MORSE_ALPHA} 8.798 8.798 # 10_3 11_1: 8.798 10.732 12.000
+pair_coeff 40 42 morse ${MORSE_D0} ${MORSE_ALPHA} 5.234 5.234 # 10_3 11_2: 5.234 9.733 11.998
+pair_coeff 41 41 morse ${MORSE_D0} ${MORSE_ALPHA} 8.882 8.882 # 11_1 11_1: 8.882 10.866 11.874
+pair_coeff 41 42 morse ${MORSE_D0} ${MORSE_ALPHA} 8.214 8.214 # 11_1 11_2: 8.214 10.925 11.993
+pair_coeff 42 42 morse ${MORSE_D0} ${MORSE_ALPHA} 8.702 8.702 # 11_2 11_2: 8.702 10.987 11.983
+pair_coeff 43 43 morse ${MORSE_D0} ${MORSE_ALPHA} 5.173 5.173 # 12 12: 5.173 8.727 9.183
+
+# -- ghost sites have no morse interaction with anything ----
+pair_coeff 26 * morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff * 26 morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff 27 * morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff * 27 morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff 28 * morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff * 28 morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff 29 * morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff * 29 morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff 43 * morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+pair_coeff * 43 morse ${MORSE_D0} ${MORSE_ALPHA} 0.0 0.0
+
+# from independent NTD and CTD superpositions onto hexs and pents
+#pair_coeff ${tNN1} ${tNN2} lj/cut ${NTDNTD_LJEPS} 6.925
+#pair_coeff ${tNC1} ${tNC2} lj/cut ${NTDCTD_LJEPS} 7.39
+
+# from superposition onto capsid
+#pair_coeff ${tNN1} ${tNN2} lj/cut ${NTDNTD_LJEPS} 7.27
+#pair_coeff ${tNC1} ${tNC2} lj/cut ${NTDCTD_LJEPS} 8.3
+
+pair_coeff ${tNN1} ${tNN2} lj/cut ${NTDNTD_LJEPS} 8.65 # for 2_2, 3_3 - most conserved NTD-NTD distance from capsid!
+pair_coeff ${tNC1} ${tNC2} lj/cut ${NTDCTD_LJEPS} 7.39 # for 4_1, 8_3 - most conserved NTD-CTD distance from capsid!
+
+pair_modify shift yes
+
+run ${NSTEPS}
+
+write_restart ${RESTARTFILE}
\ No newline at end of file
From davidk at ci.uchicago.edu Mon Aug 27 11:36:20 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 27 Aug 2012 11:36:20 -0500 (CDT)
Subject: [Swift-commit] r5908 - in SwiftApps/CMTS/dimers: . bin
Message-ID: <20120827163620.C831B9CC9C@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-27 11:36:20 -0500 (Mon, 27 Aug 2012)
New Revision: 5908
Modified:
SwiftApps/CMTS/dimers/README
SwiftApps/CMTS/dimers/bin/dimers.sh
Log:
Use MPI
Modified: SwiftApps/CMTS/dimers/README
===================================================================
--- SwiftApps/CMTS/dimers/README 2012-08-27 07:14:42 UTC (rev 5907)
+++ SwiftApps/CMTS/dimers/README 2012-08-27 16:36:20 UTC (rev 5908)
@@ -46,7 +46,7 @@
Usage: rundimers.sh [-s sitename]
The sitename option determines where a run will take place. Currently, the
-only tested options are "makena" and "grotthuss".
+only tested option is "makena".
Example:
Modified: SwiftApps/CMTS/dimers/bin/dimers.sh
===================================================================
--- SwiftApps/CMTS/dimers/bin/dimers.sh 2012-08-27 07:14:42 UTC (rev 5907)
+++ SwiftApps/CMTS/dimers/bin/dimers.sh 2012-08-27 16:36:20 UTC (rev 5908)
@@ -6,9 +6,11 @@
virion_radius=$4
ndimers=$5
+lmp_john=`which lmp_john`
+
insert_molecules ${prev_ndimers_file} ${dimer_file} ${n_dimers_to_add} ${virion_radius} 0 25.0 start_${ndimers}.lammps_config
-lmp_john -in lammps_new_spherical.in -var CONFIG start_${ndimers}.lammps_config -var NTDNTD_LJEPS 5.0 -var NTDCTD_LJEPS 5.0 -var RANDOMSEED 666 -var SPHERE_RADIUS ${virion_radius} -var NDIMERS ${ndimers}
+mpiexec -machinefile $PBS_NODEFILE ${lmp_john} -in lammps_new_spherical.in -var CONFIG start_${ndimers}.lammps_config -var NTDNTD_LJEPS 5.0 -var NTDCTD_LJEPS 5.0 -var RANDOMSEED 666 -var SPHERE_RADIUS ${virion_radius} -var NDIMERS ${ndimers}
restart2data end_${ndimers}.restart end_${ndimers}.lammps_config
From davidk at ci.uchicago.edu Mon Aug 27 12:18:15 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 27 Aug 2012 12:18:15 -0500 (CDT)
Subject: [Swift-commit] r5909 - in SwiftApps/CMTS/dimers: . docs docs/images
docs/images/icons docs/stylesheets
Message-ID: <20120827171815.5ADA29CC9E@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-27 12:18:15 -0500 (Mon, 27 Aug 2012)
New Revision: 5909
Added:
SwiftApps/CMTS/dimers/docs/
SwiftApps/CMTS/dimers/docs/README
SwiftApps/CMTS/dimers/docs/images/
SwiftApps/CMTS/dimers/docs/images/icons/
SwiftApps/CMTS/dimers/docs/images/icons/caution.png
SwiftApps/CMTS/dimers/docs/images/icons/example.png
SwiftApps/CMTS/dimers/docs/images/icons/home.png
SwiftApps/CMTS/dimers/docs/images/icons/important.png
SwiftApps/CMTS/dimers/docs/images/icons/next.png
SwiftApps/CMTS/dimers/docs/images/icons/note.png
SwiftApps/CMTS/dimers/docs/images/icons/prev.png
SwiftApps/CMTS/dimers/docs/images/icons/tip.png
SwiftApps/CMTS/dimers/docs/images/icons/up.png
SwiftApps/CMTS/dimers/docs/images/icons/warning.png
SwiftApps/CMTS/dimers/docs/stylesheets/
SwiftApps/CMTS/dimers/docs/stylesheets/asciidoc.css
Log:
Document generation scripts
Added: SwiftApps/CMTS/dimers/docs/README
===================================================================
--- SwiftApps/CMTS/dimers/docs/README (rev 0)
+++ SwiftApps/CMTS/dimers/docs/README 2012-08-27 17:18:15 UTC (rev 5909)
@@ -0,0 +1 @@
+link ../README
\ No newline at end of file
Property changes on: SwiftApps/CMTS/dimers/docs/README
___________________________________________________________________
Added: svn:special
+ *
Added: SwiftApps/CMTS/dimers/docs/images/icons/caution.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/caution.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/example.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/example.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/home.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/home.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/important.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/important.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/next.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/next.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/note.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/note.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/prev.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/prev.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/tip.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/tip.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/up.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/up.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/images/icons/warning.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/docs/images/icons/warning.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/docs/stylesheets/asciidoc.css
===================================================================
--- SwiftApps/CMTS/dimers/docs/stylesheets/asciidoc.css (rev 0)
+++ SwiftApps/CMTS/dimers/docs/stylesheets/asciidoc.css 2012-08-27 17:18:15 UTC (rev 5909)
@@ -0,0 +1,2 @@
+a:link { color:navy; }
+a:visited { color:navy; }
From davidk at ci.uchicago.edu Mon Aug 27 12:21:52 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 27 Aug 2012 12:21:52 -0500 (CDT)
Subject: [Swift-commit] r5910 - SwiftApps/CMTS/dimers/docs
Message-ID: <20120827172152.537E39CC9E@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-27 12:21:52 -0500 (Mon, 27 Aug 2012)
New Revision: 5910
Added:
SwiftApps/CMTS/dimers/docs/build_docs.sh
Log:
build_docs.sh
Added: SwiftApps/CMTS/dimers/docs/build_docs.sh
===================================================================
--- SwiftApps/CMTS/dimers/docs/build_docs.sh (rev 0)
+++ SwiftApps/CMTS/dimers/docs/build_docs.sh 2012-08-27 17:21:52 UTC (rev 5910)
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+echo Converting README to HTML
+ asciidoc -a toc -a toclevels=2 \
+ -a max-width=750px \
+ -a textwidth=80 \
+ -a stylesheet=$PWD/stylesheets/asciidoc.css \
+ README
+
+echo Converting README to PDF
+ a2x --format=pdf --no-xmllint README
Property changes on: SwiftApps/CMTS/dimers/docs/build_docs.sh
___________________________________________________________________
Added: svn:executable
+ *
From davidk at ci.uchicago.edu Mon Aug 27 16:58:26 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 27 Aug 2012 16:58:26 -0500 (CDT)
Subject: [Swift-commit] r5911 - in SwiftApps/CMTS/rmsd: . conf
Message-ID: <20120827215826.BF8C09CC9E@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-27 16:58:26 -0500 (Mon, 27 Aug 2012)
New Revision: 5911
Modified:
SwiftApps/CMTS/rmsd/conf/grotthuss.cf
SwiftApps/CMTS/rmsd/conf/makena.cf
SwiftApps/CMTS/rmsd/rmsd.sh
Log:
Execution retries should be enabled
Put a delay after renaming files for possible NFS issues
Modified: SwiftApps/CMTS/rmsd/conf/grotthuss.cf
===================================================================
--- SwiftApps/CMTS/rmsd/conf/grotthuss.cf 2012-08-27 17:21:52 UTC (rev 5910)
+++ SwiftApps/CMTS/rmsd/conf/grotthuss.cf 2012-08-27 21:58:26 UTC (rev 5911)
@@ -1,6 +1,6 @@
wrapperlog.always.transfer=true
sitedir.keep=true
-execution.retries=0
+execution.retries=10
lazy.errors=true
status.mode=provider
use.provider.staging=false
Modified: SwiftApps/CMTS/rmsd/conf/makena.cf
===================================================================
--- SwiftApps/CMTS/rmsd/conf/makena.cf 2012-08-27 17:21:52 UTC (rev 5910)
+++ SwiftApps/CMTS/rmsd/conf/makena.cf 2012-08-27 21:58:26 UTC (rev 5911)
@@ -1,6 +1,6 @@
wrapperlog.always.transfer=true
sitedir.keep=true
-execution.retries=0
+execution.retries=10
lazy.errors=true
status.mode=provider
use.provider.staging=false
Modified: SwiftApps/CMTS/rmsd/rmsd.sh
===================================================================
--- SwiftApps/CMTS/rmsd/rmsd.sh 2012-08-27 17:21:52 UTC (rev 5910)
+++ SwiftApps/CMTS/rmsd/rmsd.sh 2012-08-27 21:58:26 UTC (rev 5911)
@@ -18,3 +18,4 @@
mv output/cg_clath_cage.dcd output/cg_clath_cage-$b1-$b2.dcd
mv rmsd.dat output/rmsd.$b1name${b1}_$b2name${b2}.dat
+sleep 5
From davidk at ci.uchicago.edu Tue Aug 28 14:47:25 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Tue, 28 Aug 2012 14:47:25 -0500 (CDT)
Subject: [Swift-commit] r5912 - SwiftApps/CMTS/rmsd
Message-ID: <20120828194725.9FF499CC9C@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-28 14:47:25 -0500 (Tue, 28 Aug 2012)
New Revision: 5912
Modified:
SwiftApps/CMTS/rmsd/rmsd.sh
SwiftApps/CMTS/rmsd/rmsd.swift
Log:
Add more debugging info
Modified: SwiftApps/CMTS/rmsd/rmsd.sh
===================================================================
--- SwiftApps/CMTS/rmsd/rmsd.sh 2012-08-27 21:58:26 UTC (rev 5911)
+++ SwiftApps/CMTS/rmsd/rmsd.sh 2012-08-28 19:47:25 UTC (rev 5912)
@@ -8,14 +8,36 @@
namd_parameters=$6
vmd_script=$7
-sed -i -e s/BLAB1/$b1name$b1/ -e s/BLAB2/$b2name$b2/ -e s at __DIR__@$PWD@ $namd_input
+echo Command line arguments: $@
+echo
+echo File listing
+echo ------------
+find
+echo
+
+echo Running the following sed commands
+echo sed -i -e s/BLAB1/$b1name$b1/ -e s/BLAB2/$b2name$b2/ -e s at __DIR__@$PWD@ $namd_input
+echo sed -i -e s/BLAB1/$b1name$b1/ -e s/BLAB2/$b2name$b2/ -e s at __DIR__@$PWD@ $namd_input
+echo sed -i -e s/HBEPS/-0.01/g -e s/PXEPS/-$b1/g -e s/DTEPS/-$b2/g -e s/AKEPS/-0.01/g -e s/LTEPS/-0.01/g $namd_parameters
+sed -i -e s/BLAB1/$b1name$b1/g -e s/BLAB2/$b2name$b2/g -e s/B1/$b1/ -e s/B2/$b2/ $vmd_script
sed -i -e s/HBEPS/-0.01/g -e s/PXEPS/-$b1/g -e s/DTEPS/-$b2/g -e s/AKEPS/-0.01/g -e s/LTEPS/-0.01/g $namd_parameters
sed -i -e s/BLAB1/$b1name$b1/g -e s/BLAB2/$b2name$b2/g -e s/B1/$b1/ -e s/B2/$b2/ $vmd_script
+echo Done with sed
+echo
namd2=$( which namd2 )
+echo Found namd2 at $namd2
+echo About to run mpiexec -machinefile $PBS_NODEFILE $namd2 $namd_input
mpiexec -machinefile $PBS_NODEFILE $namd2 $namd_input
+
+echo
+echo About to run vmd -dispdev text -e $vmd_script
vmd -dispdev text -e $vmd_script
mv output/cg_clath_cage.dcd output/cg_clath_cage-$b1-$b2.dcd
mv rmsd.dat output/rmsd.$b1name${b1}_$b2name${b2}.dat
-sleep 5
+
+echo
+echo Files at end of run
+find
+echo
Modified: SwiftApps/CMTS/rmsd/rmsd.swift
===================================================================
--- SwiftApps/CMTS/rmsd/rmsd.swift 2012-08-27 21:58:26 UTC (rev 5911)
+++ SwiftApps/CMTS/rmsd/rmsd.swift 2012-08-28 19:47:25 UTC (rev 5912)
@@ -33,8 +33,8 @@
foreach b1 in [b1min:b1max:delta] {
foreach b2 in [b2min:b2max:delta] {
- file output ;
- file error ;
+ file output ;
+ file error ;
file dcd ;
file dat ;
dats[b1][b2] = dat;
From davidk at ci.uchicago.edu Tue Aug 28 16:42:21 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Tue, 28 Aug 2012 16:42:21 -0500 (CDT)
Subject: [Swift-commit] r5913 - SwiftApps/CMTS/rmsd
Message-ID: <20120828214221.8E8BD9CCA2@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-28 16:42:21 -0500 (Tue, 28 Aug 2012)
New Revision: 5913
Modified:
SwiftApps/CMTS/rmsd/rmsd.sh
Log:
Add hostname of node to logs
Modified: SwiftApps/CMTS/rmsd/rmsd.sh
===================================================================
--- SwiftApps/CMTS/rmsd/rmsd.sh 2012-08-28 19:47:25 UTC (rev 5912)
+++ SwiftApps/CMTS/rmsd/rmsd.sh 2012-08-28 21:42:21 UTC (rev 5913)
@@ -10,6 +10,10 @@
echo Command line arguments: $@
echo
+
+echo Hostname: $( hostname )
+echo
+
echo File listing
echo ------------
find
From hategan at ci.uchicago.edu Fri Aug 31 19:47:24 2012
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 31 Aug 2012 19:47:24 -0500 (CDT)
Subject: [Swift-commit] r5914 -
trunk/src/org/griphyn/vdl/karajan/lib/swiftscript
Message-ID: <20120901004724.DE2989CCE6@svn.ci.uchicago.edu>
Author: hategan
Date: 2012-08-31 19:47:24 -0500 (Fri, 31 Aug 2012)
New Revision: 5914
Modified:
trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java
Log:
fixed readData and readStructured with field arguments (or any non-root arguments)
Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java 2012-08-28 21:42:21 UTC (rev 5913)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java 2012-09-01 00:47:24 UTC (rev 5914)
@@ -36,7 +36,6 @@
import org.griphyn.vdl.mapping.AbsFile;
import org.griphyn.vdl.mapping.AbstractDataNode;
import org.griphyn.vdl.mapping.DSHandle;
-import org.griphyn.vdl.mapping.HandleOpenException;
import org.griphyn.vdl.mapping.InvalidPathException;
import org.griphyn.vdl.mapping.Path;
import org.griphyn.vdl.mapping.PhysicalFormat;
@@ -62,7 +61,7 @@
readData(dest, (String) src.getValue());
}
else {
- PhysicalFormat pf = src.getMapper().map(Path.EMPTY_PATH);
+ PhysicalFormat pf = src.getMapper().map(src.getPathFromRoot());
if (pf instanceof AbsFile) {
AbsFile af = (AbsFile) pf;
if (!af.getProtocol().equalsIgnoreCase("file")) {
Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java 2012-08-28 21:42:21 UTC (rev 5913)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java 2012-09-01 00:47:24 UTC (rev 5914)
@@ -57,7 +57,7 @@
readData(dest, (String) src.getValue());
}
else {
- PhysicalFormat pf = src.getMapper().map(Path.EMPTY_PATH);
+ PhysicalFormat pf = src.getMapper().map(src.getPathFromRoot());
if (pf instanceof AbsFile) {
AbsFile af = (AbsFile) pf;
if (!af.getProtocol().equalsIgnoreCase("file")) {
From davidk at ci.uchicago.edu Wed Aug 8 10:13:06 2012
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 08 Aug 2012 15:13:06 -0000
Subject: [Swift-commit] r5893 - in SwiftApps/CMTS/dimers: . bin conf
input_files src
Message-ID: <20120808151256.044159CCBB@svn.ci.uchicago.edu>
Author: davidk
Date: 2012-08-08 10:12:55 -0500 (Wed, 08 Aug 2012)
New Revision: 5893
Added:
SwiftApps/CMTS/dimers/README
SwiftApps/CMTS/dimers/TODO
SwiftApps/CMTS/dimers/bin/
SwiftApps/CMTS/dimers/bin/insert_molecules
SwiftApps/CMTS/dimers/bin/restart2data
SwiftApps/CMTS/dimers/conf/
SwiftApps/CMTS/dimers/conf/beagle.cf
SwiftApps/CMTS/dimers/conf/beagle.xml
SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf
SwiftApps/CMTS/dimers/conf/grotthuss-ssh.xml
SwiftApps/CMTS/dimers/conf/grotthuss.cf
SwiftApps/CMTS/dimers/conf/grotthuss.xml
SwiftApps/CMTS/dimers/conf/local.cf
SwiftApps/CMTS/dimers/conf/local.xml
SwiftApps/CMTS/dimers/conf/makena-ssh.cf
SwiftApps/CMTS/dimers/conf/makena-ssh.xml
SwiftApps/CMTS/dimers/conf/makena.cf
SwiftApps/CMTS/dimers/conf/makena.xml
SwiftApps/CMTS/dimers/conf/makgroth.cf
SwiftApps/CMTS/dimers/conf/makgroth.xml
SwiftApps/CMTS/dimers/conf/mcs.cf
SwiftApps/CMTS/dimers/conf/mcs.conf
SwiftApps/CMTS/dimers/conf/pads-ssh.cf
SwiftApps/CMTS/dimers/conf/pads-ssh.xml
SwiftApps/CMTS/dimers/conf/pads.cf
SwiftApps/CMTS/dimers/conf/pads.xml
SwiftApps/CMTS/dimers/dimers.swift
SwiftApps/CMTS/dimers/input_files/
SwiftApps/CMTS/dimers/input_files/end_20.restart
SwiftApps/CMTS/dimers/input_files/end_25.restart
SwiftApps/CMTS/dimers/input_files/end_30.restart
SwiftApps/CMTS/dimers/input_files/end_35.restart
SwiftApps/CMTS/dimers/input_files/end_40.restart
SwiftApps/CMTS/dimers/input_files/end_45.restart
SwiftApps/CMTS/dimers/input_files/end_50.restart
SwiftApps/CMTS/dimers/input_files/end_55.restart
SwiftApps/CMTS/dimers/input_files/end_60.restart
SwiftApps/CMTS/dimers/input_files/end_65.restart
SwiftApps/CMTS/dimers/input_files/end_70.restart
SwiftApps/CMTS/dimers/rundimers.sh
SwiftApps/CMTS/dimers/src/
SwiftApps/CMTS/dimers/src/GeometryUtil.cpp
SwiftApps/CMTS/dimers/src/GeometryUtil.h
SwiftApps/CMTS/dimers/src/Makefile
SwiftApps/CMTS/dimers/src/Ran1.cpp
SwiftApps/CMTS/dimers/src/Ran1.h
SwiftApps/CMTS/dimers/src/StringUtil.cpp
SwiftApps/CMTS/dimers/src/StringUtil.h
SwiftApps/CMTS/dimers/src/definitions.h
SwiftApps/CMTS/dimers/src/insert_molecules
SwiftApps/CMTS/dimers/src/insert_molecules.cpp
SwiftApps/CMTS/dimers/src/restart2data
SwiftApps/CMTS/dimers/src/restart2data.cpp
Log:
Initial commit of general directory layouts, source files, and config files
Added: SwiftApps/CMTS/dimers/README
===================================================================
Added: SwiftApps/CMTS/dimers/TODO
===================================================================
Added: SwiftApps/CMTS/dimers/bin/insert_molecules
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/bin/insert_molecules
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/bin/restart2data
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/bin/restart2data
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/conf/beagle.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/beagle.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/beagle.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,10 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=3
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#app sumloss=$PWD/../sumloss.sh
+#app evolve=$PWD/../evolve.sh
Added: SwiftApps/CMTS/dimers/conf/beagle.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/beagle.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/beagle.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,23 @@
+
+
+
+
+ KEEP
+
+ 1
+ 100
+ 100
+ pbs.aprun;pbs.mpp;depth=24
+ 10000
+ 01:30:00
+ 50
+ 2
+ 2
+ route
+ 9.59
+ 10000
+
+ _WORK_/beagle
+
+
+
Added: SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/grotthuss-ssh.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+tcp.port.range=5000,51000
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/grotthuss-ssh.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss-ssh.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/grotthuss-ssh.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,20 @@
+
+
+
+
+ 100
+ 100
+ 00:50:00
+ 3600
+ 1
+ 1
+ 2
+ devel
+ 1.01
+ 10000
+ 1
+ single
+ 8
+ _WORK_
+
+
Added: SwiftApps/CMTS/dimers/conf/grotthuss.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/grotthuss.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/grotthuss.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/grotthuss.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/grotthuss.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,19 @@
+
+
+
+
+ 01:00:00
+ 3600
+ 8
+ 1
+ 1
+ devel
+ 5.99
+ 10000
+ 1
+ single
+ 8
+ _WORK_
+
+
+
Added: SwiftApps/CMTS/dimers/conf/local.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/local.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/local.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,10 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#app rmsd=$PWD/../rmsd.sh
Added: SwiftApps/CMTS/dimers/conf/local.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/local.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/local.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,14 @@
+
+
+
+
+ 2.55
+ 10000
+ 4
+ 8
+ 1000
+ 1
+ 4
+ /tmp
+
+
Added: SwiftApps/CMTS/dimers/conf/makena-ssh.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena-ssh.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/makena-ssh.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+tcp.port.range=5000,51000
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/makena-ssh.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena-ssh.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/makena-ssh.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,21 @@
+
+
+
+
+ 100
+ 100
+ 00:50:00
+ 3600
+ 1
+ 1
+ 2
+ devel
+ 1.01
+ 10000
+ 2
+ single
+ 8
+ _WORK_
+
+
+
Added: SwiftApps/CMTS/dimers/conf/makena.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/makena.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/makena.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/makena.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/makena.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,20 @@
+
+
+
+
+ 01:00:00
+ 3600
+ 8
+ 1
+ 2
+ 2
+ devel
+ 5.99
+ 10000
+ 2
+ single
+ 8
+ _WORK_
+
+
+
Added: SwiftApps/CMTS/dimers/conf/makgroth.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/makgroth.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/makgroth.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+tcp.port.range=5000,51000
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/makgroth.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/makgroth.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/makgroth.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,41 @@
+
+
+
+
+
+ 100
+ 100
+ 00:50:00
+ 3600
+ 1
+ 1
+ 2
+ devel
+ 1.01
+ 10000
+ 2
+ single
+ 8
+ _WORK_
+
+
+
+
+
+ 100
+ 100
+ 00:50:00
+ 3600
+ 1
+ 1
+ 2
+ devel
+ 1.01
+ 10000
+ 1
+ single
+ 8
+ _WORK_
+
+
+
Added: SwiftApps/CMTS/dimers/conf/mcs.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/mcs.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/mcs.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,7 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=3
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
Added: SwiftApps/CMTS/dimers/conf/mcs.conf
===================================================================
--- SwiftApps/CMTS/dimers/conf/mcs.conf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/mcs.conf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,45 @@
+# Keep all interesting settings in one place
+# User should modify this to fit environment
+
+# Location of SWIFT. If empty, PATH is referenced
+export SWIFT=
+
+# Where to place/launch worker.pl on the remote machine for sites.xml
+export WORKER_LOCATION=_RUNDIR_
+
+# How to launch workers: local, ssh, or cobalt
+export WORKER_MODE=ssh
+
+# Worker logging setting passed to worker.pl for sites.xml
+export WORKER_LOGGING_LEVEL=INFO
+
+# User name to use for all systems
+export WORKER_USERNAME=$USER
+
+# Worker host names for ssh
+export WORKER_HOSTS="crush thwomp stomp crank steamroller grind churn trounce thrash vanquish"
+
+# Directory to keep log files, relative to working directory when launching start-coaster-service
+export LOG_DIR=logs
+export WORKER_LOG_DIR=_RUNDIR_
+
+# Manually define ports. If not specified, ports will be automatically generated
+export LOCAL_PORT=
+export SERVICE_PORT=
+
+# Set shared filesystem to no since work will be done in local /sandbox directory
+export SHARED_FILESYSTEM=yes
+
+# start-coaster-service tries to automatically detect IP address.
+# Specify here if auto detection is not working correctly
+export IPADDR=
+
+# Below are various settings to give information about how to create sites.xml
+#export WORK=_RUNDIR_
+export JOBS_PER_NODE=1
+# export JOB_THROTTLE=$( echo "scale=5; $( echo $WORKER_HOSTS | wc -w )/100 - 0.00001"|bc )
+
+# Swift applications
+#app sumloss=$PWD/../sumloss.sh
+#app evolve=$PWD/../evolve.sh
+
Added: SwiftApps/CMTS/dimers/conf/pads-ssh.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/pads-ssh.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/pads-ssh.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=10
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/pads-ssh.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/pads-ssh.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/pads-ssh.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,21 @@
+
+
+
+
+ 100
+ 100
+ 00:50:00
+ 3600
+ 1
+ 1
+ 2
+ fast
+ 1.01
+ 10000
+ 2
+ single
+ 8
+ _WORK_
+
+
+
Added: SwiftApps/CMTS/dimers/conf/pads.cf
===================================================================
--- SwiftApps/CMTS/dimers/conf/pads.cf (rev 0)
+++ SwiftApps/CMTS/dimers/conf/pads.cf 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=10
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#app rmsd=$PWD/../rmsd.sh
+#app plot_pd=$PWD/../plot_pd.pl
Added: SwiftApps/CMTS/dimers/conf/pads.xml
===================================================================
--- SwiftApps/CMTS/dimers/conf/pads.xml (rev 0)
+++ SwiftApps/CMTS/dimers/conf/pads.xml 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,20 @@
+
+
+
+
+ 01:00:00
+ 3600
+ 8
+ 1
+ 2
+ 1
+ fast
+ 5.99
+ 10000
+ 1
+ single
+ 8
+ _WORK_
+
+
+
Added: SwiftApps/CMTS/dimers/dimers.swift
===================================================================
--- SwiftApps/CMTS/dimers/dimers.swift (rev 0)
+++ SwiftApps/CMTS/dimers/dimers.swift 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,13 @@
+type file;
+
+app insert_molecules
+
+app restart2data
+
+app lmp_john
+
+int start_ndimers=20;
+int max_ndimers=75;
+int delta_ndimers=5;
+int virion_radius=300;
+
Added: SwiftApps/CMTS/dimers/input_files/end_20.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_20.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_25.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_25.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_30.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_30.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_35.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_35.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_40.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_40.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_45.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_45.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_50.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_50.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_55.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_55.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_60.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_60.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_65.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_65.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/input_files/end_70.restart
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/input_files/end_70.restart
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/rundimers.sh
===================================================================
--- SwiftApps/CMTS/dimers/rundimers.sh (rev 0)
+++ SwiftApps/CMTS/dimers/rundimers.sh 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+# Usage: swiftopt.sh [-s sitename] [-w]
+#
+
+usage="$0 [-s sitename] [-p paramfile]"
+
+# Function to run Swift
+runswift() {
+ swift -tc.file tc.data -sites.file $1 -config cf dimers.swift 2>&1 | tee swift.out
+}
+
+# Default settings
+execsite=local
+paramfile=local
+ram=2048M
+
+# Process command line arguments
+while [ $# -gt 0 ]; do
+ case $1 in
+ -s) execsite=$2; shift 2;;
+ *) echo $usage 1>&2
+ exit 1;;
+ esac
+done
+
+# Create next unique run id and run directory
+rundir=$( echo run??? | sed -e 's/^.*run//' | awk '{ printf("run%03d\n", $1+1)}' )
+
+# Exit if rundir already exits. Something is funky
+if [ -d $rundir ];
+then
+ echo "$rundir already exists! exiting." >&2
+ exit 2
+else
+ mkdir $rundir
+fi
+
+# Copy input files
+cp input_files/* $rundir
+echo Run directory $rundir: site=$execsite paramfile=$paramfile
+
+# Report an error if configuration files are missing
+if [ ! -f "conf/$execsite.xml" ] && [ ! -f "conf/$execsite.conf" ]; then
+ echo Unable to find requested configuration file for site $execsite
+ exit 1
+fi
+
+# Use start-coaster-service if site is a .conf file
+if [ -f "conf/$execsite.conf" ]; then
+ USE_SCS=1
+fi
+
+# Check for missing .cf files
+if [ -f "conf/$execsite.xml" ] && [ ! -f "conf/$execsite.cf" ]; then
+ echo Missing configuration file $execsite.cf
+fi
+
+# Do the run
+cd $rundir
+cp ../rmsd.swift .
+export WORK=$PWD/swiftwork
+mkdir -p $PWD/swiftwork/workers
+
+# Use start-coaster-service if the site uses a .conf file
+if [ "$USE_SCS" == "1" ]; then
+ cp ../conf/$execsite.conf coaster-service.conf
+ cp ../conf/$execsite.cf cf
+ sed -i -e "s at _RUNDIR_@$rundir@" coaster-service.conf
+ start-coaster-service
+fi
+
+# Run gensites
+if [ ! "$USE_SCS" == 1 ]; then
+ cp ../conf/$execsite.cf cf
+ gensites -p ../conf/$execsite.cf ../conf/$execsite.xml > $execsite.xml
+fi
+
+echo "Run dir=$rundir" >> ABOUT
+echo "Work dir=$WORK" >> ABOUT
+echo "Total jobs=$total_jobs" >> ABOUT
+
+if [ "$USE_SCS" == "1" ]; then
+ runswift "sites.xml"
+ stop-coaster-service
+else
+ runswift "$execsite.xml"
+fi
+
+exit
Property changes on: SwiftApps/CMTS/dimers/rundimers.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/GeometryUtil.cpp
===================================================================
--- SwiftApps/CMTS/dimers/src/GeometryUtil.cpp (rev 0)
+++ SwiftApps/CMTS/dimers/src/GeometryUtil.cpp 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,721 @@
+#include "GeometryUtil.h"
+
+/*
+ Here theta is the "horizontal" resolution, and phi is the "vertical resolution"
+ We add single point "caps" on the north and south poles of the sphere - these are included
+ in the phi resolution, so the number of vertical circles which for the sphere is phi_res-2.
+*/
+FLOAT_TYPE * GenerateSphere( int theta_res, int phi_res, FLOAT_TYPE sphere_radius, int *npoints )
+{
+ double theta, phi, delta_phi;
+ double circle_radius, pi, twopi, x, y, z;
+ FLOAT_TYPE *points; // FLOAT_TYPE, as we pass it back.
+ int i, j, k;
+
+ assert( phi_res > 2 ); // ensure we have at least one genuine circle on the vertical axis!
+
+ pi = M_PI;
+ twopi = 2.0*M_PI;
+
+ phi_res -= 2;
+
+ *npoints = 2 + (phi_res*theta_res);
+ points = (FLOAT_TYPE *) malloc( sizeof(FLOAT_TYPE)*(*npoints)*3 );
+
+ k = 0;
+
+ // add north pole - single point
+ points[k*3 +0] = 0.0;
+ points[k*3 +1] = 0.0;
+ points[k*3 +2] = sphere_radius;
+ k++;
+
+ // add list of circles on vertical axis
+ delta_phi = pi/(phi_res+1);
+ for( i=0; i 0 );
+ assert( xyz != NULL );
+ assert( COM != NULL );
+
+ COM[0] = 0.0;
+ COM[1] = 0.0;
+ COM[2] = 0.0;
+ total_mass = 0.0;
+
+ if( mass == NULL )
+ {
+ // assume mass of 1.0
+ m = 1.0;
+ for( i=0; ipi, ie the minimum angle. For the case of theta, this gives us a circle around the zenith axis
+ but to properly define the phi we need the full range of 0->2pi so we don't have uncertainty as to which "side" of the circle
+ phi actually lies on.
+
+ This is an issue, as which "side" of the circle phi is on dependes on whether we're looking from above or below the origin of
+ the coordinate system, as that reflects phi! Therefore, we make an assumption here; specifically, that the zenith axis defines
+ a normal to the plane formed by the remaining two cartesian axes, and we use this as "up". If we then project the 3D vector
+ onto a 2D plane defined by the two potential azimuthal axes (by killing the zenith axis component), we can actually get the
+ full range of 0->2pi given that "up" is the zenith axis, and IT IS SIGNED!
+
+ Here we use zenith axis = z and azimuthal axis = x for convenience and easy interpretation.
+
+ "Conventional" method (phi only on [0,pi]):
+
+ x,y,z = v2-v1
+ r = sqrt( dot(v1,v2) )
+ theta = acos( z / r )
+ phi = atan( y, x )
+*/
+void CartesianToSpherical( FLOAT_TYPE *p1, FLOAT_TYPE *p2, FLOAT_TYPE *r, FLOAT_TYPE *theta, FLOAT_TYPE *phi )
+{
+ double vec[3], axis[3], r2, x, y;
+ double min_r = 1e-20;
+
+ assert( p1 != NULL );
+ assert( p2 != NULL );
+ assert( r != NULL );
+ assert( theta != NULL );
+ assert( phi != NULL );
+
+ vec[0] = p2[0] - p1[0];
+ vec[1] = p2[1] - p1[1];
+ vec[2] = p2[2] - p1[2];
+
+ *r = sqrt( DOT_PRODUCT(vec,vec) );
+ // is the 3D point too close to the origin?
+ if( *r < min_r )
+ {
+ *theta = 0.0;
+ *phi = 0.0;
+ }
+ else
+ {
+ vec[0] /= *r;
+ vec[1] /= *r;
+ vec[2] /= *r;
+
+ // theta is the angle between the vector and the zenith axis - this is easy.
+ axis[0] = axis[1] = axis[2] = 0.0;
+ axis[2] = 1.0; // zenith axis is z
+ *theta = acos( DOT_PRODUCT(axis,vec) );
+
+ // now we get clever; we project the vector onto the 2D plane by killing the zenith component. Obviously,
+ // this vector may no longer be a unit vector, so we renormalise. We can then use the atan2 function to get
+ // the angle in the range -pi->pi (atan2 is also more accurate than other methods)
+ axis[0] = axis[1] = axis[2] = 0.0;
+ axis[0] = 1.0; // azimuthal axis is x
+
+ vec[2] = 0.0; // kill the zenith component of the vector to project onto azimuthal plane
+ r2 = sqrt( DOT_PRODUCT(vec,vec) ); // renomalise value
+ // is the projected point too close to the 2D origin?
+ if( r2 < min_r ) *phi = 0.0;
+ else
+ {
+ // use the atan2 function, with x and y components!
+ vec[0] /= r2;
+ vec[1] /= r2;
+ vec[2] /= r2;
+ //
+ x = vec[0];
+ y = vec[1];
+ *phi = atan2( x, y );
+ //*phi = acos( axis[0]*vec[0] + axis[1]*vec[1] + axis[2]*vec[2] ); // old version; only 0 -> pi, so merges data symmetrically.
+ }
+ }
+}
+void SphericalToCartesian( FLOAT_TYPE r, FLOAT_TYPE theta, FLOAT_TYPE phi, FLOAT_TYPE *x, FLOAT_TYPE *y, FLOAT_TYPE *z )
+{
+ assert( x != NULL );
+ assert( y != NULL );
+ assert( z != NULL );
+
+ // deffo right! unaffected by phi calculations.
+ *z = r * cos(theta);
+
+ // but it fucking beats me why the x and y components have switched here vs "standard" spherical. :/
+ *x = r * sin(theta)*sin( phi );
+ *y = r * sin(theta)*cos( phi );
+
+ // the above actually avoids singularities that catch out the standard spherical coords method,
+ // so we don't need to check for any weirdness as we have phi defined with no weirdness.
+
+ // alternatively ...
+ //FLOAT_TYPE u;
+ //u = sqrt( r*r - (*z)*(*z) );
+ //*x = u * sin( phi );
+ //*y = u * cos( phi );
+}
+
+/*
+// conventional Cartesian => spherical coords conversion
+void _CartesianToSpherical( FLOAT_TYPE *p1, FLOAT_TYPE *p2, FLOAT_TYPE *r, FLOAT_TYPE *theta, FLOAT_TYPE *phi )
+{
+ double x, y, z;
+
+ x = p2[0] - p1[0];
+ y = p2[1] - p1[1];
+ z = p2[2] - p1[2];
+
+ *r = sqrt( x*x + y*y + z*z );
+ *theta = acos( z / *r );
+ *phi = atan( y/x );
+}
+// conventional spherical coords => Cartesian conversion
+void _SphericalToCartesian( FLOAT_TYPE r, FLOAT_TYPE theta, FLOAT_TYPE phi, FLOAT_TYPE *x, FLOAT_TYPE *y, FLOAT_TYPE *z )
+{
+ *x = r * sin(theta)*cos(phi);
+ *y = r * sin(theta)*sin(phi);
+ *z = r * cos(theta);
+}
+// check we recover correct coordinates vs original, and against standard spherical methods marked with underscore.
+// note the problems in the original method that we avoid around the origin!
+void test_spherical( int dim )
+{
+ int x, y, z;
+ FLOAT_TYPE s_r, s_t, s_p; // need to be FLOAT_TYPE, as we're passing into and out of the FLOAT_TYPE routines.
+ FLOAT_TYPE v1[3], v2[3]; // as above.
+
+ v1[0] = v1[1] = v1[2] = 0.0;
+
+ for( x=-dim; x<=dim; x++ )
+ for( y=-dim; y<=dim; y++ )
+ for( z=-dim; z<=dim; z++ )
+ {
+ v2[0] = x;
+ v2[1] = y;
+ v2[2] = z;
+ printf( "%+.12f %+.12f %+.12f\n", v2[0], v2[1], v2[2] );
+
+ _CartesianToSpherical( v1, v2, &s_r, &s_t, &s_p );
+ printf( "\t %+.6f %+.6f %+.6f => ", s_r, s_t, s_p );
+ _SphericalToCartesian( s_r, s_t, s_p, &v2[0], &v2[1], &v2[2] );
+ printf( "%+.12f %+.12f %+.12f\n", v2[0], v2[1], v2[2] );
+
+ v2[0] = x;
+ v2[1] = y;
+ v2[2] = z;
+ CartesianToSpherical( v1, v2, &s_r, &s_t, &s_p );
+ printf( "\t %+.6f %+.6f %+.6f => ", s_r, s_t, s_p );
+ SphericalToCartesian( s_r, s_t, s_p, &v2[0], &v2[1], &v2[2] );
+ printf( "%+.12f %+.12f %+.12f\n", v2[0], v2[1], v2[2] );
+ }
+}
+*/
+
+void Translate( int N, FLOAT_TYPE *xyz, FLOAT_TYPE *offset )
+{
+ int i;
+
+ assert( N > 0 );
+ assert( xyz != NULL );
+ assert( offset != NULL );
+
+ for( i=0; i 0 );
+ assert( xyz != NULL );
+ assert( axis != NULL );
+
+ a = 0.0;
+ b = 0.0;
+ c = 0.0;
+
+ if( point != NULL )
+ {
+ a = point[0];
+ b = point[1];
+ c = point[2];
+ }
+
+ ct = cos( theta );
+ st = sin( theta );
+
+ u = axis[0];
+ v = axis[1];
+ w = axis[2];
+ u2 = u*u;
+ v2 = v*v;
+ w2 = w*w;
+ K = u2 + v2 + w2;
+ L = sqrt( K );
+
+ for( i=0; i x, y, z;
+
+ // build a list of "good" vertices in the shell
+ for( i=0; i 1!
+void UniformSpherePoint( FLOAT_TYPE random_number1, FLOAT_TYPE random_number2, FLOAT_TYPE *vec )
+{
+ /*
+ // original version; this had issues
+
+ double u, theta;
+
+ assert( vec != NULL );
+
+ u = (random_number1-0.5) * 2.0; // u \elem [-1,1]
+ u = sqrt( 1 - u*u );
+ theta = random_number2 * 2.0*M_PI; // theta \elem [0,2pi)
+ vec[0] = u * cos( theta );
+ vec[1] = u * sin( theta );
+ vec[2] = u;
+ */
+
+ // new; tested ok! previous version was wrong.
+ double z, phi, theta, ctheta;
+
+ assert( vec != NULL );
+
+ z = (random_number1 - 0.5) * 2.0;
+ phi = random_number2 * 2.0*M_PI;
+ theta = asin( z );
+ ctheta = cos( theta );
+
+ vec[0] = ctheta * cos(phi);
+ vec[1] = ctheta * sin(phi);
+ vec[2] = z;
+
+}
Property changes on: SwiftApps/CMTS/dimers/src/GeometryUtil.cpp
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/GeometryUtil.h
===================================================================
--- SwiftApps/CMTS/dimers/src/GeometryUtil.h (rev 0)
+++ SwiftApps/CMTS/dimers/src/GeometryUtil.h 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,65 @@
+#ifndef GEOMETRYUTIL_INCLUDED
+
+#include "definitions.h"
+
+#include
+#include
+
+/*
+ Where we recieve or pass back data, data type is FLOAT_TYPE. However, function-local variables are double precision.
+*/
+
+#define DOT_PRODUCT( v1, v2 ) ( v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] )
+
+FLOAT_TYPE * GenerateSphere( int theta_res, int phi_res, FLOAT_TYPE sphere_radius, int *npoints );
+
+void CartesianToSpherical( FLOAT_TYPE *p1, FLOAT_TYPE *p2, FLOAT_TYPE *r, FLOAT_TYPE *theta, FLOAT_TYPE *phi );
+void SphericalToCartesian( FLOAT_TYPE r, FLOAT_TYPE theta, FLOAT_TYPE phi, FLOAT_TYPE *x, FLOAT_TYPE *y, FLOAT_TYPE *z );
+
+void CentreOfMass( int N, FLOAT_TYPE *coords, FLOAT_TYPE *mass, FLOAT_TYPE *COM );
+
+// rotate on point rotates ... about the specified point! Can pass COM for molecular rotations etc.
+// point = NULL rotates about point (0.0, 0.0, 0.0)
+void RotateAboutPoint( int N, FLOAT_TYPE *xyz, FLOAT_TYPE *point, FLOAT_TYPE *axis, FLOAT_TYPE theta );
+
+// pass 2 random numbers on the range 0 -> 1!
+void UniformSpherePoint( FLOAT_TYPE random_number1, FLOAT_TYPE random_number2, FLOAT_TYPE *vec );
+
+
+FLOAT_TYPE l2_norm_difference( int len, FLOAT_TYPE *v1, FLOAT_TYPE *v2 );
+
+#define INIT_TETRAHEDRON 0
+#define INIT_OCTAHEDRON 1
+#define INIT_ICOSAHEDRON 2
+
+#include
+
+class Subdivider
+{
+ public:
+
+ int n_vertices, n_faces, n_edges;
+ float *vertices;
+ int *faces;
+
+ int edge_walk;
+ int *start, *end, *midpoint;
+
+ // initial generation stuff
+ void InitTetrahedron();
+ void InitOctahedron();
+ void InitIcosahedron();
+ // refinement of structures
+ int SearchMidpoint( int index_start, int index_end );
+ void Subdivide();
+
+ // enclosing mesh production for a set of atoms, where r is the mesh distance from the atoms
+ FLOAT_TYPE * BuildShell( int n_atoms, FLOAT_TYPE *atom_pos, FLOAT_TYPE r, int *n_shell_points );
+
+ Subdivider( int init_as, int n_subdivisions );
+ ~Subdivider();
+};
+
+
+#define GEOMETRYUTIL_INCLUDED
+#endif
Property changes on: SwiftApps/CMTS/dimers/src/GeometryUtil.h
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/Makefile
===================================================================
--- SwiftApps/CMTS/dimers/src/Makefile (rev 0)
+++ SwiftApps/CMTS/dimers/src/Makefile 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,14 @@
+CC=g++
+
+all: insert_molecules restart2data
+
+insert_molecules:
+ $(CC) -Wall -Wextra -pedantic -O3 insert_molecules.cpp StringUtil.cpp GeometryUtil.cpp Ran1.cpp -o insert_molecules
+ cp insert_molecules ../bin
+
+restart2data:
+ $(CC) -O3 restart2data.cpp -o restart2data
+ cp restart2data ../bin
+
+clean:
+ rm -f restart2data insert_molecules
Added: SwiftApps/CMTS/dimers/src/Ran1.cpp
===================================================================
--- SwiftApps/CMTS/dimers/src/Ran1.cpp (rev 0)
+++ SwiftApps/CMTS/dimers/src/Ran1.cpp 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,58 @@
+#include "Ran1.h"
+
+/*
+ The ran1() function from Numerical Recipes in C: The Art of Scientific Computing ( ISBN: 0-521-43108-5 ).
+ Call with idum as negative number to start, then do not alter idum between calls!
+*/
+#define IA 16807
+#define IM 2147483647
+#define AM (1.0/IM)
+#define IQ 127773
+#define IR 2836
+#define NTAB 32
+#define NDIV (1+(IM-1)/NTAB)
+#define EPS 1.2e-7
+#define RNMX (1.0-EPS)
+float ran1( long * idum )
+{
+ int j;
+ long k;
+ static long iy = 0;
+ static long iv[NTAB];
+ float temp;
+
+ if( *idum <= 0 || !iy )
+ {
+ /* initialize */
+ if (-(*idum) < 1) *idum=1; /* prevent idum == 0 */
+ else *idum =-(*idum);
+
+ for( j = NTAB+7; j >= 0; j--)
+ {
+ /* Load the shuffle table ( after 8 warm-ups ) */
+ k = (*idum) / IQ;
+ *idum = IA*(*idum-k*IQ)-IR*k;
+ if( *idum < 0 ) *idum += IM;
+ if( j < NTAB ) iv[j] = *idum;
+ }
+ iy = iv[0];
+ }
+
+ k = (*idum) / IQ; /* Start here when not initializing */
+ *idum=IA*(*idum-k*IQ)-IR*k; /* Compute idum = (IA*idum) % IM without overflows by Schrage's method */
+ if( *idum < 0 ) *idum += IM;
+ j = iy / NDIV; /* Will be in the range 0..NTAB-1. */
+ iy = iv[j]; /* Output previously stored value and refill the shuffle table */
+ iv[j] = *idum;
+ if( (temp = AM*iy) > RNMX ) return RNMX; /* Because users don?t expect end point values. */
+ else return temp;
+}
+#undef IA
+#undef IM
+#undef AM
+#undef IQ
+#undef IR
+#undef NTAB
+#undef NDIV
+#undef EPS
+#undef RNMX
Property changes on: SwiftApps/CMTS/dimers/src/Ran1.cpp
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/Ran1.h
===================================================================
--- SwiftApps/CMTS/dimers/src/Ran1.h (rev 0)
+++ SwiftApps/CMTS/dimers/src/Ran1.h 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,6 @@
+#ifndef RAN1_DEFINED
+
+float ran1( long * idum );
+
+#define RAN1_DEFINED
+#endif
Property changes on: SwiftApps/CMTS/dimers/src/Ran1.h
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/StringUtil.cpp
===================================================================
--- SwiftApps/CMTS/dimers/src/StringUtil.cpp (rev 0)
+++ SwiftApps/CMTS/dimers/src/StringUtil.cpp 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,191 @@
+#include "StringUtil.h"
+
+#define STRINGERROR( msg ) { printf( "ERROR: %s(): %s line %d: \"%s\"\n", __func__, __FILE__, __LINE__, msg ); exit(-1); }
+
+/*
+ Convert null terminated character array into an integer. Checks for bad input string, and produces error where failed.
+*/
+int StringToInt( const char * str, int base, const char * file, int lineno )
+{
+ char *endptr;
+ char message[1024];
+ int returned;
+
+ #ifdef DEBUG
+ if( str == NULL ) STRINGERROR( "NULL string passed as input" );
+ if( file == NULL ) STRINGERROR( "NULL file name passed as input" );
+ #endif
+
+ returned = strtol( str, &endptr, 10 );
+ if( *endptr != '\0' )
+ {
+ sprintf( message, "Unable to convert '%s' (%s, line %d) into an integer of base %d", str, file, lineno, base );
+ STRINGERROR( message );
+ }
+ return returned;
+}
+/*
+ Convert null terminated character array into a double precision floating point. Checks for bad input string, and produces error where failed.
+*/
+double StringToDouble( const char * str, const char * file, int lineno )
+{
+ char *endptr;
+ char message[1024];
+ double returned;
+
+ #ifdef DEBUG
+ if( str == NULL ) STRINGERROR( "NULL string passed" );
+ if( file == NULL ) STRINGERROR( "NULL file name passed" );
+ #endif
+
+ returned = strtod( str, &endptr );
+ if( *endptr != '\0' )
+ {
+ sprintf( message, "Unable to convert '%s' (%s, line %d) into a double", str, file, lineno );
+ STRINGERROR( message );
+ }
+ return returned;
+}
+/*
+ Check if character 'test' is a member of "delimiters"
+*/
+int IsDelim( char test, const char * delimiters, int ndelim )
+{
+ int i;
+
+ #ifdef DEBUG
+ if( delimiters == NULL ) STRINGERROR( "NULL delimiter string passed" );
+ #endif
+
+ for( i=0; i=0 && end == -1; i-- )
+ {
+ if( IsDelim( str[i], whitespace_ptr, whitespace_length ) == 0 ) end = i;
+ }
+
+ /* note that we could have an empty string, so check for that. */
+ j = 0;
+ if( start == -1 || end == -1 || end < start )
+ {
+ }
+ else
+ {
+ for( i=start; i<=end; i++ )
+ {
+ str[j] = str[i];
+ j++;
+ }
+ }
+ str[j] = '\0';
+
+ return strlen( str );
+}
+/*
+ Chops up "str", and stores the substrings in the array "pointers". If too many substrings are present to store in
+ the "pointers" array, this routine will just do as many as possible.
+*/
+int TokenizeString( char * str, const char * delimiters, char ** pointers, int maxptrs )
+{
+ int ntoks, len, ndelim, i, j;
+
+ #ifdef DEBUG
+ if( str == NULL ) STRINGERROR( "NULL string passed" );
+ if( delimiters == NULL ) STRINGERROR( "NULL delimiters string passed" );
+ if( pointers == NULL ) STRINGERROR( "NULL pointers array passed" );
+ if( maxptrs < 1 ) STRINGERROR( "maxptrs < 1" );
+ #endif
+
+ len = strlen( str );
+ ndelim = strlen( delimiters );
+ ntoks = 0;
+
+ j = 0; /* index into current token. */
+ for( i=0; i 0 ) ntoks++;
+ j = 0;
+ if( ntoks >= maxptrs ) break;
+ }
+ else
+ {
+ pointers[ntoks][j] = str[i];
+ pointers[ntoks][j+1] = '\0';
+ j++;
+ }
+ }
+ /* We may have a trailing token at the end of the string */
+ if( j > 0 ) ntoks++;
+ return ntoks;
+}
+
+int TokenizeString( const char * source, const char * delimiters, std::vector< std::string > &results )
+{
+ int ntoks;
+ char buffer[1024], tokens[100][1024], *token_ptrs[100];
+ std::string str;
+
+ for( int i=0; i<100; i++ ) token_ptrs[i] = tokens[i];
+
+ strcpy( buffer, source );
+
+ results.clear();
+
+ ntoks = TokenizeString( buffer, delimiters, token_ptrs, 100 );
+ for( int i=0; i &results )
+{
+ #ifdef DEBUG
+ if( f == NULL ) STRINGERROR( "NULL FILE* passed" );
+ if( delimiters == NULL ) STRINGERROR( "NULL delimiters string passed" );
+ if( line_buffer == NULL ) STRINGERROR( "NULL line_buffer pointer passed" );
+ #endif
+
+ line_buffer[0] = '\0';
+ if( fgets( line_buffer, 1024, f) == NULL ) return -1;
+ return TokenizeString( line_buffer, delimiters, results );
+}
+
+
+#undef STRINGERROR
+
Property changes on: SwiftApps/CMTS/dimers/src/StringUtil.cpp
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/StringUtil.h
===================================================================
--- SwiftApps/CMTS/dimers/src/StringUtil.h (rev 0)
+++ SwiftApps/CMTS/dimers/src/StringUtil.h 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,19 @@
+#ifndef STRING_UTIL_DEFINED
+
+#include
+#include
+
+#include
+#include
+#include
+
+int StringToInt( const char * str, int base, const char * file, int lineno );
+double StringToDouble( const char * str, const char * file, int lineno );
+int IsDelim( char test, const char * delimiters, int ndelim );
+int StripString( char * str, const char *whitespace );
+int TokenizeString( char * str, const char * delimiters, char ** pointers, int maxptrs );
+int TokenizeString( const char * source, const char * delimiters, std::vector< std::string > &results );
+int TokenizeLine( FILE * f, const char *delimiters, char *line_buffer, std::vector &results );
+
+#define STRING_UTIL_DEFINED
+#endif
Property changes on: SwiftApps/CMTS/dimers/src/StringUtil.h
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/definitions.h
===================================================================
--- SwiftApps/CMTS/dimers/src/definitions.h (rev 0)
+++ SwiftApps/CMTS/dimers/src/definitions.h 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1 @@
+#define FLOAT_TYPE float
Property changes on: SwiftApps/CMTS/dimers/src/definitions.h
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/CMTS/dimers/src/insert_molecules
===================================================================
(Binary files differ)
Property changes on: SwiftApps/CMTS/dimers/src/insert_molecules
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/CMTS/dimers/src/insert_molecules.cpp
===================================================================
--- SwiftApps/CMTS/dimers/src/insert_molecules.cpp (rev 0)
+++ SwiftApps/CMTS/dimers/src/insert_molecules.cpp 2012-08-08 15:12:55 UTC (rev 5893)
@@ -0,0 +1,700 @@
+#include
+#include
+
+#include