You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by he...@apache.org on 2012/03/23 21:23:41 UTC

svn commit: r1304581 - in /incubator/airavata/trunk/samples/application-emulators/MockPwscf: ./ Pwscf_Input Pwscf_Output README pseudo_1 pseudo_2 pwscf.c

Author: heshan
Date: Fri Mar 23 20:23:41 2012
New Revision: 1304581

URL: http://svn.apache.org/viewvc?rev=1304581&view=rev
Log:
Patch for AIRAVATA-331.

Added:
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Input
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Output
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/README
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_1
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_2
    incubator/airavata/trunk/samples/application-emulators/MockPwscf/pwscf.c

Added: incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Input
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Input?rev=1304581&view=auto
==============================================================================
--- incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Input (added)
+++ incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Input Fri Mar 23 20:23:41 2012
@@ -0,0 +1,25 @@
+&CONTROL
+                 calculation = "relax" ,
+                restart_mode = "from_scratch" ,
+                      outdir = "./tmp/" , 
+                  pseudo_dir = "./" ,
+                     disk_io = "default" ,
+                   verbosity = "default" ,
+                     tstress = .true. ,
+                     tprnfor = .true. ,
+   nstep = 1 ,
+               etot_conv_thr = 1.0E-5  ,
+               forc_conv_thr = 1.0D-3 ,
+                      iprint = 1 ,
+                 max_seconds = 36000 , 
+                          dt = 50 ,
+ /
+ &SYSTEM
+                       ibrav = 0 ,
+   A = 3.01728916 ,
+   B = 3.01728916 ,
+   C = 3.01728916 ,
+   cosAB = 0.50000000 ,
+   cosAC = 0.50000000 ,
+   cosBC = 0.50000000 ,
+

Added: incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Output
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Output?rev=1304581&view=auto
==============================================================================
--- incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Output (added)
+++ incubator/airavata/trunk/samples/application-emulators/MockPwscf/Pwscf_Output Fri Mar 23 20:23:41 2012
@@ -0,0 +1,11 @@
+ For Norm-Conserving or Ultrasoft (Vanderbilt) Pseudopotentials or PAW
+Current dimensions of program pwscf are:
+Max number of different atomic species (ntypx) = 10
+Max number of k-points (npk) =  40000
+Max angular momentum in pseudopotentials (lmaxx) =  3
+
+ pwscf_ctrl_msg 0002 : dynamics converged !
+
+Writing output data file pwscf.save
+
+PWSCF        :     4.65s CPU time,    9.53s wall time

Added: incubator/airavata/trunk/samples/application-emulators/MockPwscf/README
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/samples/application-emulators/MockPwscf/README?rev=1304581&view=auto
==============================================================================
--- incubator/airavata/trunk/samples/application-emulators/MockPwscf/README (added)
+++ incubator/airavata/trunk/samples/application-emulators/MockPwscf/README Fri Mar 23 20:23:41 2012
@@ -0,0 +1,49 @@
+OVERVIEW
+--------
+This is a sample application which emulates three inputs.
+The First Input is Pwscf_Input, it has all data setup manually by the user over the Web Portal.
+The second and third inputs are pseudo_1 and pseudo_2. Those file usually are created by a third part software
+containing atomic positions.
+The real PWscf uses those pseudo files to simulate atomic postions of the atoms involved on the calculations.
+
+
+DESCRIPTION
+----------
+
+This Application only reads three input Pwscf_Input, pseudo_1, and pseudo_2. Then It prints 2 Outputs, one called Pwscf_Output, and the other
+called output_2_binary. This seconds output output_2_binary is just one example. In the real PWscf several binary files will be placed over
+the tmp directory.
+
+
+MOCK APPLICATION
+----------------
+This application is similar to a thermo dynamics application PWscf. MOCK APPLICATION
+
+
+APPLICATION INPUT/OUPUTS
+------------------------
+
+The first input parameter file has multiple name value pairs inputs which application can understand.
+
+The second input is a data file 
+
+
+INSTALL
+------
+Building instructions
+
+Compilations process tested on Ranger: mpicc pwscf.c -o pwscf.w
+
+EXECUTION
+---------
+
+To run the application ..
+
+mpirun -np 4 pwscf.w
+
+
+VERIFICATION
+-----------
+The execution will be successfull if ....
+
+In case the execution goes correctly. It should read those three inputs, and create one output Pwscf_Output and another output called output_2_binary in the tmp directory.

Added: incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_1
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_1?rev=1304581&view=auto
==============================================================================
--- incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_1 (added)
+++ incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_1 Fri Mar 23 20:23:41 2012
@@ -0,0 +1,6 @@
+ATOMIC_SPECIES
+   Mg   20.0   Mg.vbc3
+ATOMIC_POSITIONS crystal
+Mg      -0.25   -0.25   -0.25
+K_POINTS automatic
+  6 6 6   1 1 1

