<commit_before>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.examples.matrix;

import java.io.File;
import java.util.Set;

import org.apache.log4j.Logger;
import org.objectweb.proactive.api.PAActiveObject;
import org.objectweb.proactive.core.config.ProActiveConfiguration;
import org.objectweb.proactive.core.node.Node;
import org.objectweb.proactive.core.util.log.Loggers;
import org.objectweb.proactive.core.util.log.ProActiveLogger;
import org.objectweb.proactive.extra.gcmdeployment.API;
import org.objectweb.proactive.extra.gcmdeployment.GCMApplication.GCMApplicationDescriptor;
import org.objectweb.proactive.extra.gcmdeployment.core.GCMVirtualNode;


public class Main {
    static Logger logger = ProActiveLogger.getLogger(Loggers.EXAMPLES);

    public static void main(String[] args) {
        if (args.length != 2) {
            logger.error("Usage: java " + Main.class.getName() + " <size> <deploiement file>");
            System.exit(0);
        }

        ProActiveConfiguration.load();

        //	
        //	String[] nodesList = readNodesList(args[0]);	
        //	//String targetNode = nodesList[0].substring(0, nodesList[0].length()-1)+"2";
        GCMApplicationDescriptor proActiveDescriptor = null;
        Set<Node> nodesList = null;
        try {
            proActiveDescriptor = API.getGCMApplicationDescriptor(new File(args[1]));
            proActiveDescriptor.startDeployment();
            GCMVirtualNode vn1 = proActiveDescriptor.getVirtualNode("matrixNode");

            //Thread.sleep(15000);
            nodesList = vn1.getCurrentNodes();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("Pb when reading descriptor");
        }

        Launcher l = null;

        try {
            l = (Launcher) PAActiveObject.newActive(Launcher.class.getName(), new Object[] { nodesList }); //,targetNode);
        } catch (Exception e) {
            logger.error("\nUnable to create the Launcher !!!!!\n");
            e.printStackTrace();
        }

        int matrixSize = Integer.parseInt(args[0]);

        Matrix m1;
        Matrix m2 = new Matrix(matrixSize, matrixSize);
        m2.initializeWithRandomValues();

        long startTime;<commit_msg>make sure virtual node is ready before going on<commit_after>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.examples.matrix;

import java.io.File;
import java.util.Set;

import org.apache.log4j.Logger;
import org.objectweb.proactive.api.PAActiveObject;
import org.objectweb.proactive.core.config.ProActiveConfiguration;
import org.objectweb.proactive.core.node.Node;
import org.objectweb.proactive.core.util.log.Loggers;
import org.objectweb.proactive.core.util.log.ProActiveLogger;
import org.objectweb.proactive.extra.gcmdeployment.API;
import org.objectweb.proactive.extra.gcmdeployment.GCMApplication.GCMApplicationDescriptor;
import org.objectweb.proactive.extra.gcmdeployment.core.GCMVirtualNode;


public class Main {
    static Logger logger = ProActiveLogger.getLogger(Loggers.EXAMPLES);

    public static void main(String[] args) {
        if (args.length != 2) {
            logger.error("Usage: java " + Main.class.getName() + " <size> <deploiement file>");
            System.exit(0);
        }

        ProActiveConfiguration.load();

        //	
        //	String[] nodesList = readNodesList(args[0]);	
        //	//String targetNode = nodesList[0].substring(0, nodesList[0].length()-1)+"2";
        GCMApplicationDescriptor proActiveDescriptor = null;
        Set<Node> nodesList = null;
        try {
            proActiveDescriptor = API.getGCMApplicationDescriptor(new File(args[1]));
            proActiveDescriptor.startDeployment();
            GCMVirtualNode vn1 = proActiveDescriptor.getVirtualNode("matrixNode");
            vn1.waitReady();
            //Thread.sleep(15000);
            nodesList = vn1.getCurrentNodes();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("Pb when reading descriptor");
        }

        Launcher l = null;

        try {
            l = (Launcher) PAActiveObject.newActive(Launcher.class.getName(), new Object[] { nodesList }); //,targetNode);
        } catch (Exception e) {
            logger.error("\nUnable to create the Launcher !!!!!\n");
            e.printStackTrace();
        }

        int matrixSize = Integer.parseInt(args[0]);

        Matrix m1;
        Matrix m2 = new Matrix(matrixSize, matrixSize);
        m2.initializeWithRandomValues();

        long startTime;
{'fraction_non_alphanumeric': 0.1362847222222222, 'fraction_numerical': 0.012876157407407407, 'mean_word_length': 3.0856973995271866, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7659110', 'n_tokens_mistral': 1945, 'n_tokens_neox': 1837, 'n_words': 514}