2016-07-28 41 views
0

在平台文件I只有一个主机:主机上正在运行的进程数是否有限制?

 <host id="Worker1" speed="100Mf" core="101"/> 

然后在worker.c我创建101(或> 100)处理期望,每个在每个核上一个进程将被启动。但我注意到,只有第一进程能够执行任务或XBT_INFO写:

int worker(int argc, char *argv[]) 
{ 
    for (int i = 0; i < 101; ++i) { 
     MSG_process_create("x", slave, NULL, MSG_host_self()); 
    } 
    return 0; 
} 

int slave(){ 
    MSG_task_execute(MSG_task_create("kotok", 1e6, 0, NULL)); 
    MSG_process_kill(MSG_process_self()); 
    return 0; 
} 

其他进程超过100首的人都无法管理和杀:

[ 1.000000] (0:[email protected]) Oops ! Deadlock or code not perfectly clean. 
[ 1.000000] (0:[email protected]) 1 processes are still running, waiting for something. 
[ 1.000000] (0:[email protected]) Legend of the following listing: "Process <pid> (<name>@<host>): <status>" 
[ 1.000000] (0:[email protected]) Process 102 ([email protected]): waiting for execution synchro 0x26484d0 (kotok) in state 2 to finish 

UPDATE 这里的一些代码功能是:

main

int main(int argc, char *argv[]) 
{ 
    MSG_init(&argc, argv); 

    MSG_create_environment(argv[1]);   /** - Load the platform description */ 
    MSG_function_register("worker", worker); 
    MSG_launch_application(argv[2]);   /** - Deploy the application */ 

    msg_error_t res = MSG_main();    /** - Run the simulation */ 

    XBT_INFO("Simulation time %g", MSG_get_clock()); 

    return res != MSG_OK; 
} 

deployment.xml中

<?xml version='1.0'?> 
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd"> 
<platform version="4"> 

    <process host="Worker1" function="worker"> 
     <argument value="0"/> 
    </process> 

</platform> 

回答

1

实际上maxmin系统的大小(SimGrid的核心)的内部限制是100,在这种情况下可能会被触发。我只是添加了一个标志来使此限制可配置。你可以拉最后的版本,并尝试将maxmin/concurrency_limit设置为1000,看看它是否解决了你的问题?

1

,可以在主机上启动了无关的内核数量进程的数量。正如在真机上一样,由于分时机制,您可以同时运行多个进程。这里也一样。当正在运行的进程数大于核心数(1个或更多)时,他们必须共享资源。

问题的原因在其他地方,但是您没有提供完整的最小工作示例(main?部署文件?),并且很难提供帮助。

相关问题