Added: incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_2
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_2?rev=1304581&view=auto
==============================================================================
--- incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_2 (added)
+++ incubator/airavata/trunk/samples/application-emulators/MockPwscf/pseudo_2 Fri Mar 23 20:23:41 2012
@@ -0,0 +1,6 @@
+ATOMIC_SPECIES
+   O   20.0   008-O-ca--bm3.vdb
+ATOMIC_POSITIONS crystal
+O      0.25   0.25   0.25
+K_POINTS automatic
+  6 6 6   1 1 1

Added: incubator/airavata/trunk/samples/application-emulators/MockPwscf/pwscf.c
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/samples/application-emulators/MockPwscf/pwscf.c?rev=1304581&view=auto
==============================================================================
--- incubator/airavata/trunk/samples/application-emulators/MockPwscf/pwscf.c (added)
+++ incubator/airavata/trunk/samples/application-emulators/MockPwscf/pwscf.c Fri Mar 23 20:23:41 2012
@@ -0,0 +1,119 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "mpi.h"
+
+/* header files for getting hostname and process id */
+#include <unistd.h>
+#include <sys/types.h>
+
+main(int argc, char* argv[]) {
+int my_rank; /* rank of process */
+int num; /* number of processes */
+
+/* Variables to store the hostname and process id */
+char hostname[128];
+size_t len = 126;
+pid_t pid;
+
+//Read inputs
+FILE *fp_Pwscf_Input;
+FILE *fp_pseudo_1;
+FILE *fp_pseudo_2; 
+
+int i;
+
+
+//Output data
+FILE *fp_output;
+FILE *fp_output_2;
+
+char string_input[2048];
+char string_pseudo_1[2048];
+char string_pseudo_2[2048];
+
+char string_output[2048];
+char string_output_2[2048];
+
+ if((fp_output=fopen("Pwscf_Output", "w")) == NULL) {
+    printf("Cannot Pwscf_Output open file.\n");
+  }
+
+ if((fp_output_2=fopen("tmp/output_2_binary", "w")) == NULL) {
+    printf("Cannot Output binary open file.\n");
+  }
+
+
+//Writing output
+   strcpy(string_output," For Norm-Conserving or Ultrasoft (Vanderbilt) Pseudopotentials or PAW");
+   strcat(string_output, "\nCurrent dimensions of program pwscf are:");
+   strcat(string_output,"\nMax number of different atomic species (ntypx) = 10");
+   strcat(string_output,"\nMax number of k-points (npk) =  40000");
+   strcat(string_output,"\nMax angular momentum in pseudopotentials (lmaxx) =  3\n");
+   strcat(string_output,"\n pwscf_ctrl_msg 0002 : dynamics converged !\n");
+   strcat(string_output, "\nWriting output data file pwscf.save\n");
+   strcat(string_output, "\nPWSCF        :     4.65s CPU time,    9.53s wall time\n");
+
+//Writing data output 2
+   strcpy(string_output_2," This part consist of binary data.");
+
+
+/* Start up MPI */
+MPI_Init(&argc, &argv);
+
+/* Find out process rank */
+MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+
+/* Find out number of processes */
+MPI_Comm_size(MPI_COMM_WORLD, &num);
+
+/* Get the hostname for this process */
+gethostname(hostname, len);
+pid = getpid();
+
+/* Print out the hostname and process id for this process */
+printf("Hello from process %d(%s:%d) out of %d!\n" , my_rank , hostname, pid, num);
+fflush(stdout);
+
+/* Sleep until I login to the host, run the debugger and attach to the relevant process */
+sleep(5);
+
+for (i=0;i<num;i++) {
+  if (my_rank == i) {
+    gethostname(hostname, len);
+    printf("Dummy computation by process %d out of %d!\n",my_rank,num);
+
+     if((fp_Pwscf_Input=fopen("Pwscf_Input", "r")) == NULL) {
+        printf("Cannot open Pwscf_Input file.\n");
+      }
+      fscanf(fp_Pwscf_Input, "%s", string_input) ; 	
+      fprintf(stdout, "%s", string_input); /* print on screen */	
+
+     if((fp_pseudo_1=fopen("pseudo_1", "r")) == NULL) {
+        printf("Cannot open Pseudo_File1 file.\n");
+      }
+     fscanf(fp_pseudo_1, "%s", string_pseudo_1) ; 
+      fprintf(stdout, "%s", string_pseudo_1); /* print on screen */
+ 
+      if((fp_pseudo_2=fopen("pseudo_2", "r")) == NULL) {
+        printf("Cannot open Pseudo_File2 file.\n");
+      }	
+     fscanf(fp_pseudo_2, "%s", string_pseudo_2) ;
+      fprintf(stdout, "%s", string_pseudo_2); /* print on screen */	
+
+    fflush(stdout);
+
+   fprintf(fp_output, "%s", string_output); /* write to file */
+   fprintf(fp_output_2, "%s", string_output_2); /* write to file - 2 */
+
+    fclose(fp_output); 
+    //fclose(fp_Pwscf_Input);
+    //fclose(fp_pseudo_1);
+    //fclose(fp_pseudo_2);
+    fclose(fp_output_2);
+  }
+}
+
+/* Shut down MPI */
+MPI_Finalize();
+} /* main */