Commit ab3c87cc authored by salbiach's avatar salbiach
Browse files

deleted simple examples

parent 548b547d
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
TAG = latest-compss-2.8-eddlgpu-1.1-python-3.6-v3
TAG = latest-gpu
PREFIX = registry.gitlab.bsc.es/ppc-bsc/software/deep-health-compss
IMAGE = compss-eddl
......
......@@ -157,7 +157,7 @@ if __name__ == "__main__":
parser.add_argument("--num_workers", type=int, metavar="INT", default=4) # Number of computing units to divide the execution
parser.add_argument("--num_epochs", type=int, metavar="INT", default=10) # Number of epochs to run the training
parser.add_argument("--workers_batch_size", type=int, metavar="INT", default=250) # Size of each batch of the training phase
parser.add_argument("--gpu", type=bool, metavar="BOOL", default=True) # True: Use GPU as CS --- False: Use CPU as CS
parser.add_argument("--gpu", type=bool, metavar="BOOL", default=False) # True: Use GPU as CS --- False: Use CPU as CS
parser.add_argument("--sync_type", type=int, metavar="INT", default=0) # 0: synchronous --- 1: asynchronous --- 2: fully asynchronous
main(parser.parse_args(sys.argv[1:]))
#!/bin/bash
# If you want to execute test python example
#runcompss --resources=/var/local/compss_conf/resources.xml --project=/var/local/compss_conf/project.xml --master_name=10.1.54-38 /tutorial_apps-stable/python/simple/src/simple.py 5
# If you want to execute pyddl in k8s
#source get_pods_ip.sh
#masterIP=(${Nodes[2]})
echo "MasterIP is:" $MY_POD_IP
conda run --no-capture-output -n pyeddl_pycompss_env runcompss --lang=python --python_interpreter=python3 --project=/root/project.xml --resources=/root/resources.xml --master_name=$MY_POD_IP simple1.py
"""\
SIMPLE EXAMPLE
"""
from pycompss.api.api import compss_wait_on
from pycompss.api.task import task
from pycompss.api.parameter import *
def f1(val):
return val + 1
def f2(val):
return val + 2
def f3(val):
return val + 3
def f4(val1, val2, val3):
return val1 + val2 + val3
if __name__ == "__main__":
val1 = f1(1)
val2 = f2(2)
val3 = f3(3)
sum = f4(val1, val2, val3)
print(sum)
\ No newline at end of file
"""\
SIMPLE EXAMPLE
"""
from pycompss.api.api import compss_wait_on
from pycompss.api.task import task
from pycompss.api.parameter import *
def f1(val):
return val + 1
def f2(val):
return val + 2
def f3(val):
return val + 3
def f4(val1, val2, val3):
return val1 + val2 + val3
if __name__ == "__main__":
val1 = f1(1)
val2 = f2(2)
val3 = f3(3)
sum = f4(val1, val2, val3)
print(sum)
\ No newline at end of file
"""\
SIMPLE EXAMPLE
"""
from pycompss.api.api import compss_wait_on
from pycompss.api.task import task
from pycompss.api.parameter import *
def increment(val):
return val + 1
if __name__ == "__main__":
arr = [1,2,3,4,5]
for i in range(len(arr)):
arr[i] = increment(arr[i])
print(arr)
"""\
SIMPLE EXAMPLE
"""
import sys
import numpy as np
from pycompss.api.task import task
from pycompss.api.parameter import *
from pycompss.api.api import compss_wait_on
def initialize_variables():
for matrix in [A, B, C]:
for i in range(MSIZE):
matrix.append([])
for j in range(MSIZE):
if matrix == C:
block = np.array(np.zeros((BSIZE, BSIZE)),
dtype=np.double, copy=False)
else:
block = np.array(np.random.random((BSIZE, BSIZE)),
dtype=np.double, copy=False)
mb = np.matrix(block, dtype=np.double, copy=False)
matrix[i].append(mb)
# ## TASK SELECTION ## #
def multiply(a, b, c):
c += a*b
# ## MAIN PROGRAM ## #
if __name__ == "__main__":
args = sys.argv[1:]
MSIZE = int(args[0])
BSIZE = int(args[1])
A = []
B = []
C = []
initialize_variables()
for i in range(MSIZE):
for j in range(MSIZE):
for k in range(MSIZE):
multiply(A[i][k], B[k][j], C[i][j])
for i in range(MSIZE):
for j in range(MSIZE):
print ("C" + str(i) + str(j) + "=" + str(C[i][j]))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment